2014-07-17 00:47:20 +08:00
< div ng-controller = "AnnotationsEditorCtrl" ng-init = "init()" >
2016-02-24 18:07:57 +08:00
< div class = "tabbed-view-header" >
< h2 class = "tabbed-view-title" >
2015-02-01 22:45:11 +08:00
Annotations
2016-02-24 18:07:57 +08:00
< / h2 >
2015-09-08 22:59:39 +08:00
2016-02-24 18:07:57 +08:00
< ul class = "gf-tabs" >
< li class = "gf-tabs-item" >
< a class = "gf-tabs-link" ng-click = "mode = 'list';" ng-class = "{active: mode === 'list'}" >
List
< / a >
< / li >
< li class = "gf-tabs-item" ng-show = "mode === 'edit'" >
< a class = "gf-tabs-link" ng-class = "{active: mode === 'edit'}" >
{{currentAnnotation.name}}
< / a >
< / li >
< li class = "gf-tabs-item" >
< a class = "gf-tabs-link" ng-click = "mode = 'new';" ng-class = "{active: mode === 'new'}" >
< i class = "fa fa-plus" > < / i >
New
< / a >
< / li >
< / ul >
2015-09-08 22:59:39 +08:00
2016-02-24 18:07:57 +08:00
< button class = "tabbed-view-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 >
2016-02-24 18:07:57 +08:00
< div class = "tabbed-view-body" >
2015-09-08 22:59:39 +08:00
< div class = "editor-row row" ng-if = "mode === 'list'" >
2016-02-24 18:56:45 +08:00
< div ng-if = "annotations.length === 0" >
< em > No annotations defined< / em >
2014-08-28 22:44:16 +08:00
< / div >
2016-02-24 18:56:45 +08:00
< table class = "grafana-options-table" >
< tr ng-repeat = "annotation in annotations" >
< td style = "width:90%" >
< i class = "fa fa-bolt" style = "color:{{annotation.iconColor}}" > < / i >
{{annotation.name}}
< / td >
< 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%" >
< a ng-click = "edit(annotation)" class = "btn btn-inverse btn-mini" >
< i class = "fa fa-edit" > < / i >
Edit
< / a >
< / td >
< td style = "width: 1%" >
< a ng-click = "removeAnnotation(annotation)" class = "btn btn-danger btn-mini" >
< i class = "fa fa-remove" > < / i >
< / a >
< / td >
< / tr >
< / table >
2014-08-26 15:32:30 +08:00
< / div >
2014-02-19 03:41:56 +08:00
2016-02-22 17:21:22 +08:00
< div class = "annotations-basic-settings" ng-if = "mode === 'edit' || mode === 'new'" >
< div class = "gf-form-group" >
< div class = "gf-form-inline" >
< div class = "gf-form gf-size-max-xxl" >
2016-02-23 15:22:00 +08:00
< span class = "gf-form-label" > Name< / span >
2016-02-22 17:21:22 +08:00
< input type = "text" class = "gf-form-input" ng-model = 'currentAnnotation.name' placeholder = "name" > < / input >
< / div >
< div class = "gf-form" >
< span class = "gf-form-label max-width-10" > Datasource< / span >
2016-02-23 00:39:11 +08:00
< div class = "gf-form-select-wrapper" >
< select class = "gf-form-input gf-size-auto" ng-model = "currentAnnotation.datasource" ng-options = "f.name as f.name for f in datasources" ng-change = "datasourceChanged()" > < / select >
< / div >
2016-02-22 17:21:22 +08:00
< / div >
2016-02-22 21:54:19 +08:00
< div class = "gf-form" >
< label class = "gf-form-label" >
2016-02-23 15:22:00 +08:00
< span > Color< / span >
2016-02-22 21:54:19 +08:00
< spectrum-picker ng-model = "currentAnnotation.iconColor" > < / spectrum-picker >
< / label >
2016-02-22 17:21:22 +08:00
< / div >
2014-08-26 15:32:30 +08:00
< / div >
< / div >
2016-02-23 04:55:03 +08:00
< rebuild-on-change property = "currentDatasource" >
2016-02-03 01:16:30 +08:00
< plugin-component type = "annotations-query-ctrl" >
< / plugin-component >
< / rebuild-on-change >
2014-08-26 15:32:30 +08:00
2016-02-22 17:21:22 +08:00
< div class = "gf-form" >
< div class = "gf-form-button-row" >
< button ng-show = "mode === 'new'" type = "button" class = "btn gf-form-button 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 >
< / div >
2016-02-19 23:01:02 +08:00
< / div >
2014-08-26 15:32:30 +08:00
< / div >
< / div >
2014-07-17 00:47:20 +08:00
< / div >