Pārlūkot izejas kodu

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
master
cdfive Eric Zhao pirms 5 gadiem
vecāks
revīzija
5a691140b0
8 mainītis faili ar 24 papildinājumiem un 11 dzēšanām
  1. +1
    -1
      sentinel-dashboard/src/main/webapp/resources/app/scripts/controllers/authority.js
  2. +1
    -1
      sentinel-dashboard/src/main/webapp/resources/app/scripts/controllers/degrade.js
  3. +1
    -1
      sentinel-dashboard/src/main/webapp/resources/app/scripts/controllers/flow_v1.js
  4. +3
    -2
      sentinel-dashboard/src/main/webapp/resources/app/scripts/controllers/flow_v2.js
  5. +1
    -1
      sentinel-dashboard/src/main/webapp/resources/app/scripts/controllers/param_flow.js
  6. +1
    -1
      sentinel-dashboard/src/main/webapp/resources/app/scripts/controllers/system.js
  7. +13
    -1
      sentinel-dashboard/src/main/webapp/resources/app/views/dialog/flow-rule-dialog.html
  8. +3
    -3
      sentinel-dashboard/src/main/webapp/resources/app/views/metric.html

+ 1
- 1
sentinel-dashboard/src/main/webapp/resources/app/scripts/controllers/authority.js Parādīt failu

@@ -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',


+ 1
- 1
sentinel-dashboard/src/main/webapp/resources/app/scripts/controllers/degrade.js Parādīt failu

@@ -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',


+ 1
- 1
sentinel-dashboard/src/main/webapp/resources/app/scripts/controllers/flow_v1.js Parādīt failu

@@ -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',


+ 3
- 2
sentinel-dashboard/src/main/webapp/resources/app/scripts/controllers/flow_v2.js Parādīt failu

@@ -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 = {


+ 1
- 1
sentinel-dashboard/src/main/webapp/resources/app/scripts/controllers/param_flow.js Parādīt failu

@@ -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',


+ 1
- 1
sentinel-dashboard/src/main/webapp/resources/app/scripts/controllers/system.js Parādīt failu

@@ -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',


+ 13
- 1
sentinel-dashboard/src/main/webapp/resources/app/views/dialog/flow-rule-dialog.html Parādīt failu

@@ -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>

+ 3
- 3
sentinel-dashboard/src/main/webapp/resources/app/views/metric.html Parādīt failu

@@ -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 -->


Notiek ielāde…
Atcelt
Saglabāt