mirror of
https://github.com/apache/rocketmq-dashboard.git
synced 2025-09-10 19:48:29 +08:00
Co-authored-by: zhangjidi <zhangjidi@cmss.chinamobile.com>
This commit is contained in:
@@ -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});
|
||||
|
@@ -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}}"
|
||||
|
Reference in New Issue
Block a user