You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by st...@apache.org on 2021/09/27 03:35:08 UTC

[rocketmq-dashboard] branch master updated: [ISSUE #22]Optimizing the ops page. (#23)

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

styletang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
     new 9e9762e  [ISSUE #22]Optimizing the ops page. (#23)
9e9762e is described below

commit 9e9762ef44b26cc81b8c6aac82abf87114f5355d
Author: zhangjidi2016 <10...@qq.com>
AuthorDate: Mon Sep 27 11:35:00 2021 +0800

    [ISSUE #22]Optimizing the ops page. (#23)
    
    Co-authored-by: zhangjidi <zh...@cmss.chinamobile.com>
---
 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 @@
     <div class="page-content">
         <h2 class="md-title">NameServerAddressList</h2>
         <div class="pull-left">
-            <input type="text" class="form-control" ng-model="namesvrAddrList" ng-disabled="{{!writeOperationEnabled}}"/>
+            <md-chips ng-model="namesvrAddrList" md-on-add="eleChange(namesvrAddrList)"
+                      md-on-remove="eleChange(namesvrAddrList)" readonly="inputReadonly" md-removable="ctrl.removable"></md-chips>
         </div>
         <div class="pull-left">
             <button class="btn btn-raised btn-sm btn-primary" type="button" ng-show="{{writeOperationEnabled}}"