From f20e2f3a941c8ffd3f4bac5607bb4b5f782cc29d Mon Sep 17 00:00:00 2001 From: Alexandre Rafalovitch Date: Fri, 12 Aug 2016 23:05:22 +1000 Subject: [PATCH] SOLR-9232: Fix Swap Cores in Admin UI --- solr/CHANGES.txt | 2 ++ solr/webapp/web/js/angular/controllers/cores.js | 8 ++++---- solr/webapp/web/js/angular/services.js | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt index b2a384b2ce4..ee5b4a70f1a 100644 --- a/solr/CHANGES.txt +++ b/solr/CHANGES.txt @@ -206,6 +206,8 @@ Bug Fixes * SOLR-9405: ConcurrentModificationException in ZkStateReader.getStateWatchers. (Alan Woodward, Edward Ribeiro, shalin) +* SOLR-9232: Admin UI now fully implements Swap Cores interface (Alexandre Rafalovitch) + Optimizations ---------------------- diff --git a/solr/webapp/web/js/angular/controllers/cores.js b/solr/webapp/web/js/angular/controllers/cores.js index 347dbf4c1f8..41863f2b591 100644 --- a/solr/webapp/web/js/angular/controllers/cores.js +++ b/solr/webapp/web/js/angular/controllers/cores.js @@ -129,15 +129,15 @@ solrAdminApp.controller('CoreAdminController', }; $scope.swapCores = function() { - if ($scope.swapOther) { - $swapMessage = "Please select a core to swap with"; + if (!$scope.swapOther) { + $scope.swapMessage = "Please select a core to swap with"; } else if ($scope.swapOther == $scope.selectedCore) { - $swapMessage = "Cannot swap with the same core"; + $scope.swapMessage = "Cannot swap with the same core"; } else { Cores.swap({core: $scope.selectedCore, other: $scope.swapOther}, function(data) { $location.path("/~cores/" + $scope.swapOther); delete $scope.swapOther; - $scope.cancelSwap(); + $scope.cancelSwapCores(); }); } }; diff --git a/solr/webapp/web/js/angular/services.js b/solr/webapp/web/js/angular/services.js index 014d36ba525..f050c9b7253 100644 --- a/solr/webapp/web/js/angular/services.js +++ b/solr/webapp/web/js/angular/services.js @@ -47,7 +47,7 @@ solrAdminServices.factory('System', "add": {params:{action: "CREATE"}}, "unload": {params:{action: "UNLOAD", core: "@core"}}, "rename": {params:{action: "RENAME"}}, - "swap": {params:{}}, + "swap": {params:{action: "SWAP"}}, "reload": {method: "GET", params:{action:"RELOAD", core: "@core"}, headers:{doNotIntercept: "true"}}, "optimize": {params:{}} });