mirror of https://github.com/grafana/grafana
parent
26d9e9243a
commit
03b43ab769
@ -0,0 +1,32 @@ |
||||
import _ from 'lodash'; |
||||
|
||||
import './query_filter_ctrl'; |
||||
|
||||
export class StackdriverAnnotationsQueryCtrl { |
||||
static templateUrl = 'partials/annotations.editor.html'; |
||||
annotation: any; |
||||
datasource: any; |
||||
|
||||
defaultDropdownValue = 'Select Metric'; |
||||
defaultServiceValue = 'All Services'; |
||||
|
||||
defaults = { |
||||
project: { |
||||
id: 'default', |
||||
name: 'loading project...', |
||||
}, |
||||
metricType: this.defaultDropdownValue, |
||||
metricService: this.defaultServiceValue, |
||||
metric: '', |
||||
filters: [], |
||||
metricKind: '', |
||||
valueType: '', |
||||
}; |
||||
|
||||
/** @ngInject */ |
||||
constructor() { |
||||
this.annotation.target = this.annotation.target || {}; |
||||
this.annotation.target.refId = 'annotationQuery'; |
||||
_.defaultsDeep(this.annotation.target, this.defaults); |
||||
} |
||||
} |
@ -1,14 +1,11 @@ |
||||
import StackdriverDatasource from './datasource'; |
||||
import { StackdriverQueryCtrl } from './query_ctrl'; |
||||
import { StackdriverConfigCtrl } from './config_ctrl'; |
||||
|
||||
// class AnnotationsQueryCtrl {
|
||||
// static templateUrl = 'partials/annotations.editor.html';
|
||||
// }
|
||||
import { StackdriverAnnotationsQueryCtrl } from './annotations_query_ctrl'; |
||||
|
||||
export { |
||||
StackdriverDatasource as Datasource, |
||||
StackdriverQueryCtrl as QueryCtrl, |
||||
StackdriverConfigCtrl as ConfigCtrl, |
||||
// AnnotationsQueryCtrl,
|
||||
StackdriverAnnotationsQueryCtrl as AnnotationsQueryCtrl, |
||||
}; |
||||
|
@ -1,13 +1,16 @@ |
||||
<div class="gf-form-group"> |
||||
<stackdriver-filter target="ctrl.annotation.target" refresh="ctrl.refresh()" datasource="ctrl.datasource" |
||||
default-dropdown-value="ctrl.defaultDropdownValue" default-service-value="ctrl.defaultServiceValue" hide-group-bys="true"></stackdriver-filter> |
||||
|
||||
<div class="gf-form-inline"> |
||||
<div class="gf-form"> |
||||
<span class="gf-form-label width-12">Graphite query</span> |
||||
<input type="text" class="gf-form-input" ng-model='ctrl.annotation.target' placeholder="Example: statsd.application.counters.*.count"></input> |
||||
<span class="gf-form-label query-keyword width-9">Title</span> |
||||
<input type="text" class="gf-form-input width-20" ng-model="ctrl.annotation.target.title" /> |
||||
</div> |
||||
|
||||
<h5 class="section-heading">Or</h5> |
||||
|
||||
<div class="gf-form"> |
||||
<span class="gf-form-label width-12">Graphite events tags</span> |
||||
<input type="text" class="gf-form-input" ng-model='ctrl.annotation.tags' placeholder="Example: event_tag_name"></input> |
||||
<span class="gf-form-label query-keyword width-9">Text</span> |
||||
<input type="text" class="gf-form-input width-20" ng-model="ctrl.annotation.target.text" /> |
||||
</div> |
||||
<div class="gf-form gf-form--grow"> |
||||
<div class="gf-form-label gf-form-label--grow"></div> |
||||
</div> |
||||
</div> |
||||
|
Loading…
Reference in new issue