You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ar...@apache.org on 2016/08/12 13:32:38 UTC

lucene-solr:branch_6x: SOLR-9232: Fix Swap Cores in Admin UI

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x c60793592 -> 9ba422ac4


SOLR-9232: Fix Swap Cores in Admin UI


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/9ba422ac
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/9ba422ac
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/9ba422ac

Branch: refs/heads/branch_6x
Commit: 9ba422ac4482bb6e367d2c0a7a7dc9c3998ab1f9
Parents: c607935
Author: Alexandre Rafalovitch <ar...@apache.org>
Authored: Fri Aug 12 23:32:19 2016 +1000
Committer: Alexandre Rafalovitch <ar...@apache.org>
Committed: Fri Aug 12 23:32:19 2016 +1000

----------------------------------------------------------------------
 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(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ba422ac/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 3626da3..7a45d9b 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -171,6 +171,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
 ----------------------
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ba422ac/solr/webapp/web/js/angular/controllers/cores.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/angular/controllers/cores.js b/solr/webapp/web/js/angular/controllers/cores.js
index 347dbf4..41863f2 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();
           });
         }
       };

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ba422ac/solr/webapp/web/js/angular/services.js
----------------------------------------------------------------------
diff --git a/solr/webapp/web/js/angular/services.js b/solr/webapp/web/js/angular/services.js
index 014d36b..f050c9b 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:{}}
     });