From aada5181fa4451c797b450fb850259564961cc10 Mon Sep 17 00:00:00 2001 From: Kazumasa Kohtaka Date: Thu, 30 Mar 2017 15:54:32 +0900 Subject: [PATCH 1/4] docs: fix typo in a section describing search API (#7984) --- docs/sources/http_api/dashboard.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/http_api/dashboard.md b/docs/sources/http_api/dashboard.md index 5fed69b4a93..12d46dc6aa4 100644 --- a/docs/sources/http_api/dashboard.md +++ b/docs/sources/http_api/dashboard.md @@ -232,7 +232,7 @@ Get all tags of dashboards Status Codes: - **query** – Search Query -- **tags** – Tags to use +- **tag** – Tag to use - **starred** – Flag indicating if only starred Dashboards should be returned - **tagcloud** - Flag indicating if a tagcloud should be returned From 6e304e6e4256fde8d81b9ba6d75777562f44c1ab Mon Sep 17 00:00:00 2001 From: timolehto Date: Thu, 30 Mar 2017 18:12:00 +0300 Subject: [PATCH 2/4] comments: Typos in defaults.ini (#7988) --- conf/defaults.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/defaults.ini b/conf/defaults.ini index 5c12937f4f8..9955c22ca17 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -60,14 +60,14 @@ cert_key = #################################### Database ############################ [database] # You can configure the database connection by specifying type, host, name, user and password -# as seperate properties or as on string using the url propertie. +# as separate properties or as on string using the url property. # Either "mysql", "postgres" or "sqlite3", it's your choice type = sqlite3 host = 127.0.0.1:3306 name = grafana user = root -# If the password contains # or ; you have to wrap it with trippel quotes. Ex """#password;""" +# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;""" password = # Use either URL or the previous fields to configure the database # Example: mysql://user:secret@host:port/database @@ -132,7 +132,7 @@ logging = false reporting_enabled = true # Set to false to disable all checks to https://grafana.com -# for new vesions (grafana itself and plugins), check is used +# for new versions (grafana itself and plugins), check is used # in some UI views to notify that grafana or plugin update exists # This option does not cause any auto updates, nor send any information # only a GET request to https://grafana.com to get latest versions From 554f972a25f483e22db5d74aeb3fd3a9cbe89129 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Fri, 31 Mar 2017 14:31:15 +0900 Subject: [PATCH 3/4] support panel repeat for datasource template variable (#7711) * support panel repeat for datasource template variable * support All option --- public/app/core/services/datasource_srv.js | 4 ++-- public/app/features/panel/metrics_panel_ctrl.ts | 2 +- .../features/templating/datasource_variable.ts | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/public/app/core/services/datasource_srv.js b/public/app/core/services/datasource_srv.js index e722aae355b..bb187a7d5fb 100644 --- a/public/app/core/services/datasource_srv.js +++ b/public/app/core/services/datasource_srv.js @@ -14,12 +14,12 @@ function (angular, _, coreModule, config) { this.datasources = {}; }; - this.get = function(name) { + this.get = function(name, scopedDsVars) { if (!name) { return this.get(config.defaultDatasource); } - name = templateSrv.replace(name); + name = templateSrv.replace(name, scopedDsVars || {}); if (name === 'default') { return this.get(config.defaultDatasource); diff --git a/public/app/features/panel/metrics_panel_ctrl.ts b/public/app/features/panel/metrics_panel_ctrl.ts index b42d4a8b02a..6f066723741 100644 --- a/public/app/features/panel/metrics_panel_ctrl.ts +++ b/public/app/features/panel/metrics_panel_ctrl.ts @@ -92,7 +92,7 @@ class MetricsPanelCtrl extends PanelCtrl { // load datasource service this.setTimeQueryStart(); - this.datasourceSrv.get(this.panel.datasource) + this.datasourceSrv.get(this.panel.datasource, this.panel.scopedVars) .then(this.updateTimeRange.bind(this)) .then(this.issueQueries.bind(this)) .then(this.handleQueryResult.bind(this)) diff --git a/public/app/features/templating/datasource_variable.ts b/public/app/features/templating/datasource_variable.ts index 41f2262ab4a..66b0ab2eff9 100644 --- a/public/app/features/templating/datasource_variable.ts +++ b/public/app/features/templating/datasource_variable.ts @@ -10,6 +10,8 @@ export class DatasourceVariable implements Variable { query: string; options: any; current: any; + multi: boolean; + includeAll: boolean; refresh: any; defaults = { @@ -21,6 +23,8 @@ export class DatasourceVariable implements Variable { regex: '', options: [], query: '', + multi: false, + includeAll: false, refresh: 1, }; @@ -71,9 +75,16 @@ export class DatasourceVariable implements Variable { } this.options = options; + if (this.includeAll) { + this.addAllOption(); + } return this.variableSrv.validateVariableSelectionState(this); } + addAllOption() { + this.options.unshift({text: 'All', value: "$__all"}); + } + dependsOn(variable) { if (this.regex) { return containsVariable(this.regex, variable.name); @@ -86,6 +97,9 @@ export class DatasourceVariable implements Variable { } getValueForUrl() { + if (this.current.text === 'All') { + return 'All'; + } return this.current.value; } } @@ -93,5 +107,6 @@ export class DatasourceVariable implements Variable { variableTypes['datasource'] = { name: 'Datasource', ctor: DatasourceVariable, + supportsMulti: true, description: 'Enabled you to dynamically switch the datasource for multiple panels', }; From af0ecd440f305a5ea99094989f7863ff47c46e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 31 Mar 2017 07:32:44 +0200 Subject: [PATCH 4/4] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82b3ba2037e..a643338979a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ * **Cloudwatch**: Correctly obtain IAM roles within ECS container tasks [#7892](https://github.com/grafana/grafana/issues/7892) thx [@gomlgs](https://github.com/gomlgs) * **Units**: New number format: Scientific notation [#7781](https://github.com/grafana/grafana/issues/7781) thx [@cadnce](https://github.com/cadnce) * **Oauth**: Add common type for oauth authorization errors [#6428](https://github.com/grafana/grafana/issues/6428) thx [@amenzhinsky](https://github.com/amenzhinsky) +* **Templating**: Data source variable now supports multi value and panel repeats [#7030](https://github.com/grafana/grafana/issues/7030) thx [@mtanda](https://github.com/mtanda) # 4.2.0 (2017-03-22) ## Minor Enhancements