system-rule-dialog.html 4.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <div>
  2. <span class="brand" style="font-weight:bold;">{{systemRuleDialog.title}}</span>
  3. <div class="card" style="margin-top: 20px;margin-bottom: 10px;">
  4. <div class="panel-body">
  5. <div class="row">
  6. <form role="form" class="form-horizontal">
  7. <div class="form-group">
  8. <label class="col-sm-2 control-label">阈值类型</label>
  9. <div class="col-sm-9">
  10. <div class="form-control" ng-if="systemRuleDialog.type == 'edit'" align="center">
  11. <!--highestSystemLoad -->
  12. <input type="radio" name="grade" value="0" checked ng-model='currentRule.grade' ng-disabled="systemRuleDialog.type == 'edit'" />&nbsp;LOAD&nbsp;&nbsp;
  13. <!--avgRt -->
  14. <input type="radio" name="grade" value="1" ng-model='currentRule.grade' ng-disabled="systemRuleDialog.type == 'edit'" />&nbsp;RT&nbsp;&nbsp;
  15. <!--maxThread -->
  16. <input type="radio" name="grade" value="2" ng-model='currentRule.grade' ng-disabled="systemRuleDialog.type == 'edit'" />&nbsp;线程数&nbsp;&nbsp;
  17. <!--qps -->
  18. <input type="radio" name="grade" value="3" ng-model='currentRule.grade' ng-disabled="systemRuleDialog.type == 'edit'"/>&nbsp;入口 QPS&nbsp;&nbsp;
  19. <!--highestCpuUsage -->
  20. <input type="radio" name="grade" value="4" ng-model='currentRule.grade' ng-disabled="systemRuleDialog.type == 'edit'" />&nbsp;CPU 使用率&nbsp;&nbsp;
  21. </div>
  22. <div class="form-control highlight-border" ng-if="systemRuleDialog.type == 'add'" align="center">
  23. <!--highestSystemLoad -->
  24. <input type="radio" name="grade" value="0" ng-model='currentRule.grade' ng-disabled="systemRuleDialog.type == 'edit'" />&nbsp;LOAD&nbsp;&nbsp;
  25. <!--avgRt -->
  26. <input type="radio" name="grade" value="1" ng-model='currentRule.grade' ng-disabled="systemRuleDialog.type == 'edit'" />&nbsp;RT&nbsp;&nbsp;
  27. <!--maxThread -->
  28. <input type="radio" name="grade" value="2" ng-model='currentRule.grade' ng-disabled="systemRuleDialog.type == 'edit'" />&nbsp;线程数&nbsp;&nbsp;
  29. <!--qps -->
  30. <input type="radio" name="grade" value="3" ng-model='currentRule.grade' ng-disabled="systemRuleDialog.type == 'edit'"/>&nbsp;入口 QPS&nbsp;&nbsp;
  31. <!--highestCpuUsage -->
  32. <input type="radio" name="grade" value="4" checked ng-model='currentRule.grade' ng-disabled="systemRuleDialog.type == 'edit'" />&nbsp;CPU 使用率&nbsp;&nbsp;
  33. </div>
  34. </div>
  35. </div>
  36. <div class="form-group">
  37. <label class="col-sm-2 control-label">阈值</label>
  38. <div class="col-sm-9">
  39. <input type='number' min="0" class="form-control highlight-border" ng-model='currentRule.highestSystemLoad' placeholder="[0, ~)的正整数" ng-if="currentRule.grade == 0"/>
  40. <input type='number' min="0" class="form-control highlight-border" ng-model='currentRule.avgRt' placeholder="[0, ~)的正整数" ng-if="currentRule.grade == 1"/>
  41. <input type='number' min="0" class="form-control highlight-border" ng-model='currentRule.maxThread' placeholder="[0, ~)的正整数" ng-if="currentRule.grade == 2"/>
  42. <input type='number' min="0" class="form-control highlight-border" ng-model='currentRule.qps' placeholder="[0, ~)的正整数" ng-if="currentRule.grade == 3"/>
  43. <input type='number' min="0" class="form-control highlight-border" ng-model='currentRule.highestCpuUsage' placeholder="[0, 1]的小数,代表百分比" ng-if="currentRule.grade == 4"/>
  44. </div>
  45. </div>
  46. </form>
  47. </div>
  48. <div class="separator"></div>
  49. <div clss="row" style="margin-top: 20px;">
  50. <button class="btn btn-outline-danger" style="float:right; height: 30px;font-size: 12px;margin-left: 10px;" ng-click="closeThisDialog()">取消</button>
  51. <button class="btn btn-outline-success" style="float:right; height: 30px;font-size: 12px;" ng-click="saveRule()">{{systemRuleDialog.confirmBtnText}}</button>
  52. </div>
  53. </div>
  54. </div>
  55. </div>