Pārlūkot izejas kodu

Fixes #51, use js type–converting comparisons.

master
Carpenter Lee pirms 6 gadiem
vecāks
revīzija
430ef8a99a
3 mainītis faili ar 13 papildinājumiem un 13 dzēšanām
  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 Parādīt failu

@@ -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 Parādīt failu

@@ -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
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu


Notiek ielāde…
Atcelt
Saglabāt