2014-07-17 00:47:20 +08:00
|
|
|
<div ng-controller="AnnotationsEditorCtrl" ng-init="init()">
|
2014-02-19 03:41:56 +08:00
|
|
|
|
2015-02-01 01:00:26 +08:00
|
|
|
<div class="gf-box-header">
|
2015-02-01 22:45:11 +08:00
|
|
|
<div class="gf-box-title">
|
|
|
|
|
<i class="fa fa-bolt"></i>
|
|
|
|
|
Annotations
|
|
|
|
|
</div>
|
|
|
|
|
|
2015-09-08 22:59:39 +08:00
|
|
|
<div class="tabs">
|
|
|
|
|
<ul class="nav nav-tabs">
|
|
|
|
|
<li ng-class="{active: mode === 'list'}">
|
|
|
|
|
<a ng-click="mode = 'list';">
|
|
|
|
|
List
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
<li ng-class="{active: mode === 'edit'}" ng-show="mode === 'edit'">
|
|
|
|
|
<a>
|
|
|
|
|
{{currentAnnotation.name}}
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
<li ng-class="{active: mode === 'new'}">
|
|
|
|
|
<a ng-click="mode = 'new';">
|
|
|
|
|
<i class="fa fa-plus"></i>
|
|
|
|
|
New
|
|
|
|
|
</a>
|
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
2014-08-26 15:32:30 +08:00
|
|
|
</div>
|
2015-02-22 15:09:58 +08:00
|
|
|
|
|
|
|
|
<button class="gf-box-header-close-btn" ng-click="dismiss();">
|
2015-02-01 01:00:26 +08:00
|
|
|
<i class="fa fa-remove"></i>
|
|
|
|
|
</button>
|
2014-08-26 15:32:30 +08:00
|
|
|
</div>
|
2015-02-01 01:00:26 +08:00
|
|
|
<div class="gf-box-body">
|
2015-09-08 22:59:39 +08:00
|
|
|
|
2016-02-02 02:00:40 +08:00
|
|
|
|
2015-09-08 22:59:39 +08:00
|
|
|
<div class="editor-row row" ng-if="mode === 'list'">
|
2014-08-28 22:44:16 +08:00
|
|
|
<div class="span6">
|
2014-12-16 22:47:10 +08:00
|
|
|
<div ng-if="annotations.length === 0">
|
2014-09-09 14:50:01 +08:00
|
|
|
<em>No annotations defined</em>
|
|
|
|
|
</div>
|
2014-08-28 22:44:16 +08:00
|
|
|
<table class="grafana-options-table">
|
|
|
|
|
<tr ng-repeat="annotation in annotations">
|
|
|
|
|
<td style="width:90%">
|
2016-01-10 01:20:43 +08:00
|
|
|
<i class="fa fa-bolt" style="color:{{annotation.iconColor}}"></i>
|
2014-08-26 15:32:30 +08:00
|
|
|
{{annotation.name}}
|
2014-08-28 22:44:16 +08:00
|
|
|
</td>
|
2015-02-08 05:00:33 +08:00
|
|
|
<td style="width: 1%"><i ng-click="_.move(annotations,$index,$index-1)" ng-hide="$first" class="pointer fa fa-arrow-up"></i></td>
|
|
|
|
|
<td style="width: 1%"><i ng-click="_.move(annotations,$index,$index+1)" ng-hide="$last" class="pointer fa fa-arrow-down"></i></td>
|
|
|
|
|
|
|
|
|
|
<td style="width: 1%" class="nobg">
|
|
|
|
|
<a ng-click="edit(annotation)" class="btn btn-inverse btn-mini">
|
2015-01-08 18:03:27 +08:00
|
|
|
<i class="fa fa-edit"></i>
|
2014-08-28 22:44:16 +08:00
|
|
|
Edit
|
|
|
|
|
</a>
|
|
|
|
|
</td>
|
2015-02-08 05:00:33 +08:00
|
|
|
<td style="width: 1%" class="nobg">
|
|
|
|
|
<a ng-click="removeAnnotation(annotation)" class="btn btn-danger btn-mini">
|
2015-01-08 18:03:27 +08:00
|
|
|
<i class="fa fa-remove"></i>
|
2014-08-28 22:44:16 +08:00
|
|
|
</a>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
2014-08-26 15:32:30 +08:00
|
|
|
</div>
|
2014-02-19 03:41:56 +08:00
|
|
|
|
2015-09-08 22:59:39 +08:00
|
|
|
<div ng-if="mode === 'edit' || mode === 'new'">
|
2014-08-26 15:32:30 +08:00
|
|
|
<div class="editor-row">
|
|
|
|
|
<div class="editor-option">
|
|
|
|
|
<label class="small">Name</label>
|
|
|
|
|
<input type="text" class="input-medium" ng-model='currentAnnotation.name' placeholder="name"></input>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="editor-option">
|
|
|
|
|
<label class="small">Datasource</label>
|
2014-08-29 15:59:18 +08:00
|
|
|
<select ng-model="currentAnnotation.datasource" ng-options="f.name as f.name for f in datasources" ng-change="datasourceChanged()"></select>
|
2014-08-26 15:32:30 +08:00
|
|
|
</div>
|
2015-01-12 22:37:22 +08:00
|
|
|
<div class="editor-option text-center">
|
2014-08-26 15:32:30 +08:00
|
|
|
<label class="small">Icon color</label>
|
|
|
|
|
<spectrum-picker ng-model="currentAnnotation.iconColor"></spectrum-picker>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="editor-option">
|
|
|
|
|
<label class="small">Icon size</label>
|
|
|
|
|
<select class="input-mini" ng-model="currentAnnotation.iconSize" ng-options="f for f in [7,8,9,10,13,15,17,20,25,30]"></select>
|
|
|
|
|
</div>
|
2014-09-26 19:09:47 +08:00
|
|
|
<editor-opt-bool text="Grid line" model="currentAnnotation.showLine"></editor-opt-bool>
|
2015-01-12 22:37:22 +08:00
|
|
|
<div class="editor-option text-center">
|
2014-08-26 15:32:30 +08:00
|
|
|
<label class="small">Line color</label>
|
|
|
|
|
<spectrum-picker ng-model="currentAnnotation.lineColor"></spectrum-picker>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2016-01-14 19:35:31 +08:00
|
|
|
<annotations-query-editor datasource="currentDatasource" annotation="currentAnnotation">
|
|
|
|
|
</annotations-query-editor>
|
2014-08-26 15:32:30 +08:00
|
|
|
|
2015-02-02 15:59:38 +08:00
|
|
|
<br>
|
2015-09-08 22:59:39 +08:00
|
|
|
<button ng-show="mode === 'new'" type="button" class="btn btn-success" ng-click="add()">Add</button>
|
|
|
|
|
<button ng-show="mode === 'edit'" type="button" class="btn btn-success pull-left" ng-click="update();">Update</button>
|
2015-02-02 15:59:38 +08:00
|
|
|
<br>
|
|
|
|
|
<br>
|
2014-08-26 15:32:30 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
2014-07-17 00:47:20 +08:00
|
|
|
</div>
|