tab_alerting.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  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 max-width-30">
  29. <span class="gf-form-label width-8">Name</span>
  30. <input type="text" class="gf-form-input width-22" ng-model="ctrl.alert.name">
  31. </div>
  32. <!-- <div class="gf&#45;form"> -->
  33. <!-- <span class="gf&#45;form&#45;label width&#45;6">Handler</span> -->
  34. <!-- <div class="gf&#45;form&#45;select&#45;wrapper"> -->
  35. <!-- <select class="gf&#45;form&#45;input" -->
  36. <!-- ng&#45;model="ctrl.alert.handler" -->
  37. <!-- ng&#45;options="f.value as f.text for f in ctrl.handlers"> -->
  38. <!-- </select> -->
  39. <!-- </div> -->
  40. <!-- </div> -->
  41. <div class="gf-form">
  42. <span class="gf-form-label width-8">Evaluate every</span>
  43. <input class="gf-form-input max-width-7" type="text" ng-model="ctrl.alert.frequency"></input>
  44. </div>
  45. </div>
  46. <div class="gf-form-inline">
  47. <div class="gf-form max-width-30">
  48. <span class="gf-form-label width-8">Notifications</span>
  49. <input class="gf-form-input max-width-22" type="text" ng-model="ctrl.alert.notifications"></input>
  50. </div>
  51. <!--
  52. <bootstrap-tagsinput ng-model="ctrl.alert.notify" tagclass="label label-tag" placeholder="add tags">
  53. </bootstrap-tagsinput>
  54. -->
  55. <div class="gf-form">
  56. <span class="gf-form-label width-8">Severity</span>
  57. <div class="gf-form-select-wrapper">
  58. <select class="gf-form-input"
  59. ng-model="ctrl.alert.severity"
  60. ng-options="f.value as f.text for f in ctrl.severityLevels">
  61. </select>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <div class="gf-form-group">
  67. <h5 class="section-heading">Conditions</h5>
  68. <div class="gf-form-inline" ng-repeat="conditionModel in ctrl.conditionModels">
  69. <div class="gf-form">
  70. <span class="gf-form-label query-keyword">AND</span>
  71. </div>
  72. <div class="gf-form">
  73. <query-part-editor
  74. class="gf-form-label query-part"
  75. part="conditionModel.queryPart"
  76. part-updated="ctrl.queryPartUpdated(conditionModel)">
  77. </query-part-editor>
  78. </div>
  79. <div class="gf-form">
  80. <span class="gf-form-label">Reducer</span>
  81. <query-part-editor
  82. class="gf-form-label query-part"
  83. part="conditionModel.reducerPart"
  84. part-updated="ctrl.reducerPartUpdated(conditionModel)">
  85. </query-part-editor>
  86. </div>
  87. <div class="gf-form">
  88. <span class="gf-form-label">When Value</span>
  89. <metric-segment-model property="conditionModel.evaluator.type" options="ctrl.evalFunctions" custom="false" css-class="query-segment-operator" on-change="ctrl.thresholdUpdated()"></metric-segment-model>
  90. <input class="gf-form-input max-width-7" type="number" ng-model="conditionModel.evaluator.params[0]" ng-change="ctrl.thresholdsUpdated()"></input>
  91. </div>
  92. <div class="gf-form">
  93. <label class="gf-form-label">
  94. <a class="pointer" tabindex="1" ng-click="ctrl.removeCondition($index)">
  95. <i class="fa fa-trash"></i>
  96. </a>
  97. </label>
  98. </div>
  99. </div>
  100. </div>
  101. <div class="gf-form-group">
  102. <div class="gf-form-button-row">
  103. <div class="dropdown pull-left" ng-if="ctrl.alert.enabled" >
  104. <button class="btn btn-inverse dropdown-toggle" data-toggle="dropdown">
  105. <i class="fa fa-plus"></i>&nbsp;Add Condition
  106. </button>
  107. <ul class="dropdown-menu" role="menu">
  108. <li ng-repeat="ct in ctrl.conditionTypes" role="menuitem">
  109. <a ng-click="ctrl.addCondition(ct.value);">{{ct.text}}</a>
  110. </li>
  111. </ul>
  112. </div>
  113. <button class="btn btn-inverse" ng-click="ctrl.delete()">
  114. Delete Alert
  115. </button>
  116. </div>
  117. </div>
  118. </div>
  119. <div class="gf-form-group" ng-if="!ctrl.alert.enabled">
  120. <div class="gf-form-button-row">
  121. <button class="btn btn-inverse" ng-click="ctrl.enable()">
  122. <i class="icon-gf icon-gf-alert"></i>
  123. Create Alert
  124. </button>
  125. </div>
  126. </div>