|
|
@@ -24,53 +24,33 @@
|
|
|
<!-- </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 max-width-30">
|
|
|
- <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 width-6">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-inline">
|
|
|
- <div class="gf-form max-width-30">
|
|
|
- <span class="gf-form-label width-8">Notifications</span>
|
|
|
- <input class="gf-form-input max-width-22" type="text" ng-model="ctrl.alert.notifications"></input>
|
|
|
- </div>
|
|
|
- <!--
|
|
|
- <bootstrap-tagsinput ng-model="ctrl.alert.notify" tagclass="label label-tag" placeholder="add tags">
|
|
|
- </bootstrap-tagsinput>
|
|
|
- -->
|
|
|
- <div class="gf-form">
|
|
|
- <span class="gf-form-label width-8">Severity</span>
|
|
|
- <div class="gf-form-select-wrapper">
|
|
|
- <select class="gf-form-input"
|
|
|
- ng-model="ctrl.alert.severity"
|
|
|
- ng-options="f.value as f.text for f in ctrl.severityLevels">
|
|
|
- </select>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <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">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">Evaluate every</span>
|
|
|
+ <input class="gf-form-input max-width-7" type="text" ng-model="ctrl.alert.frequency"></input>
|
|
|
+ </div>
|
|
|
+ <div class="gf-form">
|
|
|
+ <span class="gf-form-label">Severity</span>
|
|
|
+ <div class="gf-form-select-wrapper">
|
|
|
+ <select class="gf-form-input" ng-model="ctrl.alert.severity" ng-options="f.value as f.text for f in ctrl.severityLevels">
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </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 query-keyword">AND</span>
|
|
|
+ <span class="gf-form-label query-keyword width-5" ng-if="$index">AND</span>
|
|
|
+ <span class="gf-form-label query-keyword width-5" ng-if="$index===0">WHEN</span>
|
|
|
</div>
|
|
|
<div class="gf-form">
|
|
|
<query-part-editor
|
|
|
@@ -88,7 +68,7 @@
|
|
|
</query-part-editor>
|
|
|
</div>
|
|
|
<div class="gf-form">
|
|
|
- <span class="gf-form-label">When Value</span>
|
|
|
+ <span class="gf-form-label">Value</span>
|
|
|
<metric-segment-model property="conditionModel.evaluator.type" options="ctrl.evalFunctions" custom="false" css-class="query-segment-operator" on-change="ctrl.thresholdUpdated()"></metric-segment-model>
|
|
|
<input class="gf-form-input max-width-7" type="number" ng-model="conditionModel.evaluator.params[0]" ng-change="ctrl.thresholdsUpdated()"></input>
|
|
|
</div>
|
|
|
@@ -98,48 +78,63 @@
|
|
|
<i class="fa fa-trash"></i>
|
|
|
</a>
|
|
|
</label>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
- <div class="gf-form-group">
|
|
|
- <div class="gf-form-button-row">
|
|
|
- <div class="dropdown pull-left" ng-if="ctrl.alert.enabled" >
|
|
|
- <button class="btn btn-inverse dropdown-toggle" data-toggle="dropdown">
|
|
|
- <i class="fa fa-plus"></i> Add Condition
|
|
|
- </button>
|
|
|
+ <div class="gf-form">
|
|
|
+ <label class="gf-form-label dropdown">
|
|
|
+ <a class="pointer dropdown-toggle" data-toggle="dropdown">
|
|
|
+ <i class="fa fa-plus"></i>
|
|
|
+ </a>
|
|
|
+ <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>
|
|
|
+ </label>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
- <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 class="gf-form-group">
|
|
|
+ <h5 class="section-heading">Notifications</h5>
|
|
|
+ <div class="gf-form-inline">
|
|
|
+ <div class="gf-form max-width-30">
|
|
|
+ <span class="gf-form-label" ng-repeat="nc in ctrl.alert.notifications">
|
|
|
+ {{nc.name}}
|
|
|
+ <i class="fa fa-remove pointer" ng-click="ctrl.removeNotification($index)"></i>
|
|
|
+ </span>
|
|
|
+ <metric-segment segment="ctrl.addNotificationSegment" get-options="ctrl.getNotifications()" on-change="ctrl.notificationAdded()"></metric-segment>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
- <button class="btn btn-inverse" ng-click="ctrl.test()">
|
|
|
- Test Rule
|
|
|
- </button>
|
|
|
+ <div class="gf-form-group">
|
|
|
+ <div class="gf-form-button-row">
|
|
|
+ <button class="btn btn-inverse" ng-click="ctrl.test()">
|
|
|
+ Test Rule
|
|
|
+ </button>
|
|
|
+
|
|
|
+ <button class="btn btn-inverse" ng-click="ctrl.delete()">
|
|
|
+ Delete Alert
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
- <button class="btn btn-inverse" ng-click="ctrl.delete()">
|
|
|
- Delete Alert
|
|
|
- </button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
</div>
|
|
|
|
|
|
<div class="gf-form-group" ng-if="ctrl.testing">
|
|
|
- Evaluating rule <i class="fa fa-spinner fa-spin"></i>
|
|
|
+ Evaluating rule <i class="fa fa-spinner fa-spin"></i>
|
|
|
</div>
|
|
|
|
|
|
<div class="gf-form-group" ng-if="ctrl.testResult">
|
|
|
- <json-tree root-name="result" object="ctrl.testResult" start-expanded="true"></json-tree>
|
|
|
+ <json-tree root-name="result" object="ctrl.testResult" start-expanded="true"></json-tree>
|
|
|
</div>
|
|
|
|
|
|
<div class="gf-form-group" ng-if="!ctrl.alert.enabled">
|
|
|
- <div class="gf-form-button-row">
|
|
|
- <button class="btn btn-inverse" ng-click="ctrl.enable()">
|
|
|
- <i class="icon-gf icon-gf-alert"></i>
|
|
|
- Create Alert
|
|
|
- </button>
|
|
|
- </div>
|
|
|
+ <div class="gf-form-button-row">
|
|
|
+ <button class="btn btn-inverse" ng-click="ctrl.enable()">
|
|
|
+ <i class="icon-gf icon-gf-alert"></i>
|
|
|
+ Create Alert
|
|
|
+ </button>
|
|
|
+ </div>
|
|
|
</div>
|