mirror of
https://github.com/apache/rocketmq-dashboard.git
synced 2026-02-19 11:15:41 +08:00
Co-authored-by: zhangjidi2016 <zhangjidi@cmss.chinamobile.com>
This commit is contained in:
@@ -22,6 +22,7 @@ app.controller('opsController', ['$scope', '$location', '$http', 'Notification',
|
||||
$scope.userRole = $window.sessionStorage.getItem("userrole");
|
||||
$scope.writeOperationEnabled = $scope.userRole == null ? true : ($scope.userRole == 1 ? true : false);
|
||||
$scope.inputReadonly = !$scope.writeOperationEnabled;
|
||||
$scope.newNamesrvAddr = "";
|
||||
$http({
|
||||
method: "GET",
|
||||
url: "ops/homePage.query"
|
||||
@@ -53,6 +54,26 @@ app.controller('opsController', ['$scope', '$location', '$http', 'Notification',
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.addNameSvrAddr = function () {
|
||||
$http({
|
||||
method: "POST",
|
||||
url: "ops/addNameSvrAddr.do",
|
||||
params: {newNamesrvAddr: $scope.newNamesrvAddr}
|
||||
}).success(function (resp) {
|
||||
if (resp.status == 0) {
|
||||
if ($scope.namesvrAddrList.indexOf($scope.newNamesrvAddr) == -1) {
|
||||
$scope.namesvrAddrList.push($scope.newNamesrvAddr);
|
||||
}
|
||||
$("#namesrvAddr").val("");
|
||||
$scope.newNamesrvAddr = "";
|
||||
Notification.info({message: "SUCCESS", delay: 2000});
|
||||
} else {
|
||||
Notification.error({message: resp.errMsg, delay: 2000});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
$scope.updateIsVIPChannel = function () {
|
||||
$http({
|
||||
method: "POST",
|
||||
|
||||
@@ -28,6 +28,15 @@
|
||||
ng-click="updateNameSvrAddr()">{{'UPDATE' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
<form class="form-inline pull-left" style="margin-left: 20px" ng-show="{{writeOperationEnabled}}">
|
||||
<div class="form-group" style="margin: 0">
|
||||
<label for="namesrvAddr">NamesrvAddr:</label>
|
||||
<input id="namesrvAddr" class="form-control" style="width: 300px; margin: 0 10px 0 10px" type="text" ng-model="newNamesrvAddr" required/>
|
||||
<button class="btn btn-raised btn-sm btn-primary" type="button"
|
||||
ng-click="addNameSvrAddr()"> {{ 'ADD' | translate}}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
<br/>
|
||||
<br/>
|
||||
<h2 class="md-title">IsUseVIPChannel</h2>
|
||||
|
||||
Reference in New Issue
Block a user