From 6fb7ff0a1ae2b19a47a559cfaade6258c8a10034 Mon Sep 17 00:00:00 2001 From: nichunen Date: Mon, 24 Jun 2019 10:13:03 +0800 Subject: [PATCH] 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 f252a003dd3..606cf1bdd67 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 +});