tab_alerting.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <div ng-if="ctrl.panel.alert">
  2. <div class="editor-row">
  3. <div class="gf-form-group section" >
  4. <h5 class="section-heading">Alert Query</h5>
  5. <div class="gf-form-inline">
  6. <div class="gf-form">
  7. <query-part-editor
  8. class="gf-form-label query-part"
  9. part="ctrl.query"
  10. part-updated="ctrl.queryUpdated()">
  11. </query-part-editor>
  12. </div>
  13. <div class="gf-form">
  14. <span class="gf-form-label">Transform using</span>
  15. <div class="gf-form-select-wrapper">
  16. <select class="gf-form-input"
  17. ng-model="ctrl.alert.transform.type"
  18. ng-options="f.type as f.text for f in ctrl.transforms"
  19. ng-change="ctrl.transformChanged()"
  20. >
  21. </select>
  22. </div>
  23. </div>
  24. <div class="gf-form" ng-if="ctrl.transformDef.type === 'aggregation'">
  25. <span class="gf-form-label">Method</span>
  26. <div class="gf-form-select-wrapper">
  27. <select class="gf-form-input"
  28. ng-model="ctrl.alert.transform.method"
  29. ng-options="f for f in ctrl.aggregators">
  30. </select>
  31. </div>
  32. </div>
  33. <div class="gf-form" ng-if="ctrl.transformDef.type === 'forecast'">
  34. <span class="gf-form-label">Timespan</span>
  35. <input class="gf-form-input max-width-5" type="text" ng-model="ctrl.alert.transform.timespan" ng-change="ctrl.ruleUpdated()"></input>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="gf-form-group section">
  40. <h5 class="section-heading">Levels</h5>
  41. <div class="gf-form-inline">
  42. <div class="gf-form">
  43. <span class="gf-form-label">
  44. <i class="icon-gf icon-gf-warn alert-icon-critical"></i>
  45. Critcal if
  46. </span>
  47. <metric-segment-model property="ctrl.alert.critical.op" options="ctrl.levelOpList" custom="false" css-class="query-segment-operator" on-change="ctrl.operatorChanged()"></metric-segment-model>
  48. <input class="gf-form-input max-width-7" type="number" ng-model="ctrl.alert.critical.level" ng-change="ctrl.levelsUpdated()"></input>
  49. </div>
  50. <div class="gf-form">
  51. <span class="gf-form-label">
  52. <i class="icon-gf icon-gf-warn alert-icon-warn"></i>
  53. Warn if
  54. </span>
  55. <metric-segment-model property="ctrl.alert.warn.op" options="ctrl.levelOpList" custom="false" css-class="query-segment-operator" on-change="ctrl.operatorChanged()"></metric-segment-model>
  56. <input class="gf-form-input max-width-7" type="number" ng-model="ctrl.alert.warn.level" ng-change="ctrl.levelsUpdated()"></input>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="editor-row">
  62. <div class="gf-form-group section">
  63. <h5 class="section-heading">Execution</h5>
  64. <div class="gf-form-inline">
  65. <div class="gf-form">
  66. <span class="gf-form-label">Handler</span>
  67. <div class="gf-form-select-wrapper">
  68. <select class="gf-form-input"
  69. ng-model="ctrl.alert.handler"
  70. ng-options="f.value as f.text for f in ctrl.handlers">
  71. </select>
  72. </div>
  73. </div>
  74. <div class="gf-form">
  75. <span class="gf-form-label">Evaluate every</span>
  76. <input class="gf-form-input max-width-7" type="text" ng-model="ctrl.alert.frequency"></input>
  77. </div>
  78. </div>
  79. </div>
  80. <div class="gf-form-group section">
  81. <h5 class="section-heading">Notifications</h5>
  82. <div class="gf-form-inline">
  83. <div class="gf-form">
  84. <span class="gf-form-label">Groups</span>
  85. <bootstrap-tagsinput ng-model="ctrl.alert.notify" tagclass="label label-tag" placeholder="add tags">
  86. </bootstrap-tagsinput>
  87. </div>
  88. </div>
  89. </div>
  90. </div>
  91. <div class="gf-form-group section">
  92. <h5 class="section-heading">Information</h5>
  93. <div class="gf-form">
  94. <span class="gf-form-label width-10">Alert name</span>
  95. <input type="text" class="gf-form-input width-22" ng-model="ctrl.panel.alerting.name">
  96. </div>
  97. <div class="gf-form-inline">
  98. <div class="gf-form">
  99. <span class="gf-form-label width-10" style="margin-top: -73px;">Alert description</span>
  100. </div>
  101. <div class="gf-form">
  102. <textarea rows="5" ng-model="ctrl.panel.alerting.description" class="gf-form-input width-22"></textarea>
  103. </div>
  104. </div>
  105. </div>
  106. </div>
  107. <div class="editor-row">
  108. <div class="gf-form-button-row">
  109. <button class="btn btn-danger" ng-click="ctrl.delete()" ng-show="ctrl.panel.alert">Delete</button>
  110. <button class="btn btn-inverse" ng-click="ctrl.enable()" ng-hide="ctrl.panel.alert">
  111. <i class="icon-gf icon-gf-alert"></i>
  112. Add Alert
  113. </button>
  114. </div>
  115. </div>