From fb450385d766ff2b49b0a46b068e4f2e185c7813 Mon Sep 17 00:00:00 2001 From: bergquist Date: Tue, 8 Mar 2016 15:54:25 +0100 Subject: [PATCH 1/4] docs(github): move markdown files into .github folder --- CONTRIBUTING.md => .github/CONTRIBUTING.md | 0 .github/ISSUE_TEMPLATE.md | 12 ++++++++++++ .github/PULL_REQUEST_TEMPLATE.md | 0 3 files changed, 12 insertions(+) rename CONTRIBUTING.md => .github/CONTRIBUTING.md (100%) create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md diff --git a/CONTRIBUTING.md b/.github/CONTRIBUTING.md similarity index 100% rename from CONTRIBUTING.md rename to .github/CONTRIBUTING.md diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 00000000000..19a05fc78d7 --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,12 @@ +Thank you! For helping us make Grafana even better. + +To help us respond to your issues faster, please make sure to add as much information as possible. + +If this issue is about a plugin, please open the issue in that repository. + +Tag your issues title with [Feature Request] / [Bug] / [Question] or no tag if your unsure. + +Ex +* What grafana version are you using? +* What datasource are you using? +* What OS are you running grafana on? diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000000..e69de29bb2d From 4fae1958fa5654072830b1b570e1a8bf826b204f Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Tue, 8 Mar 2016 07:28:25 -0800 Subject: [PATCH 2/4] Fixed some typos --- docs/sources/plugins/datasources.md | 4 ++-- docs/sources/plugins/panels.md | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/sources/plugins/datasources.md b/docs/sources/plugins/datasources.md index 97ef508b004..6bd11242f52 100644 --- a/docs/sources/plugins/datasources.md +++ b/docs/sources/plugins/datasources.md @@ -8,7 +8,7 @@ page_keywords: grafana, plugins, documentation # Datasources -Datasource plugins enables people to develop plugins for any database that commuicates over http. Its up to the plugin to transform the data into time series data so that any grafana panel can then show it. +Datasource plugins enables people to develop plugins for any database that communicates over http. Its up to the plugin to transform the data into time series data so that any grafana panel can then show it. To interact with the rest of grafana the plugins module file can export 5 different components. @@ -54,7 +54,7 @@ Request object passed to datasource.query function ``` There are two different kind of results for datasources. -Time series and table. Time series is the most common format and is suppoert by all datasources and panels. Table format is only support by the Influxdb datasource and table panel. But we might se more of this in the future. +Time series and table. Time series is the most common format and is supported by all datasources and panels. Table format is only support by the Influxdb datasource and table panel. But we might see more of this in the future. Time series response from datasource.query An array of diff --git a/docs/sources/plugins/panels.md b/docs/sources/plugins/panels.md index 4f16662d784..ad9d5db66d8 100644 --- a/docs/sources/plugins/panels.md +++ b/docs/sources/plugins/panels.md @@ -17,13 +17,13 @@ This class have to inherit from sdk.PanelCtrl or sdk.MetricsPanelCtrl and be exp }; ``` -This class will be instancieted once for every panel of its kind in a dashboard and treated as an AngularJs controller. +This class will be instantiated once for every panel of its kind in a dashboard and treated as an AngularJs controller. ## MetricsPanelCtrl or PanelCtrl -MetricsPanelCtrl inherits from PanelCtrl and adds some common features for datasource usage. So if your Panel will be working with a datasource you should inherit from MetricsPanelCtrl. If dont need to access any datasource then you should inherit from PanelCtrl instead. +MetricsPanelCtrl inherits from PanelCtrl and adds some common features for datasource usage. So if your Panel will be working with a datasource you should inherit from MetricsPanelCtrl. If don't need to access any datasource then you should inherit from PanelCtrl instead. ## Implementing a MetricsPanelCtrl -If you choose to inherit from MetricsPanelCtrl you should implement a function called refreshData that will take an datasource as inparameter when its time to get new data. Its recommended that the refreshData function calls the issueQueries in the base class but its not mandatory. An examples of such implementation can be found in our [example panel](https://github.com/grafana/grafana/blob/master/examples/panel-boilerplate-es5/module.js#L27-L38) +If you choose to inherit from MetricsPanelCtrl you should implement a function called refreshData that will take a datasource as in parameter when its time to get new data. Its recommended that the refreshData function calls the issueQueries in the base class but its not mandatory. An examples of such implementation can be found in our [example panel](https://github.com/grafana/grafana/blob/master/examples/panel-boilerplate-es5/module.js#L27-L38) From 0ec747630d388b0f6d9bb6d648054fe1a0c6d5a1 Mon Sep 17 00:00:00 2001 From: bergquist Date: Tue, 8 Mar 2016 16:48:45 +0100 Subject: [PATCH 3/4] examples(plugin.json): add includes info --- examples/nginx-app/plugin.json | 5 +++++ examples/nginx-app/src/datasource/datasource.js | 12 ++++++++++++ examples/nginx-app/src/datasource/module.js | 5 +++++ examples/nginx-app/src/datasource/plugin.json | 5 +++++ 4 files changed, 27 insertions(+) create mode 100644 examples/nginx-app/src/datasource/datasource.js create mode 100644 examples/nginx-app/src/datasource/module.js create mode 100644 examples/nginx-app/src/datasource/plugin.json diff --git a/examples/nginx-app/plugin.json b/examples/nginx-app/plugin.json index 4e0c4a114fa..6d2cd82ba3b 100644 --- a/examples/nginx-app/plugin.json +++ b/examples/nginx-app/plugin.json @@ -34,6 +34,11 @@ "updated": "2015-02-10" }, + "includes": [ + {"type": "panel", "name": "Nginx Panel"}, + {"type": "datasource", "name": "Nginx Datasource"} + ], + "dependencies": { "grafanaVersion": "3.x.x", "plugins": [ diff --git a/examples/nginx-app/src/datasource/datasource.js b/examples/nginx-app/src/datasource/datasource.js new file mode 100644 index 00000000000..7f4ed363707 --- /dev/null +++ b/examples/nginx-app/src/datasource/datasource.js @@ -0,0 +1,12 @@ +export default class NginxDatasource { + + constructor() {} + + query(options) { + return []; + } + + testDatasource() { + return false; + } +} diff --git a/examples/nginx-app/src/datasource/module.js b/examples/nginx-app/src/datasource/module.js new file mode 100644 index 00000000000..a3473e59889 --- /dev/null +++ b/examples/nginx-app/src/datasource/module.js @@ -0,0 +1,5 @@ +import {Datasource} from './datasource'; + +export { + Datasource +}; \ No newline at end of file diff --git a/examples/nginx-app/src/datasource/plugin.json b/examples/nginx-app/src/datasource/plugin.json new file mode 100644 index 00000000000..ffce9492418 --- /dev/null +++ b/examples/nginx-app/src/datasource/plugin.json @@ -0,0 +1,5 @@ +{ + "type": "datasource", + "name": "Nginx Datasource", + "id": "nginx-datasource" +} From ae3bda81c5db73ccd698e52611b80a07a4c19d61 Mon Sep 17 00:00:00 2001 From: bergquist Date: Tue, 8 Mar 2016 16:52:48 +0100 Subject: [PATCH 4/4] example(plugin.json): add dashboards array in includes --- examples/nginx-app/plugin.json | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/examples/nginx-app/plugin.json b/examples/nginx-app/plugin.json index 6d2cd82ba3b..2cd4a9486d4 100644 --- a/examples/nginx-app/plugin.json +++ b/examples/nginx-app/plugin.json @@ -34,10 +34,13 @@ "updated": "2015-02-10" }, - "includes": [ - {"type": "panel", "name": "Nginx Panel"}, - {"type": "datasource", "name": "Nginx Datasource"} - ], + "includes": { + "dashboards": [], + "plugins": [ + {"type": "panel", "name": "Nginx Panel"}, + {"type": "datasource", "name": "Nginx Datasource"} + ] + }, "dependencies": { "grafanaVersion": "3.x.x",