Loading app/controllers/ForceMergeController.scala 0 → 100644 +9 −0 Original line number Diff line number Diff line package controllers import models.ElasticServer class ForceMergeController extends ElasticActionController { def processElasticRequest = (request, client) => client.forceMerge(request.get("indices"), ElasticServer(request.host, request.authentication)) } app/controllers/OptimizeIndexController.scaladeleted 100644 → 0 +0 −9 Original line number Diff line number Diff line package controllers import models.ElasticServer class OptimizeIndexController extends ElasticActionController { def processElasticRequest = (request, client) => client.optimizeIndex(request.get("indices"), ElasticServer(request.host, request.authentication)) } app/elastic/ElasticClient.scala +2 −2 Original line number Diff line number Diff line Loading @@ -67,8 +67,8 @@ trait ElasticClient { } def optimizeIndex(index: String, target: ElasticServer) = { val path = s"/$index/_optimize" def forceMerge(index: String, target: ElasticServer) = { val path = s"/$index/_forcemerge" execute(s"${target.host}$path", "POST", None, target.authentication) } Loading conf/routes +1 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ POST /main @controllers.Main.execute POST /apis/overview @controllers.ClusterOverviewController.execute POST /apis/close_indices @controllers.CloseIndexController.execute POST /apis/open_indices @controllers.OpenIndexController.execute POST /apis/optimize_indices @controllers.OptimizeIndexController.execute POST /apis/force_merge @controllers.ForceMergeController.execute POST /apis/clear_indices_cache @controllers.ClearIndexCacheController.execute POST /apis/refresh_indices @controllers.RefreshIndexController.execute POST /apis/delete_indices @controllers.DeleteIndexController.execute Loading public/app.js +6 −6 Original line number Diff line number Diff line Loading @@ -705,11 +705,11 @@ angular.module('cerebro').controller('OverviewController', ['$scope', '$http', ); }; $scope.optimizeIndex = function(index) { $scope.forceMerge = function(index) { ModalService.promptConfirmation( 'Optimize index ' + index + '?', function() { DataService.optimizeIndex(index, success, error); DataService.forceMerge(index, success, error); } ); }; Loading Loading @@ -740,14 +740,14 @@ angular.module('cerebro').controller('OverviewController', ['$scope', '$http', ); }; $scope.optimizeIndices = function() { $scope.forceMerges = function() { var indices = $scope.paginator.getResults().map(function(index) { return index.name; }); ModalService.promptConfirmation( 'Optimize all ' + indices.length + ' selected indices?', function() { DataService.optimizeIndex(indices.join(','), success, error); DataService.forceMerge(indices.join(','), success, error); } ); }; Loading Loading @@ -1138,8 +1138,8 @@ angular.module('cerebro').factory('DataService', request('/apis/open_indices', {indices: index}, success, error); }; this.optimizeIndex = function(index, success, error) { request('/apis/optimize_indices', {indices: index}, success, error); this.forceMerge = function(index, success, error) { request('/apis/force_merge', {indices: index}, success, error); }; this.refreshIndex = function(index, success, error) { Loading Loading
app/controllers/ForceMergeController.scala 0 → 100644 +9 −0 Original line number Diff line number Diff line package controllers import models.ElasticServer class ForceMergeController extends ElasticActionController { def processElasticRequest = (request, client) => client.forceMerge(request.get("indices"), ElasticServer(request.host, request.authentication)) }
app/controllers/OptimizeIndexController.scaladeleted 100644 → 0 +0 −9 Original line number Diff line number Diff line package controllers import models.ElasticServer class OptimizeIndexController extends ElasticActionController { def processElasticRequest = (request, client) => client.optimizeIndex(request.get("indices"), ElasticServer(request.host, request.authentication)) }
app/elastic/ElasticClient.scala +2 −2 Original line number Diff line number Diff line Loading @@ -67,8 +67,8 @@ trait ElasticClient { } def optimizeIndex(index: String, target: ElasticServer) = { val path = s"/$index/_optimize" def forceMerge(index: String, target: ElasticServer) = { val path = s"/$index/_forcemerge" execute(s"${target.host}$path", "POST", None, target.authentication) } Loading
conf/routes +1 −1 Original line number Diff line number Diff line Loading @@ -11,7 +11,7 @@ POST /main @controllers.Main.execute POST /apis/overview @controllers.ClusterOverviewController.execute POST /apis/close_indices @controllers.CloseIndexController.execute POST /apis/open_indices @controllers.OpenIndexController.execute POST /apis/optimize_indices @controllers.OptimizeIndexController.execute POST /apis/force_merge @controllers.ForceMergeController.execute POST /apis/clear_indices_cache @controllers.ClearIndexCacheController.execute POST /apis/refresh_indices @controllers.RefreshIndexController.execute POST /apis/delete_indices @controllers.DeleteIndexController.execute Loading
public/app.js +6 −6 Original line number Diff line number Diff line Loading @@ -705,11 +705,11 @@ angular.module('cerebro').controller('OverviewController', ['$scope', '$http', ); }; $scope.optimizeIndex = function(index) { $scope.forceMerge = function(index) { ModalService.promptConfirmation( 'Optimize index ' + index + '?', function() { DataService.optimizeIndex(index, success, error); DataService.forceMerge(index, success, error); } ); }; Loading Loading @@ -740,14 +740,14 @@ angular.module('cerebro').controller('OverviewController', ['$scope', '$http', ); }; $scope.optimizeIndices = function() { $scope.forceMerges = function() { var indices = $scope.paginator.getResults().map(function(index) { return index.name; }); ModalService.promptConfirmation( 'Optimize all ' + indices.length + ' selected indices?', function() { DataService.optimizeIndex(indices.join(','), success, error); DataService.forceMerge(indices.join(','), success, error); } ); }; Loading Loading @@ -1138,8 +1138,8 @@ angular.module('cerebro').factory('DataService', request('/apis/open_indices', {indices: index}, success, error); }; this.optimizeIndex = function(index, success, error) { request('/apis/optimize_indices', {indices: index}, success, error); this.forceMerge = function(index, success, error) { request('/apis/force_merge', {indices: index}, success, error); }; this.refreshIndex = function(index, success, error) { Loading