From 566859fb520fe6fbb93f63a5dfabc4b5bfcaefbe Mon Sep 17 00:00:00 2001 From: Upayavira Date: Sun, 12 Jul 2015 21:44:06 +0000 Subject: [PATCH] SOLR-7783 - AngularUI core admin optimize fixes git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1690537 13f79535-47bb-0310-9956-ffa450edef68 --- solr/webapp/web/js/angular/controllers/cores.js | 16 +++++++++++++--- solr/webapp/web/partials/cores.html | 5 +++-- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/solr/webapp/web/js/angular/controllers/cores.js b/solr/webapp/web/js/angular/controllers/cores.js index 263c9596e3a..4be58da7c4a 100644 --- a/solr/webapp/web/js/angular/controllers/cores.js +++ b/solr/webapp/web/js/angular/controllers/cores.js @@ -17,14 +17,13 @@ // @todo test optimize (delete stuff, watch button appear, test button/form) solrAdminApp.controller('CoreAdminController', - ['$scope', '$routeParams', '$location', '$timeout', 'Cores', - function($scope, $routeParams, $location, $timeout, Cores){ + ['$scope', '$routeParams', '$location', '$timeout', 'Cores', 'Update', + function($scope, $routeParams, $location, $timeout, Cores, Update){ $scope.resetMenu("cores"); $scope.currentCore = $routeParams.core; $scope.refresh = function() { Cores.get(function(data) { var coreCount = 0; - // @todo mark 'current' core in navigation with 'current' style for (_obj in data.status) coreCount++; $scope.hasCores = coreCount >0; if (!$scope.currentCore && coreCount==0) { @@ -165,6 +164,17 @@ solrAdminApp.controller('CoreAdminController', }; $scope.optimizeCore = function() { + Update.optimize({core: $scope.currentCore}, + function(successData) { + $scope.optimizeSuccess = true; + $timeout(function() {$scope.optimizeSuccess=false}, 1000); + $scope.refresh(); + }, + function(failureData) { + $scope.optimizeFailure = true; + $timeout(function () {$scope.optimizeFailure=false}, 1000); + $scope.refresh(); + }); }; $scope.refresh(); diff --git a/solr/webapp/web/partials/cores.html b/solr/webapp/web/partials/cores.html index f222410c2fd..5957f716665 100644 --- a/solr/webapp/web/partials/cores.html +++ b/solr/webapp/web/partials/cores.html @@ -29,7 +29,8 @@ limitations under the License. - +
@@ -199,7 +200,7 @@ limitations under the License.
  • optimized:
    -
    +