You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by bo...@apache.org on 2019/06/24 02:14:22 UTC

[kylin] 02/02: KYLIN-3933 Do not refresh front-end page after replica set related operations

This is an automated email from the ASF dual-hosted git repository.

boblu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kylin.git

commit 6fb7ff0a1ae2b19a47a559cfaade6258c8a10034
Author: nichunen <ni...@apache.org>
AuthorDate: Mon Jun 24 10:13:03 2019 +0800

    KYLIN-3933 Do not  refresh front-end page after replica set related operations
---
 webapp/app/js/controllers/adminStreaming.js | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/webapp/app/js/controllers/adminStreaming.js b/webapp/app/js/controllers/adminStreaming.js
index f252a00..606cf1b 100644
--- a/webapp/app/js/controllers/adminStreaming.js
+++ b/webapp/app/js/controllers/adminStreaming.js
@@ -79,7 +79,7 @@ KylinApp.controller('AdminStreamingCtrl', function ($scope, $timeout, $modal, Ad
             drawLiquidChart(reId, receiverState.rate, receiverState.state, 'isAvailable');
           }
         });
-        callback();
+        callback && callback();
       }, 100);
     }, function(e) {
       if (e.data && e.data.exception) {
@@ -89,7 +89,7 @@ KylinApp.controller('AdminStreamingCtrl', function ($scope, $timeout, $modal, Ad
       } else {
         SweetAlert.swal('Oops...', 'Failed get replica set', 'error');
       }
-      callback();
+      callback && callback();
     });
   };
 
@@ -136,20 +136,19 @@ KylinApp.controller('AdminStreamingCtrl', function ($scope, $timeout, $modal, Ad
                 });
                 $scope.replicaSet = newReplicaSet;
                 scope.listReplicaSet(function() {
+                  $scope.availableNodes = scope.availableReceiver;
                   loadingRequest.hide();
-                  location.reload();
                 });
               }, function(e) {
                 scope.listReplicaSet(function() {
+                  $scope.availableNodes = scope.availableReceiver;
                   loadingRequest.hide();
-                  location.reload();
                 });
                 errorMessage(e, 'Failed get replica set');
               });
             }, function(e) {
               scope.listReplicaSet(function() {
                 loadingRequest.hide();
-                location.reload();
               });
               errorMessage(e, 'Failed remove receiver');
             });
@@ -167,20 +166,19 @@ KylinApp.controller('AdminStreamingCtrl', function ($scope, $timeout, $modal, Ad
                 $scope.replicaSet = newReplicaSet;
                 $scope.node.selected = '';
                 scope.listReplicaSet(function() {
+                  $scope.availableNodes = scope.availableReceiver;
                   loadingRequest.hide();
-                  location.reload();
                 });
               }, function(e) {
                 scope.listReplicaSet(function() {
+                  $scope.availableNodes = scope.availableReceiver;
                   loadingRequest.hide();
-                  location.reload();
                 });
                 errorMessage(e, 'Failed get replica set');
               });
             }, function(e) {
               scope.listReplicaSet(function() {
                 loadingRequest.hide();
-                location.reload();
               });
               errorMessage(e, 'Failed to add node');
             });
@@ -349,4 +347,4 @@ KylinApp.controller('StreamingReceiverCtrl', function($scope, $routeParams, $mod
 
   $scope.getReceiverStats();
 
-});
\ No newline at end of file
+});