瀏覽代碼

Fixes #51, use js type–converting comparisons.

master
Carpenter Lee 6 年之前
父節點
當前提交
430ef8a99a
共有 3 個文件被更改,包括 13 次插入13 次删除
  1. +8
    -8
      sentinel-dashboard/src/main/webapp/resources/app/scripts/services/systemservice.js
  2. +4
    -4
      sentinel-dashboard/src/main/webapp/resources/app/views/dialog/system-rule-dialog.html
  3. +1
    -1
      sentinel-dashboard/src/main/webapp/resources/dist/js/app.js

+ 8
- 8
sentinel-dashboard/src/main/webapp/resources/app/scripts/services/systemservice.js 查看文件

@@ -20,13 +20,13 @@ app.service('SystemService', ['$http', function ($http) {
ip: rule.ip,
port: rule.port
};
if (rule.grade === 0) {// avgLoad
if (rule.grade == 0) {// avgLoad
param.avgLoad = rule.avgLoad;
} else if (rule.grade === 1) {// avgRt
} else if (rule.grade == 1) {// avgRt
param.avgRt = rule.avgRt;
} else if (rule.grade === 2) {// maxThread
} else if (rule.grade == 2) {// maxThread
param.maxThread = rule.maxThread;
} else if (rule.grade === 3) {// qps
} else if (rule.grade == 3) {// qps
param.qps = rule.qps;
}

@@ -41,13 +41,13 @@ app.service('SystemService', ['$http', function ($http) {
var param = {
id: rule.id,
};
if (rule.grade === 0) {// avgLoad
if (rule.grade == 0) {// avgLoad
param.avgLoad = rule.avgLoad;
} else if (rule.grade === 1) {// avgRt
} else if (rule.grade == 1) {// avgRt
param.avgRt = rule.avgRt;
} else if (rule.grade === 2) {// maxThread
} else if (rule.grade == 2) {// maxThread
param.maxThread = rule.maxThread;
} else if (rule.grade === 3) {// qps
} else if (rule.grade == 3) {// qps
param.qps = rule.qps;
}
return $http({


+ 4
- 4
sentinel-dashboard/src/main/webapp/resources/app/views/dialog/system-rule-dialog.html 查看文件

@@ -35,13 +35,13 @@
<div class="form-group">
<label class="col-sm-2 control-label">阈值</label>
<div class="col-sm-9">
<input type='number' class="form-control highlight-border" ng-model='currentRule.avgLoad' placeholder="阈值" ng-if="currentRule.grade == 0"
<input type='number' class="form-control highlight-border" ng-model='currentRule.avgLoad' placeholder="[0, ~)的小数" ng-if="currentRule.grade == 0"
/>
<input type='number' class="form-control highlight-border" ng-model='currentRule.avgRt' placeholder="阈值" ng-if="currentRule.grade == 1"
<input type='number' class="form-control highlight-border" ng-model='currentRule.avgRt' placeholder="[0, ~)的整数" ng-if="currentRule.grade == 1"
/>
<input type='number' class="form-control highlight-border" ng-model='currentRule.maxThread' placeholder="阈值" ng-if="currentRule.grade == 2"
<input type='number' class="form-control highlight-border" ng-model='currentRule.maxThread' placeholder="[0, ~)的整数" ng-if="currentRule.grade == 2"
/>
<input type='number' class="form-control highlight-border" ng-model='currentRule.qps' placeholder="阈值" ng-if="currentRule.grade == 3"
<input type='number' class="form-control highlight-border" ng-model='currentRule.qps' placeholder="[0, ~)的小数" ng-if="currentRule.grade == 3"
/>
</div>
</div>


+ 1
- 1
sentinel-dashboard/src/main/webapp/resources/dist/js/app.js
文件差異過大導致無法顯示
查看文件


Loading…
取消
儲存