diff --git a/examples/datasource-plugin-genericdatasource/plugin.json b/examples/datasource-plugin-genericdatasource/plugin.json index 4c3a9accd05..5812a9b1bec 100644 --- a/examples/datasource-plugin-genericdatasource/plugin.json +++ b/examples/datasource-plugin-genericdatasource/plugin.json @@ -8,7 +8,7 @@ "staticRoot": ".", "metrics": true, - "annotations": false, + "annotations": true, "info": { "description": "generic datsource plugin", diff --git a/examples/datasource-plugin-genericdatasource/src/datasource.js b/examples/datasource-plugin-genericdatasource/src/datasource.js index 1b68cf61fb1..1a7fe9643dd 100644 --- a/examples/datasource-plugin-genericdatasource/src/datasource.js +++ b/examples/datasource-plugin-genericdatasource/src/datasource.js @@ -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) { diff --git a/examples/datasource-plugin-genericdatasource/src/module.js b/examples/datasource-plugin-genericdatasource/src/module.js index 5dc2f9c89d8..8ab46f4edec 100644 --- a/examples/datasource-plugin-genericdatasource/src/module.js +++ b/examples/datasource-plugin-genericdatasource/src/module.js @@ -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 }; diff --git a/examples/datasource-plugin-genericdatasource/src/partials/annotations.editor.html b/examples/datasource-plugin-genericdatasource/src/partials/annotations.editor.html new file mode 100644 index 00000000000..f4422caa4fc --- /dev/null +++ b/examples/datasource-plugin-genericdatasource/src/partials/annotations.editor.html @@ -0,0 +1,9 @@ + +