feat(example): add basic annotation support for ds
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
"staticRoot": ".",
|
||||
|
||||
"metrics": true,
|
||||
"annotations": false,
|
||||
"annotations": true,
|
||||
|
||||
"info": {
|
||||
"description": "generic datsource plugin",
|
||||
|
||||
@@ -37,6 +37,15 @@ export class GenericDatasource {
|
||||
});
|
||||
}
|
||||
|
||||
annotationQuery(options) {
|
||||
return this.backendSrv.datasourceRequest({
|
||||
url: this.url + '/annotations',
|
||||
method: 'GET'
|
||||
}).then(result => {
|
||||
return result.data;
|
||||
});
|
||||
}
|
||||
|
||||
// Optional
|
||||
// Required for templating
|
||||
metricFindQuery(options) {
|
||||
|
||||
@@ -7,9 +7,13 @@ GenericConfigCtrl.templateUrl = 'partials/config.html';
|
||||
class GenericQueryOptionsCtrl {}
|
||||
GenericQueryOptionsCtrl.templateUrl = 'partials/query.options.html';
|
||||
|
||||
class GenericAnnotationsQueryCtrl {}
|
||||
GenericAnnotationsQueryCtrl.templateUrl = 'partials/annotations.editor.html'
|
||||
|
||||
export {
|
||||
GenericDatasource as Datasource,
|
||||
GenericDatasourceQueryCtrl as QueryCtrl,
|
||||
GenericConfigCtrl as ConfigCtrl,
|
||||
GenericQueryOptionsCtrl as QueryOptionsCtrl
|
||||
GenericQueryOptionsCtrl as QueryOptionsCtrl,
|
||||
GenericAnnotationsQueryCtrl as AnnotationsQueryCtrl
|
||||
};
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
|
||||
<h5 class="section-heading">Query</h5>
|
||||
<div class="gf-form-group">
|
||||
<div class="gf-form">
|
||||
<input type="text" class="gf-form-input" ng-model='ctrl.annotation.query' placeholder=""></input>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user