| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- <div ng-if="!ctrl.alert.enabled">
- <div class="gf-form-group">
- <h5 class="section-heading">Visual Thresholds</h5>
- <div class="gf-form-inline">
- <div class="gf-form">
- <span class="gf-form-label">
- <i class="icon-gf icon-gf-warn alert-icon-critical"></i>
- Critcal if
- </span>
- <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>
- <input class="gf-form-input max-width-7" type="number" ng-model="ctrl.alert.crit.value" ng-change="ctrl.thresholdsUpdated()"></input>
- </div>
- <div class="gf-form">
- <span class="gf-form-label">
- <i class="icon-gf icon-gf-warn alert-icon-warn"></i>
- Warn if
- </span>
- <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>
- <input class="gf-form-input max-width-7" type="number" ng-model="ctrl.alert.warn.value" ng-change="ctrl.thresholdsUpdated()"></input>
- </div>
- </div>
- </div>
- </div>
- <div ng-if="ctrl.alert.enabled">
- <div class="gf-form-group">
- <h5 class="section-heading">Alert Rule</h5>
- <div class="gf-form-inline">
- <div class="gf-form">
- <span class="gf-form-label width-8">Name</span>
- <input type="text" class="gf-form-input width-22" ng-model="ctrl.alert.name">
- </div>
- <div class="gf-form">
- <span class="gf-form-label">Handler</span>
- <div class="gf-form-select-wrapper">
- <select class="gf-form-input"
- ng-model="ctrl.alert.handler"
- ng-options="f.value as f.text for f in ctrl.handlers">
- </select>
- </div>
- </div>
- <div class="gf-form">
- <span class="gf-form-label width-8">Evaluate every</span>
- <input class="gf-form-input max-width-7" type="text" ng-model="ctrl.alert.frequency"></input>
- </div>
- </div>
- <div class="gf-form">
- <span class="gf-form-label width-8">Notifications</span>
- <input class="gf-form-input max-width-22" type="text" ng-model="ctrl.alert.notify"></input>
- <!--
- <bootstrap-tagsinput ng-model="ctrl.alert.notify" tagclass="label label-tag" placeholder="add tags">
- </bootstrap-tagsinput>
- -->
- </div>
- </div>
- <div class="gf-form-group">
- <h5 class="section-heading">Conditions</h5>
- <div class="gf-form-inline" ng-repeat="conditionModel in ctrl.conditionModels">
- <div class="gf-form">
- <span class="gf-form-label">{{$index+1}}</span>
- </div>
- <div class="gf-form">
- <query-part-editor
- class="gf-form-label query-part"
- part="conditionModel.queryPart"
- part-updated="ctrl.queryPartUpdated(conditionModel)">
- </query-part-editor>
- </div>
- <div class="gf-form">
- <span class="gf-form-label">Reduce</span>
- <query-part-editor
- class="gf-form-label query-part"
- part="conditionModel.reducerPart"
- part-updated="ctrl.reducerPartUpdated(conditionModel)">
- </query-part-editor>
- </div>
- <div class="gf-form">
- <span class="gf-form-label">
- <i class="icon-gf icon-gf-warn alert-icon-critical"></i>
- Critcal if
- </span>
- <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>
- <input class="gf-form-input max-width-7" type="number" ng-model="ctrl.alert.crit.value" ng-change="ctrl.thresholdsUpdated()"></input>
- </div>
- <div class="gf-form">
- <span class="gf-form-label">
- <i class="icon-gf icon-gf-warn alert-icon-warn"></i>
- Warn if
- </span>
- <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>
- <input class="gf-form-input max-width-7" type="number" ng-model="ctrl.alert.warn.value" ng-change="ctrl.thresholdsUpdated()"></input>
- <label class="gf-form-label">
- <a class="pointer" tabindex="1" ng-click="ctrl.removeCondition($index)">
- <i class="fa fa-trash"></i>
- </a>
- </label>
- </div>
- </div>
- </div>
- <div class="gf-form-group">
- <div class="dropdown">
- <button class="btn btn-inverse dropdown-toggle gf-form-btn" data-toggle="dropdown">
- <i class="fa fa-plus"></i> Add Condition
- </button>
- <ul class="dropdown-menu" role="menu">
- <li ng-repeat="ct in ctrl.conditionTypes" role="menuitem">
- <a ng-click="ctrl.addCondition(ct.value);">{{ct.text}}</a>
- </li>
- </ul>
- </div>
- </div>
- </div>
- <div class="editor-row">
- <div class="gf-form-button-row">
- <button class="btn btn-danger" ng-click="ctrl.delete()" ng-show="ctrl.alert.enabled">Delete</button>
- <button class="btn btn-inverse" ng-click="ctrl.enable()" ng-hide="ctrl.alert.enabled">
- <i class="icon-gf icon-gf-alert"></i>
- Create Alert
- </button>
- </div>
- </div>
|