From 9e9762ef44b26cc81b8c6aac82abf87114f5355d Mon Sep 17 00:00:00 2001 From: zhangjidi2016 <1017543663@qq.com> Date: Mon, 27 Sep 2021 11:35:00 +0800 Subject: [PATCH] [ISSUE #22]Optimizing the ops page. (#23) Co-authored-by: zhangjidi --- src/main/resources/static/src/ops.js | 11 ++++++++--- src/main/resources/static/view/pages/ops.html | 3 ++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/main/resources/static/src/ops.js b/src/main/resources/static/src/ops.js index 8338b06..8aab329 100644 --- a/src/main/resources/static/src/ops.js +++ b/src/main/resources/static/src/ops.js @@ -16,17 +16,18 @@ */ app.controller('opsController', ['$scope', '$location', '$http', 'Notification', 'remoteApi', 'tools', '$window', function ($scope, $location, $http, Notification, remoteApi, tools, $window) { - $scope.namesvrAddrList = ""; + $scope.namesvrAddrList = []; $scope.useVIPChannel = true; $scope.useTLS = false; $scope.userRole = $window.sessionStorage.getItem("userrole"); $scope.writeOperationEnabled = $scope.userRole == null ? true : ($scope.userRole == 1 ? true : false); + $scope.inputReadonly = !$scope.writeOperationEnabled; $http({ method: "GET", url: "ops/homePage.query" }).success(function (resp) { if (resp.status == 0) { - $scope.namesvrAddrList = resp.data.namesvrAddrList.join(";"); + $scope.namesvrAddrList = resp.data.namesvrAddrList; $scope.useVIPChannel = resp.data.useVIPChannel; $scope.useTLS = resp.data.useTLS; } else { @@ -34,11 +35,15 @@ app.controller('opsController', ['$scope', '$location', '$http', 'Notification', } }); + $scope.eleChange = function (data){ + $scope.namesvrAddrList = data; + } + $scope.updateNameSvrAddr = function () { $http({ method: "POST", url: "ops/updateNameSvrAddr.do", - params: {nameSvrAddrList: $scope.namesvrAddrList} + params: {nameSvrAddrList: $scope.namesvrAddrList.join(";")} }).success(function (resp) { if (resp.status == 0) { Notification.info({message: "SUCCESS", delay: 2000}); diff --git a/src/main/resources/static/view/pages/ops.html b/src/main/resources/static/view/pages/ops.html index 97c7b56..8dc0f4d 100644 --- a/src/main/resources/static/view/pages/ops.html +++ b/src/main/resources/static/view/pages/ops.html @@ -18,7 +18,8 @@

NameServerAddressList

- +