tab_alerting.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <!-- <div ng&#45;if="!ctrl.alert.enabled"> -->
  2. <!-- <div class="gf&#45;form&#45;group"> -->
  3. <!-- <h5 class="section&#45;heading">Visual Thresholds</h5> -->
  4. <!-- <div class="gf&#45;form&#45;inline"> -->
  5. <!-- <div class="gf&#45;form"> -->
  6. <!-- <span class="gf&#45;form&#45;label"> -->
  7. <!-- <i class="icon&#45;gf icon&#45;gf&#45;warn alert&#45;icon&#45;critical"></i> -->
  8. <!-- Critcal if -->
  9. <!-- </span> -->
  10. <!-- <metric&#45;segment&#45;model property="ctrl.alert.crit.op" options="ctrl.operatorList" custom="false" css&#45;class="query&#45;segment&#45;operator" on&#45;change="ctrl.thresholdsUpdated()"></metric&#45;segment&#45;model> -->
  11. <!-- <input class="gf&#45;form&#45;input max&#45;width&#45;7" type="number" ng&#45;model="ctrl.alert.crit.value" ng&#45;change="ctrl.thresholdsUpdated()"></input> -->
  12. <!-- </div> -->
  13. <!-- <div class="gf&#45;form"> -->
  14. <!-- <span class="gf&#45;form&#45;label"> -->
  15. <!-- <i class="icon&#45;gf icon&#45;gf&#45;warn alert&#45;icon&#45;warn"></i> -->
  16. <!-- Warn if -->
  17. <!-- </span> -->
  18. <!-- <metric&#45;segment&#45;model property="ctrl.alert.warn.op" options="ctrl.operatorList" custom="false" css&#45;class="query&#45;segment&#45;operator" on&#45;change="ctrl.thresholdsUpdated()"></metric&#45;segment&#45;model> -->
  19. <!-- <input class="gf&#45;form&#45;input max&#45;width&#45;7" type="number" ng&#45;model="ctrl.alert.warn.value" ng&#45;change="ctrl.thresholdsUpdated()"></input> -->
  20. <!-- </div> -->
  21. <!-- </div> -->
  22. <!-- </div> -->
  23. <!-- </div> -->
  24. <div ng-if="ctrl.alert.enabled">
  25. <div class="gf-form-group">
  26. <h5 class="section-heading">Alert Rule</h5>
  27. <div class="gf-form-inline">
  28. <div class="gf-form">
  29. <span class="gf-form-label">Name</span>
  30. <input type="text" class="gf-form-input width-22" ng-model="ctrl.alert.name">
  31. </div>
  32. <div class="gf-form">
  33. <span class="gf-form-label">Evaluate every</span>
  34. <input class="gf-form-input max-width-7" type="text" ng-model="ctrl.alert.frequency"></input>
  35. </div>
  36. <div class="gf-form">
  37. <span class="gf-form-label">Severity</span>
  38. <div class="gf-form-select-wrapper">
  39. <select class="gf-form-input" ng-model="ctrl.alert.severity" ng-options="f.value as f.text for f in ctrl.severityLevels">
  40. </select>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. <div class="gf-form-group">
  46. <h5 class="section-heading">Conditions</h5>
  47. <div class="gf-form-inline" ng-repeat="conditionModel in ctrl.conditionModels">
  48. <div class="gf-form">
  49. <span class="gf-form-label query-keyword width-5" ng-if="$index">AND</span>
  50. <span class="gf-form-label query-keyword width-5" ng-if="$index===0">WHEN</span>
  51. </div>
  52. <div class="gf-form">
  53. <query-part-editor
  54. class="gf-form-label query-part"
  55. part="conditionModel.queryPart"
  56. part-updated="ctrl.queryPartUpdated(conditionModel)">
  57. </query-part-editor>
  58. </div>
  59. <div class="gf-form">
  60. <span class="gf-form-label">Reducer</span>
  61. <query-part-editor
  62. class="gf-form-label query-part"
  63. part="conditionModel.reducerPart"
  64. part-updated="ctrl.reducerPartUpdated(conditionModel)">
  65. </query-part-editor>
  66. </div>
  67. <div class="gf-form">
  68. <span class="gf-form-label">Value</span>
  69. <metric-segment-model property="conditionModel.evaluator.type" options="ctrl.evalFunctions" custom="false" css-class="query-segment-operator" on-change="ctrl.thresholdUpdated()"></metric-segment-model>
  70. <input class="gf-form-input max-width-7" type="number" ng-model="conditionModel.evaluator.params[0]" ng-change="ctrl.thresholdUpdated()"></input>
  71. </div>
  72. <div class="gf-form">
  73. <label class="gf-form-label">
  74. <a class="pointer" tabindex="1" ng-click="ctrl.removeCondition($index)">
  75. <i class="fa fa-trash"></i>
  76. </a>
  77. </label>
  78. </div>
  79. </div>
  80. <div class="gf-form">
  81. <label class="gf-form-label dropdown">
  82. <a class="pointer dropdown-toggle" data-toggle="dropdown">
  83. <i class="fa fa-plus"></i>
  84. </a>
  85. <ul class="dropdown-menu" role="menu">
  86. <li ng-repeat="ct in ctrl.conditionTypes" role="menuitem">
  87. <a ng-click="ctrl.addCondition(ct.value);">{{ct.text}}</a>
  88. </li>
  89. </ul>
  90. </label>
  91. </div>
  92. </div>
  93. <div class="gf-form-group">
  94. <h5 class="section-heading">Notifications</h5>
  95. <div class="gf-form-inline">
  96. <div class="gf-form max-width-30">
  97. <span class="gf-form-label" ng-repeat="nc in ctrl.alertNotifications">
  98. {{nc.name}}
  99. <i class="fa fa-remove pointer" ng-click="ctrl.removeNotification($index)"></i>
  100. </span>
  101. <metric-segment segment="ctrl.addNotificationSegment" get-options="ctrl.getNotifications()" on-change="ctrl.notificationAdded()"></metric-segment>
  102. </div>
  103. </div>
  104. </div>
  105. <div class="gf-form-group">
  106. <div class="gf-form-button-row">
  107. <button class="btn btn-inverse" ng-click="ctrl.test()">
  108. Test Rule
  109. </button>
  110. <button class="btn btn-inverse" ng-click="ctrl.delete()">
  111. Delete Alert
  112. </button>
  113. </div>
  114. </div>
  115. </div>
  116. <div class="gf-form-group" ng-if="ctrl.testing">
  117. Evaluating rule <i class="fa fa-spinner fa-spin"></i>
  118. </div>
  119. <div class="gf-form-group" ng-if="ctrl.testResult">
  120. <json-tree root-name="result" object="ctrl.testResult" start-expanded="true"></json-tree>
  121. </div>
  122. <div class="gf-form-group" ng-if="!ctrl.alert.enabled">
  123. <div class="gf-form-button-row">
  124. <button class="btn btn-inverse" ng-click="ctrl.enable()">
  125. <i class="icon-gf icon-gf-alert"></i>
  126. Create Alert
  127. </button>
  128. </div>
  129. </div>