tab_alerting.html 6.0 KB

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