dashboard: make fallbackToLocalWhenFail be configurable in dashboard and fix edit rule issue when cancel (#370)
- Make fallbackToLocalWhenFail of cluster rules configurable in dashboard - Fix edit rule when hit cancel button (object share problem solved by deep copy) - Add metric table td header's title for friendly prompt info
This commit is contained in:
parent
c06aa6e290
commit
5a691140b0
|
|
@ -55,7 +55,7 @@ angular.module('sentinelDashboardApp').controller('AuthorityRuleController', ['$
|
|||
var authorityRuleDialog;
|
||||
|
||||
$scope.editRule = function (rule) {
|
||||
$scope.currentRule = rule;
|
||||
$scope.currentRule = angular.copy(rule);
|
||||
$scope.authorityRuleDialog = {
|
||||
title: '编辑授权规则',
|
||||
type: 'edit',
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ app.controller('DegradeCtl', ['$scope', '$stateParams', 'DegradeService', 'ngDia
|
|||
|
||||
var degradeRuleDialog;
|
||||
$scope.editRule = function (rule) {
|
||||
$scope.currentRule = rule;
|
||||
$scope.currentRule = angular.copy(rule);
|
||||
$scope.degradeRuleDialog = {
|
||||
title: '编辑降级规则',
|
||||
type: 'edit',
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ app.controller('FlowControllerV1', ['$scope', '$stateParams', 'FlowServiceV1', '
|
|||
|
||||
var flowRuleDialog;
|
||||
$scope.editRule = function (rule) {
|
||||
$scope.currentRule = rule;
|
||||
$scope.currentRule = angular.copy(rule);
|
||||
$scope.flowRuleDialog = {
|
||||
title: '编辑流控规则',
|
||||
type: 'edit',
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ app.controller('FlowControllerV2', ['$scope', '$stateParams', 'FlowServiceV2', '
|
|||
|
||||
var flowRuleDialog;
|
||||
$scope.editRule = function (rule) {
|
||||
$scope.currentRule = rule;
|
||||
$scope.currentRule = angular.copy(rule);
|
||||
$scope.flowRuleDialog = {
|
||||
title: '编辑流控规则',
|
||||
type: 'edit',
|
||||
|
|
@ -88,7 +88,8 @@ app.controller('FlowControllerV2', ['$scope', '$stateParams', 'FlowServiceV2', '
|
|||
limitApp: 'default',
|
||||
clusterMode: false,
|
||||
clusterConfig: {
|
||||
thresholdType: 0
|
||||
thresholdType: 0,
|
||||
fallbackToLocalWhenFail: true
|
||||
}
|
||||
};
|
||||
$scope.flowRuleDialog = {
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ angular.module('sentinelDashboardApp').controller('ParamFlowController', ['$scop
|
|||
var paramFlowRuleDialog;
|
||||
|
||||
$scope.editRule = function (rule) {
|
||||
$scope.currentRule = rule;
|
||||
$scope.currentRule = angular.copy(rule);
|
||||
$scope.paramFlowRuleDialog = {
|
||||
title: '编辑热点规则',
|
||||
type: 'edit',
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ app.controller('SystemCtl', ['$scope', '$stateParams', 'SystemService', 'ngDialo
|
|||
$scope.getMachineRules = getMachineRules;
|
||||
var systemRuleDialog;
|
||||
$scope.editRule = function (rule) {
|
||||
$scope.currentRule = rule;
|
||||
$scope.currentRule = angular.copy(rule);
|
||||
$scope.systemRuleDialog = {
|
||||
title: '编辑系统保护规则',
|
||||
type: 'edit',
|
||||
|
|
|
|||
|
|
@ -53,7 +53,9 @@
|
|||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label">是否集群</label>
|
||||
<div class="col-sm-2">
|
||||
<label class="checkbox-inline">
|
||||
<input type="checkbox" name="clusterMode" ng-model="currentRule.clusterMode">
|
||||
</label>
|
||||
</div>
|
||||
<div ng-if="currentRule.clusterMode">
|
||||
<label class="col-sm-3 control-label">集群阈值模式</label>
|
||||
|
|
@ -66,6 +68,16 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group" ng-if="currentRule.clusterMode">
|
||||
<label class="col-sm-2 control-label">失败退化</label>
|
||||
<div class="col-sm-8">
|
||||
<label class="checkbox-inline">
|
||||
<input type="checkbox" name="clusterMode" ng-model="currentRule.clusterConfig.fallbackToLocalWhenFail">
|
||||
<i class="glyphicon glyphicon-info-sign"></i>如果集群限流失败是否退化到单机限流
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div ng-if="!flowRuleDialog.showAdvanceButton">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" title="调用关系流控模式">流控模式</label>
|
||||
|
|
@ -133,4 +145,4 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -51,9 +51,9 @@
|
|||
<thead>
|
||||
<tr style="font-size: 13px;text-align:center;font-weight: bold;">
|
||||
<td style="word-wrap:break-word;word-break:break-all;">时间</td>
|
||||
<td style="word-wrap:break-word;word-break:break-all;">p_qps</td>
|
||||
<td style="word-wrap:break-word;word-break:break-all;">b_qps</td>
|
||||
<td style="word-wrap:break-word;word-break:break-all;">rt(ms)</td>
|
||||
<td style="word-wrap:break-word;word-break:break-all;" title="passQps: 通过的qps">p_qps</td>
|
||||
<td style="word-wrap:break-word;word-break:break-all;" title="blockQps: 拦截的qps">b_qps</td>
|
||||
<td style="word-wrap:break-word;word-break:break-all;" title="responseTime: 响应时间(毫秒)">rt(ms)</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<!-- thead -->
|
||||
|
|
|
|||
Loading…
Reference in New Issue