From de26a17dc7350f9c40e84857f4c999b2a6dd5e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 3 May 2016 09:00:58 +0200 Subject: [PATCH 01/50] feat(footer): began work on page footer --- pkg/api/dtos/index.go | 18 ++++++++------ pkg/api/frontendsettings.go | 8 +++--- pkg/api/index.go | 14 +++++++---- public/app/core/controllers/login_ctrl.js | 9 ------- public/app/partials/login.html | 9 ------- public/app/partials/signup_step2.html | 1 - public/sass/components/_footer.scss | 3 +++ public/views/index.html | 30 +++++++++++++++++++++++ 8 files changed, 56 insertions(+), 36 deletions(-) diff --git a/pkg/api/dtos/index.go b/pkg/api/dtos/index.go index 21201d30adf..b813c78f2bb 100644 --- a/pkg/api/dtos/index.go +++ b/pkg/api/dtos/index.go @@ -1,13 +1,17 @@ package dtos type IndexViewData struct { - User *CurrentUser - Settings map[string]interface{} - AppUrl string - AppSubUrl string - GoogleAnalyticsId string - GoogleTagManagerId string - MainNavLinks []*NavLink + User *CurrentUser + Settings map[string]interface{} + AppUrl string + AppSubUrl string + GoogleAnalyticsId string + GoogleTagManagerId string + MainNavLinks []*NavLink + BuildVersion string + BuildCommit string + NewGrafanaVersionExists bool + NewGrafanaVersion string } type PluginCss struct { diff --git a/pkg/api/frontendsettings.go b/pkg/api/frontendsettings.go index dd84f7827eb..f23f416b47a 100644 --- a/pkg/api/frontendsettings.go +++ b/pkg/api/frontendsettings.go @@ -137,11 +137,9 @@ func getFrontendSettingsMap(c *middleware.Context) (map[string]interface{}, erro "allowOrgCreate": (setting.AllowUserOrgCreate && c.IsSignedIn) || c.IsGrafanaAdmin, "authProxyEnabled": setting.AuthProxyEnabled, "buildInfo": map[string]interface{}{ - "version": setting.BuildVersion, - "commit": setting.BuildCommit, - "buildstamp": setting.BuildStamp, - "latestVersion": plugins.GrafanaLatestVersion, - "hasUpdate": plugins.GrafanaHasUpdate, + "version": setting.BuildVersion, + "commit": setting.BuildCommit, + "buildstamp": setting.BuildStamp, }, } diff --git a/pkg/api/index.go b/pkg/api/index.go index 53538fd2775..4e4f4fadfeb 100644 --- a/pkg/api/index.go +++ b/pkg/api/index.go @@ -36,11 +36,15 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) { LightTheme: prefs.Theme == "light", Timezone: prefs.Timezone, }, - Settings: settings, - AppUrl: setting.AppUrl, - AppSubUrl: setting.AppSubUrl, - GoogleAnalyticsId: setting.GoogleAnalyticsId, - GoogleTagManagerId: setting.GoogleTagManagerId, + Settings: settings, + AppUrl: setting.AppUrl, + AppSubUrl: setting.AppSubUrl, + GoogleAnalyticsId: setting.GoogleAnalyticsId, + GoogleTagManagerId: setting.GoogleTagManagerId, + BuildVersion: setting.BuildVersion, + BuildCommit: setting.BuildCommit, + NewGrafanaVersion: plugins.GrafanaLatestVersion, + NewGrafanaVersionExists: plugins.GrafanaHasUpdate, } if setting.DisableGravatar { diff --git a/public/app/core/controllers/login_ctrl.js b/public/app/core/controllers/login_ctrl.js index 4249d55a44f..45a47558ed7 100644 --- a/public/app/core/controllers/login_ctrl.js +++ b/public/app/core/controllers/login_ctrl.js @@ -35,15 +35,6 @@ function (angular, coreModule, config) { } }; - // build info view model - $scope.buildInfo = { - version: config.buildInfo.version, - commit: config.buildInfo.commit, - buildstamp: new Date(config.buildInfo.buildstamp * 1000), - latestVersion: config.buildInfo.latestVersion, - hasUpdate: config.buildInfo.hasUpdate, - }; - $scope.submit = function() { if ($scope.loginMode) { $scope.login(); diff --git a/public/app/partials/login.html b/public/app/partials/login.html index ff8d22451a8..8143ff35125 100644 --- a/public/app/partials/login.html +++ b/public/app/partials/login.html @@ -73,14 +73,5 @@ -
- - -
diff --git a/public/app/partials/signup_step2.html b/public/app/partials/signup_step2.html index 7b72c2357b9..afb6d0d4fc4 100644 --- a/public/app/partials/signup_step2.html +++ b/public/app/partials/signup_step2.html @@ -67,7 +67,6 @@ - diff --git a/public/sass/components/_footer.scss b/public/sass/components/_footer.scss index 9f2674980b0..3796275d7f9 100644 --- a/public/sass/components/_footer.scss +++ b/public/sass/components/_footer.scss @@ -7,3 +7,6 @@ a { color: darken($gray-1, 25%); } } +.footer { + padding: 5rem 0 1rem 0; +} diff --git a/public/views/index.html b/public/views/index.html index c4bffae5019..9bf1f9f2f0c 100644 --- a/public/views/index.html +++ b/public/views/index.html @@ -39,6 +39,36 @@
+ + From 2b06ceda711fd61ccbbc61201bd49ec0a7aea113 Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 19 May 2016 08:00:48 +0200 Subject: [PATCH 02/50] feat(panels): adds queryparameter for choose active tab in edit mode --- public/app/features/panel/panel_ctrl.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/public/app/features/panel/panel_ctrl.ts b/public/app/features/panel/panel_ctrl.ts index 82e19f8681b..94de0166f61 100644 --- a/public/app/features/panel/panel_ctrl.ts +++ b/public/app/features/panel/panel_ctrl.ts @@ -90,6 +90,15 @@ export class PanelCtrl { this.addEditorTab('General', 'public/app/partials/panelgeneral.html'); this.editModeInitiated = true; this.events.emit('init-edit-mode', null); + + var route = this.$injector.get('$route'); + if (route.current.params.editorTab) { + this.editorTabs.forEach((tab, i) => { + if (tab.title === route.current.params.editorTab) { + this.editorTabIndex = i; + } + }); + } } addEditorTab(title, directiveFn, index?) { From 617d18e587153b5d4b86810164afda1eafde3bdb Mon Sep 17 00:00:00 2001 From: bergquist Date: Thu, 19 May 2016 08:42:21 +0200 Subject: [PATCH 03/50] feat(panel): active tab is now placed in querystring aswell --- public/app/features/panel/panel_ctrl.ts | 14 +++++++++++--- public/app/features/panel/panel_directive.ts | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/public/app/features/panel/panel_ctrl.ts b/public/app/features/panel/panel_ctrl.ts index 94de0166f61..994eaa5fd5b 100644 --- a/public/app/features/panel/panel_ctrl.ts +++ b/public/app/features/panel/panel_ctrl.ts @@ -91,16 +91,24 @@ export class PanelCtrl { this.editModeInitiated = true; this.events.emit('init-edit-mode', null); - var route = this.$injector.get('$route'); - if (route.current.params.editorTab) { + var routeParams = this.$injector.get('$routeParams'); + if (routeParams.editorTab) { this.editorTabs.forEach((tab, i) => { - if (tab.title === route.current.params.editorTab) { + if (tab.title === routeParams.editorTab) { this.editorTabIndex = i; } }); } } + changeTab(newIndex) { + this.editorTabIndex = newIndex; + var route = this.$injector.get('$route'); + + route.current.params.editorTab = this.editorTabs[newIndex].title; + route.updateParams(); + } + addEditorTab(title, directiveFn, index?) { var editorTab = {title, directiveFn}; diff --git a/public/app/features/panel/panel_directive.ts b/public/app/features/panel/panel_directive.ts index a9bb75760f5..7d63e620f98 100644 --- a/public/app/features/panel/panel_directive.ts +++ b/public/app/features/panel/panel_directive.ts @@ -36,7 +36,7 @@ var panelTemplate = `
  • - + {{::tab.title}}
  • From 7c4642372795ca6418f127f1de07395224fa6908 Mon Sep 17 00:00:00 2001 From: Richard Hartmann Date: Thu, 19 May 2016 10:34:12 +0200 Subject: [PATCH 04/50] ISSUE_TEMPLATE.md: Fix typo (#5099) --- .github/ISSUE_TEMPLATE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index b7d73592ef4..29b44752bc5 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -4,7 +4,7 @@ To help us respond to your issues faster, please make sure to add as much inform If this issue is about a plugin, please open the issue in that repository. -Start your issues title with [Feature Request] / [Bug] / [Question] or no tag if your unsure. Also, please be aware that GitHub now supports uploading of screenshots; look at the bottom of this input field. +Start your issues title with [Feature Request] / [Bug] / [Question] or no tag if you're unsure. Also, please be aware that GitHub now supports uploading of screenshots; look at the bottom of this input field. Please include some basic information: - What grafana version are you using? From 78360ece8ae2f4e411a650fc9b85b65aa812468c Mon Sep 17 00:00:00 2001 From: Richard Hartmann Date: Thu, 19 May 2016 10:59:38 +0200 Subject: [PATCH 05/50] ISSUE_TEMPLATE.md: Improve wording and fix typos (#5101) --- .github/ISSUE_TEMPLATE.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 29b44752bc5..e53a1159941 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,20 +1,19 @@ -Thank you! For helping us make Grafana even better. +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. +To help us respond to your issues more quickly, please make sure to add as much information as possible. -If this issue is about a plugin, please open the issue in that repository. +If this issue is about a plugin, please open the issue in that plugin's repository. -Start your issues title with [Feature Request] / [Bug] / [Question] or no tag if you're unsure. Also, please be aware that GitHub now supports uploading of screenshots; look at the bottom of this input field. +Start your issue's title with [Feature Request] / [Bug] / [Question] or no tag if you're unsure. Also, please be aware that GitHub now supports uploading of screenshots; look at the bottom of this input field. Please include some basic information: -- What grafana version are you using? +- What Grafana version are you using? - What datasource are you using? - What OS are you running grafana on? - What did you do? - What was the expected result? - What happenend instead? -If you question/bug relates to a metric query / unexpected data visualization, please include: +If your question/bug relates to a metric query / unexpected data visualization, please include: - An image or text representation of your metric query - The raw query and response from your data source (check this in chrome dev tools network tab) - From 37821e6d63440cb3ec1d5e5724d9a7c5230213f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 20 May 2016 08:31:27 +0200 Subject: [PATCH 06/50] fix(share modal): fixed link in share modal when sub app url is /dashboard/, fixes #5109 --- public/app/features/dashboard/shareModalCtrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/features/dashboard/shareModalCtrl.js b/public/app/features/dashboard/shareModalCtrl.js index 2944cc79e42..c28f73282b0 100644 --- a/public/app/features/dashboard/shareModalCtrl.js +++ b/public/app/features/dashboard/shareModalCtrl.js @@ -70,7 +70,7 @@ function (angular, _, require, config) { $scope.shareUrl = linkSrv.addParamsToUrl(baseUrl, params); var soloUrl = $scope.shareUrl; - soloUrl = soloUrl.replace('/dashboard/', '/dashboard-solo/'); + soloUrl = soloUrl.replace(config.appSubUrl + '/dashboard/', config.appSubUrl + '/dashboard-solo/'); soloUrl = soloUrl.replace("&fullscreen", ""); $scope.iframeHtml = ''; From 2e02abffc048653c7ce6b03ea944bc6e22070159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 20 May 2016 08:34:35 +0200 Subject: [PATCH 07/50] fix(render): fixed issue with image renderer caused by disabling angular debug info --- vendor/phantomjs/render.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vendor/phantomjs/render.js b/vendor/phantomjs/render.js index e4bb83054a7..0de97273c5c 100644 --- a/vendor/phantomjs/render.js +++ b/vendor/phantomjs/render.js @@ -38,10 +38,10 @@ function checkIsReady() { var canvas = page.evaluate(function() { if (!window.angular) { return false; } - var body = window.angular.element(document.body); // 1 + var body = window.angular.element(document.body); if (!body.scope) { return false; } - var rootScope = body.scope(); + var rootScope = body.injector().get('$rootScope'); if (!rootScope) {return false;} if (!rootScope.performance) { return false; } var panelsToLoad = window.angular.element('div.panel').length; From df0ddc0b5034f9ec7b5ae4feb8c718a63ec8cc8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 20 May 2016 09:03:52 +0200 Subject: [PATCH 08/50] fix(prometheus): fixed bug in prometheus query editor, fixes #5107 --- public/app/plugins/datasource/prometheus/query_ctrl.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/app/plugins/datasource/prometheus/query_ctrl.ts b/public/app/plugins/datasource/prometheus/query_ctrl.ts index 94340804988..92cec328d87 100644 --- a/public/app/plugins/datasource/prometheus/query_ctrl.ts +++ b/public/app/plugins/datasource/prometheus/query_ctrl.ts @@ -58,6 +58,10 @@ class PrometheusQueryCtrl extends QueryCtrl { updateLink() { var range = this.panelCtrl.range; + if (!range) { + return; + } + var rangeDiff = Math.ceil((range.to.valueOf() - range.from.valueOf()) / 1000); var endTime = range.to.utc().format('YYYY-MM-DD HH:mm'); var expr = { From 2416ee04c840c45a4c38087a6e6a2ef4053a7543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 20 May 2016 09:58:07 +0200 Subject: [PATCH 09/50] fix(templating): fixed detection of nested template variables, fixes #5103 --- public/app/features/templating/templateSrv.js | 7 +++++-- public/test/specs/templateSrv-specs.js | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/public/app/features/templating/templateSrv.js b/public/app/features/templating/templateSrv.js index 7e96af22e2a..e2e628c1cd5 100644 --- a/public/app/features/templating/templateSrv.js +++ b/public/app/features/templating/templateSrv.js @@ -97,8 +97,11 @@ function (angular, _) { if (!str) { return false; } - var match = this._regex.exec(str); - return match && (match[1] === variableName || match[2] === variableName); + + variableName = regexEscape(variableName); + var findVarRegex = new RegExp('\\$(' + variableName + ')[\\W|$]|\\[\\[(' + variableName + ')\\]\\]', 'g'); + var match = findVarRegex.exec(str); + return match !== null; }; this.highlightVariablesAsHtml = function(str) { diff --git a/public/test/specs/templateSrv-specs.js b/public/test/specs/templateSrv-specs.js index fd7247cbd81..c1f0e25ff9e 100644 --- a/public/test/specs/templateSrv-specs.js +++ b/public/test/specs/templateSrv-specs.js @@ -200,6 +200,11 @@ define([ expect(contains).to.be(true); }); + it('should find it when part of segment', function() { + var contains = _templateSrv.containsVariable('metrics.$env.$group-*', 'group'); + expect(contains).to.be(true); + }); + }); describe('updateTemplateData with simple value', function() { From e0e8fd663776a995142aa87565c282c11b3a9ed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 20 May 2016 10:24:24 +0200 Subject: [PATCH 10/50] fix(templating): fixed handling of numeric values in tempalting query results, fixes #5097 --- public/app/features/templating/templateValuesSrv.js | 8 ++++++++ public/test/specs/templateSrv-specs.js | 4 ++-- public/test/specs/templateValuesSrv-specs.js | 13 +++++++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/public/app/features/templating/templateValuesSrv.js b/public/app/features/templating/templateValuesSrv.js index d44f07ed366..489e6291011 100644 --- a/public/app/features/templating/templateValuesSrv.js +++ b/public/app/features/templating/templateValuesSrv.js @@ -313,6 +313,14 @@ function (angular, _, kbn) { var value = item.value || item.text; var text = item.text || item.value; + if (_.isNumber(value)) { + value = value.toString(); + } + + if (_.isNumber(text)) { + text = text.toString(); + } + if (regex) { matches = regex.exec(value); if (!matches) { continue; } diff --git a/public/test/specs/templateSrv-specs.js b/public/test/specs/templateSrv-specs.js index c1f0e25ff9e..c5f33d4f72f 100644 --- a/public/test/specs/templateSrv-specs.js +++ b/public/test/specs/templateSrv-specs.js @@ -141,8 +141,8 @@ define([ }); it('slash should be properly escaped in regex format', function() { - var result = _templateSrv.formatValue('Gi3/14', 'regex'); - expect(result).to.be('Gi3\\/14'); + var result = _templateSrv.formatValue('Gi3/14', 'regex'); + expect(result).to.be('Gi3\\/14'); }); }); diff --git a/public/test/specs/templateValuesSrv-specs.js b/public/test/specs/templateValuesSrv-specs.js index 2edcd03da9a..8652ec421b2 100644 --- a/public/test/specs/templateValuesSrv-specs.js +++ b/public/test/specs/templateValuesSrv-specs.js @@ -126,6 +126,19 @@ define([ }); }); + describeUpdateVariable('query variable with numeric results', function(scenario) { + scenario.setup(function() { + scenario.variable = { type: 'query', query: '', name: 'test', current: {} }; + scenario.queryResult = [{text: 12, value: 12}]; + }); + + it('should set current value to first option', function() { + expect(scenario.variable.current.value).to.be('12'); + expect(scenario.variable.options[0].value).to.be('12'); + expect(scenario.variable.options[0].text).to.be('12'); + }); + }); + describeUpdateVariable('interval variable without auto', function(scenario) { scenario.setup(function() { scenario.variable = { type: 'interval', query: '1s,2h,5h,1d', name: 'test' }; From ee86d24797b65bcd74358afc179155d5492ad422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 20 May 2016 10:31:22 +0200 Subject: [PATCH 11/50] fix(elasticsearch): minor editor layout fix --- .../datasource/elasticsearch/partials/bucket_agg.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/app/plugins/datasource/elasticsearch/partials/bucket_agg.html b/public/app/plugins/datasource/elasticsearch/partials/bucket_agg.html index 75979226963..36e914d06e0 100644 --- a/public/app/plugins/datasource/elasticsearch/partials/bucket_agg.html +++ b/public/app/plugins/datasource/elasticsearch/partials/bucket_agg.html @@ -70,9 +70,9 @@
    -
    +
    - +
    @@ -88,7 +88,7 @@
    - +
    From f00cbc0aebfdaa736877ce4828f7d6146ec55a47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 20 May 2016 12:23:26 +0200 Subject: [PATCH 12/50] fix(panel height): fixed issue with singlestat height, fixes #4679, fixes #4894, fixes #5113 --- public/app/features/panel/panel_ctrl.ts | 3 ++- public/app/plugins/panel/graph/graph.js | 2 +- public/app/plugins/panel/singlestat/module.html | 1 - public/app/plugins/panel/singlestat/module.ts | 5 +++-- public/sass/components/_panel_singlestat.scss | 1 - 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/app/features/panel/panel_ctrl.ts b/public/app/features/panel/panel_ctrl.ts index 82e19f8681b..73aefb4c1bd 100644 --- a/public/app/features/panel/panel_ctrl.ts +++ b/public/app/features/panel/panel_ctrl.ts @@ -8,6 +8,7 @@ import $ from 'jquery'; const TITLE_HEIGHT = 25; const EMPTY_TITLE_HEIGHT = 9; const PANEL_PADDING = 5; +const PANEL_BORDER = 2; import {Emitter} from 'app/core/core'; @@ -141,7 +142,7 @@ export class PanelCtrl { } } - this.height = this.containerHeight - (PANEL_PADDING + (this.panel.title ? TITLE_HEIGHT : EMPTY_TITLE_HEIGHT)); + this.height = this.containerHeight - (PANEL_BORDER + PANEL_PADDING + (this.panel.title ? TITLE_HEIGHT : EMPTY_TITLE_HEIGHT)); } render(payload?) { diff --git a/public/app/plugins/panel/graph/graph.js b/public/app/plugins/panel/graph/graph.js index 562bf71c947..86ad3b5f025 100755 --- a/public/app/plugins/panel/graph/graph.js +++ b/public/app/plugins/panel/graph/graph.js @@ -66,7 +66,7 @@ function (angular, $, moment, _, kbn, GraphTooltip) { function getLegendHeight(panelHeight) { if (!panel.legend.show || panel.legend.rightSide) { - return 2; + return 0; } if (panel.legend.alignAsTable) { diff --git a/public/app/plugins/panel/singlestat/module.html b/public/app/plugins/panel/singlestat/module.html index 599e8724159..75a35374566 100644 --- a/public/app/plugins/panel/singlestat/module.html +++ b/public/app/plugins/panel/singlestat/module.html @@ -1,4 +1,3 @@
    -
    diff --git a/public/app/plugins/panel/singlestat/module.ts b/public/app/plugins/panel/singlestat/module.ts index 9fa3e8e39c6..d8a623b7ac1 100644 --- a/public/app/plugins/panel/singlestat/module.ts +++ b/public/app/plugins/panel/singlestat/module.ts @@ -234,10 +234,13 @@ class SingleStatCtrl extends MetricsPanelCtrl { var panel = ctrl.panel; var templateSrv = this.templateSrv; var data, linkInfo; + var width, height; var $panelContainer = elem.find('.panel-container'); elem = elem.find('.singlestat-panel'); function setElementHeight() { + width = elem.width(); + height = elem.height(); elem.css('height', ctrl.height + 'px'); } @@ -291,8 +294,6 @@ class SingleStatCtrl extends MetricsPanelCtrl { } var plotCanvas = $('
    '); - var width = elem.width(); - var height = elem.height(); var plotCss = { top: '10px', margin: 'auto', diff --git a/public/sass/components/_panel_singlestat.scss b/public/sass/components/_panel_singlestat.scss index fac2f716674..48d0a29f4b8 100644 --- a/public/sass/components/_panel_singlestat.scss +++ b/public/sass/components/_panel_singlestat.scss @@ -5,7 +5,6 @@ } .singlestat-panel-value-container { - padding: 20px; display: table-cell; vertical-align: middle; text-align: center; From 9c672f6ec1ad09b633144d42a17d57cd9bc37746 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Fri, 20 May 2016 19:29:10 +0900 Subject: [PATCH 13/50] (prometheus) support new legend format (with backward compatibility) (#5096) * (prometheus) support new legend format (with backward compatibility) * (prometheus) use regex replace for legend format * (prometheus) allow white space --- .../datasource/prometheus/datasource.ts | 25 ++++++------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/public/app/plugins/datasource/prometheus/datasource.ts b/public/app/plugins/datasource/prometheus/datasource.ts index f1c58f6a61d..cbd7b1ba24b 100644 --- a/public/app/plugins/datasource/prometheus/datasource.ts +++ b/public/app/plugins/datasource/prometheus/datasource.ts @@ -256,23 +256,14 @@ export function PrometheusDatasource(instanceSettings, $q, backendSrv, templateS return this.renderTemplate(options.legendFormat, labelData) || '{}'; }; - this.renderTemplate = function(format, data) { - var originalSettings = _.templateSettings; - _.templateSettings = { - interpolate: /\{\{(.+?)\}\}/g - }; - - var template = _.template(templateSrv.replace(format)); - var result; - try { - result = template(data); - } catch (e) { - result = null; - } - - _.templateSettings = originalSettings; - - return result; + this.renderTemplate = function(aliasPattern, aliasData) { + var aliasRegex = /\{\{\s*(.+?)\s*\}\}/g; + return aliasPattern.replace(aliasRegex, function(match, g1) { + if (aliasData[g1]) { + return aliasData[g1]; + } + return g1; + }); }; this.getOriginalMetricName = function(labelData) { From 441682b5986535aefb47160161b9ba097c389465 Mon Sep 17 00:00:00 2001 From: "David J. Felix" Date: Fri, 20 May 2016 08:01:12 -0400 Subject: [PATCH 14/50] Fix linking for /dashboard-solo/ proxy prefix (#5116) Fixes #5109 --- public/app/features/dashboard/shareModalCtrl.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/app/features/dashboard/shareModalCtrl.js b/public/app/features/dashboard/shareModalCtrl.js index c28f73282b0..6f778ea27c2 100644 --- a/public/app/features/dashboard/shareModalCtrl.js +++ b/public/app/features/dashboard/shareModalCtrl.js @@ -75,7 +75,7 @@ function (angular, _, require, config) { $scope.iframeHtml = ''; - $scope.imageUrl = soloUrl.replace('/dashboard-solo/', '/render/dashboard-solo/'); + $scope.imageUrl = soloUrl.replace(config.appSubUrl + '/dashboard-solo/', config.appSubUrl + '/render/dashboard-solo/'); $scope.imageUrl += '&width=1000'; $scope.imageUrl += '&height=500'; }; From e6f251011fb9c7cf523ee822fb8019dace353abe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 20 May 2016 15:15:02 +0200 Subject: [PATCH 15/50] fix(panel span): fixed issue setting panel span while in fullscren and also an issue when changing repeat variable while in fullscreen view, fixes #4957 --- public/app/features/dashboard/rowCtrl.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/public/app/features/dashboard/rowCtrl.js b/public/app/features/dashboard/rowCtrl.js index 5607f1eecac..8ab1fcf88f8 100644 --- a/public/app/features/dashboard/rowCtrl.js +++ b/public/app/features/dashboard/rowCtrl.js @@ -142,12 +142,18 @@ function (angular, _, config) { }); module.directive('panelWidth', function() { + var fullscreen = false; + return function(scope, element) { function updateWidth() { - element[0].style.width = ((scope.panel.span / 1.2) * 10) + '%'; + if (!fullscreen) { + element[0].style.width = ((scope.panel.span / 1.2) * 10) + '%'; + } } scope.onAppEvent('panel-fullscreen-enter', function(evt, info) { + fullscreen = true; + if (scope.panel.id !== info.panelId) { element.hide(); } else { @@ -156,14 +162,20 @@ function (angular, _, config) { }); scope.onAppEvent('panel-fullscreen-exit', function(evt, info) { + fullscreen = false; + if (scope.panel.id !== info.panelId) { element.show(); - } else { - updateWidth(); } + + updateWidth(); }); scope.$watch('panel.span', updateWidth); + + if (fullscreen) { + element.hide(); + } }; }); From fb4dc77f36684b1e3e678047b670c6cc91b9f177 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 20 May 2016 15:26:19 +0200 Subject: [PATCH 16/50] docs(): updated changelog with 3.0.3 fixes --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bf074487057..1c4004f46a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,14 @@ # 3.0.3 Patch release (unreleased) * **Time picker**: Fixed issue timepicker and UTC when reading time from URL, fixes [#5078](https://github.com/grafana/grafana/issues/5078) * **CloudWatch**: Support for Multiple Account by AssumeRole, closes [#3522](https://github.com/grafana/grafana/issues/3522) +* **Singlestat**: Fixed alignment and minium height issue, fixes [#5113](https://github.com/grafana/grafana/issues/5113), fixes [#4679](https://github.com/grafana/grafana/issues/4679) +* **Share modal**: Fixed link when using grafana under dashboard sub url, fixes [#5109](https://github.com/grafana/grafana/issues/5109) +* **Prometheus**: Fixed bug in query editor that caused it not to load when reloading page, fixes [#5107](https://github.com/grafana/grafana/issues/5107) +* **Elasticsearch**: Fixed bug when template variable query returns numeric values, fixes [#5097](https://github.com/grafana/grafana/issues/5097), fixes [#5088](https://github.com/grafana/grafana/issues/5088) +* **Logging**: Fixed issue with reading logging level value, fixes [#5079](https://github.com/grafana/grafana/issues/5079) +* **Timepicker**: Fixed issue with timepicker and UTC when reading time from URL, fixes [#5078](https://github.com/grafana/grafana/issues/5078) +* **Docs**: Added docs for org & user preferences HTTP API, closes [#5069](https://github.com/grafana/grafana/issues/5069) +* **Plugin list panel**: Now shows correct enable state for apps when not enabled, fixes [#5068](https://github.com/grafana/grafana/issues/5068) # 3.0.2 Patch release (2016-05-16) From c727c3c441942a9bdcfb9ef37a3925a857844966 Mon Sep 17 00:00:00 2001 From: Trent White Date: Fri, 20 May 2016 15:58:14 -0400 Subject: [PATCH 17/50] resize and color of links --- .bra.toml | 2 +- public/sass/components/_footer.scss | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.bra.toml b/.bra.toml index 54019208984..f56e88fb02a 100644 --- a/.bra.toml +++ b/.bra.toml @@ -3,7 +3,7 @@ init_cmds = [ ["go", "build", "-o", "./bin/grafana-server", "./pkg/cmd/grafana-server"], ["./bin/grafana-server"] ] -watch_all = true +watch_all = false watch_dirs = [ "$WORKDIR/pkg", "$WORKDIR/public/views", diff --git a/public/sass/components/_footer.scss b/public/sass/components/_footer.scss index 3796275d7f9..5f9b433f45b 100644 --- a/public/sass/components/_footer.scss +++ b/public/sass/components/_footer.scss @@ -1,8 +1,14 @@ +footer { + font-size: 75%; + a { + color: $gray-1; + } +} + .grafana-version-info { position: absolute; bottom: 2px; left: 3px; - font-size: 80%; color: darken($gray-1, 25%); a { color: darken($gray-1, 25%); } } From cffcc4c7a5de8b12e1e925eb9c1e9b4095204ba5 Mon Sep 17 00:00:00 2001 From: Trent White Date: Fri, 20 May 2016 16:44:19 -0400 Subject: [PATCH 18/50] make footer unordered list. add new icons. --- public/sass/components/_footer.scss | 18 +++++++++ public/views/index.html | 57 ++++++++++++++++------------- 2 files changed, 49 insertions(+), 26 deletions(-) diff --git a/public/sass/components/_footer.scss b/public/sass/components/_footer.scss index 5f9b433f45b..3c8353ecbc7 100644 --- a/public/sass/components/_footer.scss +++ b/public/sass/components/_footer.scss @@ -1,8 +1,26 @@ footer { font-size: 75%; + width: 98%; /* was causing horiz scrollbars - need to examine */ a { color: $gray-1; } + ul { + list-style: none; + } + li { display: inline-block; + padding-right: 2px; + &:after { + content: ' | '; + padding-left: 2px; + color: $gray-1; + } + } + li:last-child { + &:after { + padding-left: 0; + content: ''; + } + } } .grafana-version-info { diff --git a/public/views/index.html b/public/views/index.html index 9bf1f9f2f0c..e6f05c4593b 100644 --- a/public/views/index.html +++ b/public/views/index.html @@ -39,34 +39,39 @@
    - From 1d27a7f93d2ff495a555bc369b888a29ab27084c Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Sat, 21 May 2016 16:02:04 +0900 Subject: [PATCH 19/50] (cloudwatch) fix wrong cache key of credentials (#5124) --- pkg/api/cloudwatch/cloudwatch.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkg/api/cloudwatch/cloudwatch.go b/pkg/api/cloudwatch/cloudwatch.go index 5b4449b5c02..4e9c6cc9064 100644 --- a/pkg/api/cloudwatch/cloudwatch.go +++ b/pkg/api/cloudwatch/cloudwatch.go @@ -57,11 +57,12 @@ var awsCredentialCache map[string]cache = make(map[string]cache) var credentialCacheLock sync.RWMutex func getCredentials(profile string, region string, assumeRoleArn string) *credentials.Credentials { + cacheKey := profile + ":" + assumeRoleArn credentialCacheLock.RLock() - if _, ok := awsCredentialCache[profile]; ok { - if awsCredentialCache[profile].expiration != nil && - (*awsCredentialCache[profile].expiration).After(time.Now().UTC()) { - result := awsCredentialCache[profile].credential + if _, ok := awsCredentialCache[cacheKey]; ok { + if awsCredentialCache[cacheKey].expiration != nil && + (*awsCredentialCache[cacheKey].expiration).After(time.Now().UTC()) { + result := awsCredentialCache[cacheKey].credential credentialCacheLock.RUnlock() return result } @@ -118,7 +119,7 @@ func getCredentials(profile string, region string, assumeRoleArn string) *creden &ec2rolecreds.EC2RoleProvider{Client: ec2metadata.New(sess), ExpiryWindow: 5 * time.Minute}, }) credentialCacheLock.Lock() - awsCredentialCache[profile] = cache{ + awsCredentialCache[cacheKey] = cache{ credential: creds, expiration: expiration, } From 75940c1f5dd544451743541c8b4f5d82f8e81f83 Mon Sep 17 00:00:00 2001 From: Trent White Date: Sat, 21 May 2016 13:21:31 -0400 Subject: [PATCH 20/50] turn watch all back on --- .bra.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bra.toml b/.bra.toml index f56e88fb02a..54019208984 100644 --- a/.bra.toml +++ b/.bra.toml @@ -3,7 +3,7 @@ init_cmds = [ ["go", "build", "-o", "./bin/grafana-server", "./pkg/cmd/grafana-server"], ["./bin/grafana-server"] ] -watch_all = false +watch_all = true watch_dirs = [ "$WORKDIR/pkg", "$WORKDIR/public/views", From 43ba563a1c409402ba9ac0afbe68d227341b37a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 23 May 2016 07:55:55 +0200 Subject: [PATCH 21/50] fix(logging): change log level to trace for plugin proxy logging call, fixes #5126 --- pkg/api/pluginproxy/pluginproxy.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/api/pluginproxy/pluginproxy.go b/pkg/api/pluginproxy/pluginproxy.go index 92d07988b64..21d40ecb948 100644 --- a/pkg/api/pluginproxy/pluginproxy.go +++ b/pkg/api/pluginproxy/pluginproxy.go @@ -88,7 +88,7 @@ func NewApiPluginProxy(ctx *middleware.Context, proxyPath string, route *plugins } for key, value := range headers { - log.Info("setting key %v value %v", key, value[0]) + log.Trace("setting key %v value %v", key, value[0]) req.Header.Set(key, value[0]) } } From 1da149d9e1c179c2b0d139474ad750f0c6fdc9ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 23 May 2016 09:28:14 +0200 Subject: [PATCH 22/50] feat(annotations): annotations can now use a template variable as data source, closes #5054 --- package.json | 2 +- public/app/core/services/datasource_srv.js | 51 +++++++++++-------- .../app/features/annotations/editor_ctrl.js | 2 +- 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index b9b87ab6e75..b110d6107c8 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "company": "Coding Instinct AB" }, "name": "grafana", - "version": "3.0.2", + "version": "3.0.3", "repository": { "type": "git", "url": "http://github.com/grafana/grafana.git" diff --git a/public/app/core/services/datasource_srv.js b/public/app/core/services/datasource_srv.js index 32bc9a39725..378cfa2d9d5 100644 --- a/public/app/core/services/datasource_srv.js +++ b/public/app/core/services/datasource_srv.js @@ -66,14 +66,17 @@ function (angular, _, coreModule, config) { }; this.getAnnotationSources = function() { - return _.reduce(config.datasources, function(memo, value) { + var sources = []; + this.addDataSourceVariables(sources); + + _.each(config.datasources, function(value) { if (value.meta && value.meta.annotations) { - memo.push(value); + sources.push(value); } + }); - return memo; - }, []); + return sources; }; this.getMetricSources = function(options) { @@ -90,24 +93,7 @@ function (angular, _, coreModule, config) { }); if (!options || !options.skipVariables) { - // look for data source variables - for (var i = 0; i < templateSrv.variables.length; i++) { - var variable = templateSrv.variables[i]; - if (variable.type !== 'datasource') { - continue; - } - - var first = variable.current.value; - var ds = config.datasources[first]; - - if (ds) { - metricSources.push({ - name: '$' + variable.name, - value: '$' + variable.name, - meta: ds.meta, - }); - } - } + this.addDataSourceVariables(metricSources); } metricSources.sort(function(a, b) { @@ -123,6 +109,27 @@ function (angular, _, coreModule, config) { return metricSources; }; + this.addDataSourceVariables = function(list) { + // look for data source variables + for (var i = 0; i < templateSrv.variables.length; i++) { + var variable = templateSrv.variables[i]; + if (variable.type !== 'datasource') { + continue; + } + + var first = variable.current.value; + var ds = config.datasources[first]; + + if (ds) { + list.push({ + name: '$' + variable.name, + value: '$' + variable.name, + meta: ds.meta, + }); + } + } + }; + this.init(); }); }); diff --git a/public/app/features/annotations/editor_ctrl.js b/public/app/features/annotations/editor_ctrl.js index ca754b094a8..c37592cc905 100644 --- a/public/app/features/annotations/editor_ctrl.js +++ b/public/app/features/annotations/editor_ctrl.js @@ -30,7 +30,7 @@ function (angular, _, $) { $scope.datasourceChanged = function() { return datasourceSrv.get($scope.currentAnnotation.datasource).then(function(ds) { $scope.currentDatasource = ds; - $scope.currentAnnotation.datasource = ds.name; + $scope.currentAnnotation.datasource = $scope.currentAnnotation.datasource; }); }; From cfc771020503dac3c4a30982ec121a24b229dc5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 23 May 2016 09:31:52 +0200 Subject: [PATCH 23/50] docs(): changelog updated --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c4004f46a7..7d12dfa0bc6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,12 @@ -# 3.1.0 +# 3.1.0 (unreleased) ### Enhancements * **Singlestat**: Add support for range to text mappings, closes [#1319](https://github.com/grafana/grafana/issues/1319) * **Graph**: Adds sort order options for graph tooltip, closes [#1189](https://github.com/grafana/grafana/issues/1189) * **Theme**: Add default theme to config file [#5011](https://github.com/grafana/grafana/pull/5011) -# 3.0.3 Patch release (unreleased) +# 3.0.3 Patch release (2016-05-23) +* **Annotations**: Annotations can now use a template variable as data source, closes [#5054](https://github.com/grafana/grafana/issues/5054) * **Time picker**: Fixed issue timepicker and UTC when reading time from URL, fixes [#5078](https://github.com/grafana/grafana/issues/5078) * **CloudWatch**: Support for Multiple Account by AssumeRole, closes [#3522](https://github.com/grafana/grafana/issues/3522) * **Singlestat**: Fixed alignment and minium height issue, fixes [#5113](https://github.com/grafana/grafana/issues/5113), fixes [#4679](https://github.com/grafana/grafana/issues/4679) From dfe3806d01b68e13360cb14b84b0b9027fa67af0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 23 May 2016 10:14:40 +0200 Subject: [PATCH 24/50] fix(elasticsearch): fixed query editor issue with elasticsearch --- public/app/core/directives/metric_segment.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/app/core/directives/metric_segment.js b/public/app/core/directives/metric_segment.js index 61415a660b2..4b3cd2e8de3 100644 --- a/public/app/core/directives/metric_segment.js +++ b/public/app/core/directives/metric_segment.js @@ -209,7 +209,9 @@ function (_, $, coreModule) { // needs to call this after digest so // property is synced with outerscope $scope.$$postDigest(function() { - $scope.onChange(); + $scope.$apply(function() { + $scope.onChange(); + }); }); }; From dc77d555f92ef16745d21bd844a2cdaebff95a65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 23 May 2016 10:58:31 +0200 Subject: [PATCH 25/50] fix(elasticsearch): fixed templating issue with elasticsearch, fixes #5135 --- public/app/features/templating/templateSrv.js | 18 +++++++++++------- .../datasource/elasticsearch/datasource.js | 14 +++++++++++--- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/public/app/features/templating/templateSrv.js b/public/app/features/templating/templateSrv.js index e2e628c1cd5..2e5f945c96a 100644 --- a/public/app/features/templating/templateSrv.js +++ b/public/app/features/templating/templateSrv.js @@ -42,6 +42,16 @@ function (angular, _) { return value.replace(/([\!\*\+\-\=<>\s\&\|\(\)\[\]\{\}\^\~\?\:\\/"])/g, "\\$1"); } + this.luceneFormat = function(value) { + if (typeof value === 'string') { + return luceneEscape(value); + } + var quotedValues = _.map(value, function(val) { + return '\"' + luceneEscape(val) + '\"'; + }); + return '(' + quotedValues.join(' OR ') + ')'; + }; + this.formatValue = function(value, format, variable) { // for some scopedVars there is no variable variable = variable || {}; @@ -60,13 +70,7 @@ function (angular, _) { return '(' + escapedValues.join('|') + ')'; } case "lucene": { - if (typeof value === 'string') { - return luceneEscape(value); - } - var quotedValues = _.map(value, function(val) { - return '\"' + luceneEscape(val) + '\"'; - }); - return '(' + quotedValues.join(' OR ') + ')'; + return this.luceneFormat(value, format, variable); } case "pipe": { if (typeof value === 'string') { diff --git a/public/app/plugins/datasource/elasticsearch/datasource.js b/public/app/plugins/datasource/elasticsearch/datasource.js index c7c2351d0cc..d5926be3f81 100644 --- a/public/app/plugins/datasource/elasticsearch/datasource.js +++ b/public/app/plugins/datasource/elasticsearch/datasource.js @@ -78,7 +78,7 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes range[timeField]["format"] = "epoch_millis"; } - var queryInterpolated = templateSrv.replace(queryString); + var queryInterpolated = templateSrv.replace(queryString, {}, 'lucene'); var filter = { "bool": { "must": [{ "range": range }] } }; var query = { "bool": { "should": [{ "query_string": { "query": queryInterpolated } }] } }; var data = { @@ -204,6 +204,14 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes }); }; + function escapeForJson(value) { + return value.replace(/\"/g, '\\"'); + } + + function luceneThenJsonFormat(value) { + return escapeForJson(templateSrv.luceneFormat(value)); + } + this.getFields = function(query) { return this._get('/_mapping').then(function(res) { var fields = {}; @@ -246,7 +254,7 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes var header = this.getQueryHeader('count', range.from, range.to); var esQuery = angular.toJson(this.queryBuilder.getTermsQuery(queryDef)); - esQuery = esQuery.replace("$lucene_query", queryDef.query || '*'); + esQuery = esQuery.replace("$lucene_query", escapeForJson(queryDef.query || '*')); esQuery = esQuery.replace(/\$timeFrom/g, range.from.valueOf()); esQuery = esQuery.replace(/\$timeTo/g, range.to.valueOf()); esQuery = header + '\n' + esQuery + '\n'; @@ -260,7 +268,7 @@ function (angular, _, moment, kbn, ElasticQueryBuilder, IndexPattern, ElasticRes }; this.metricFindQuery = function(query) { - query = templateSrv.replace(query); + query = templateSrv.replace(query, {}, luceneThenJsonFormat); query = angular.fromJson(query); if (!query) { return $q.when([]); From cd82f579bd6fb902f539f87cba8c8aa13373e0f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 23 May 2016 11:08:08 +0200 Subject: [PATCH 26/50] docs(): updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d12dfa0bc6..e6ec23d86bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ * **Timepicker**: Fixed issue with timepicker and UTC when reading time from URL, fixes [#5078](https://github.com/grafana/grafana/issues/5078) * **Docs**: Added docs for org & user preferences HTTP API, closes [#5069](https://github.com/grafana/grafana/issues/5069) * **Plugin list panel**: Now shows correct enable state for apps when not enabled, fixes [#5068](https://github.com/grafana/grafana/issues/5068) +* **Elasticsearch**: Templating & Annotation queries that use template variables are now formatted correctly, fixes [#5135](https://github.com/grafana/grafana/issues/5135) # 3.0.2 Patch release (2016-05-16) From 9eec68985d0f622538bfddb13e33007574e2a8c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 23 May 2016 11:49:07 +0200 Subject: [PATCH 27/50] docs(): updated download links --- docs/sources/installation/debian.md | 6 +++--- docs/sources/installation/windows.md | 2 +- packaging/publish/publish.sh | 22 ++++++++++------------ 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/docs/sources/installation/debian.md b/docs/sources/installation/debian.md index 1b3957fa684..a07e3089e65 100644 --- a/docs/sources/installation/debian.md +++ b/docs/sources/installation/debian.md @@ -10,13 +10,13 @@ page_keywords: grafana, installation, debian, ubuntu, guide Description | Download ------------ | ------------- -Stable .deb for Debian-based Linux | [grafana_3.0.2-1463383025_amd64.deb](https://grafanarel.s3.amazonaws.com/builds/grafana_3.0.2-1463383025_amd64.deb) +Stable .deb for Debian-based Linux | [grafana_3.0.3-1463994644.deb](https://grafanarel.s3.amazonaws.com/builds/grafana_3.0.3-1463994644.deb) ## Install Stable - $ wget https://grafanarel.s3.amazonaws.com/builds/grafana_3.0.2-1463383025_amd64.deb + $ wget https://grafanarel.s3.amazonaws.com/builds/grafana_3.0.3-1463994644.deb $ sudo apt-get install -y adduser libfontconfig - $ sudo dpkg -i grafana_3.0.2-1463383025_amd64.deb + $ sudo dpkg -i grafana_3.0.3-1463994644.deb ## APT Repository diff --git a/docs/sources/installation/windows.md b/docs/sources/installation/windows.md index baa13d0350c..ea9a8de049c 100644 --- a/docs/sources/installation/windows.md +++ b/docs/sources/installation/windows.md @@ -10,7 +10,7 @@ page_keywords: grafana, installation, windows guide Description | Download ------------ | ------------- -Stable Zip package for Windows | [grafana.3.0.2.windows-x64.zip](https://grafanarel.s3.amazonaws.com/winbuilds/dist/grafana-3.0.2.windows-x64.zip) +Stable Zip package for Windows | [grafana.3.0.3.windows-x64.zip](https://grafanarel.s3.amazonaws.com/winbuilds/dist/grafana-3.0.3.windows-x64.zip) ## Configure diff --git a/packaging/publish/publish.sh b/packaging/publish/publish.sh index 79da73d441a..d17a5d01627 100755 --- a/packaging/publish/publish.sh +++ b/packaging/publish/publish.sh @@ -1,22 +1,20 @@ #! /usr/bin/env bash -deb_ver=3.0.1 -rpm_ver=3.0.1-1 +deb_ver=3.0.3-1463994644 +rpm_ver=3.0.3-1463994644 -#rpm_ver=3.0.0-1 +wget https://grafanarel.s3.amazonaws.com/builds/grafana_${deb_ver}_amd64.deb -#wget https://grafanarel.s3.amazonaws.com/builds/grafana_${deb_ver}_amd64.deb +package_cloud push grafana/stable/debian/jessie grafana_${deb_ver}_amd64.deb +package_cloud push grafana/stable/debian/wheezy grafana_${deb_ver}_amd64.deb -#package_cloud push grafana/stable/debian/jessie grafana_${deb_ver}_amd64.deb -#package_cloud push grafana/stable/debian/wheezy grafana_${deb_ver}_amd64.deb +package_cloud push grafana/testing/debian/jessie grafana_${deb_ver}_amd64.deb +package_cloud push grafana/testing/debian/wheezy grafana_${deb_ver}_amd64.deb -#package_cloud push grafana/testing/debian/jessie grafana_${deb_ver}_amd64.deb -#package_cloud push grafana/testing/debian/wheezy grafana_${deb_ver}_amd64.deb +wget https://grafanarel.s3.amazonaws.com/builds/grafana-${rpm_ver}.x86_64.rpm -#wget https://grafanarel.s3.amazonaws.com/builds/grafana-${rpm_ver}.x86_64.rpm - -#package_cloud push grafana/testing/el/6 grafana-${rpm_ver}.x86_64.rpm -#package_cloud push grafana/testing/el/7 grafana-${rpm_ver}.x86_64.rpm +package_cloud push grafana/testing/el/6 grafana-${rpm_ver}.x86_64.rpm +package_cloud push grafana/testing/el/7 grafana-${rpm_ver}.x86_64.rpm package_cloud push grafana/stable/el/7 grafana-${rpm_ver}.x86_64.rpm package_cloud push grafana/stable/el/6 grafana-${rpm_ver}.x86_64.rpm From bbea698af37e81b95d1af5f73eb22dd816d9b7c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 23 May 2016 12:30:46 +0200 Subject: [PATCH 28/50] Update latest.json --- latest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/latest.json b/latest.json index 443a440a529..9a54260bc92 100644 --- a/latest.json +++ b/latest.json @@ -1,4 +1,4 @@ { - "stable": "3.0.2", - "testing": "3.0.2" + "stable": "3.0.3", + "testing": "3.0.3" } From 9e6056551da47cfb9b7f8069d1c74aa3cbe12da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 23 May 2016 14:13:30 +0200 Subject: [PATCH 29/50] docs(): updated download links --- docs/sources/installation/debian.md | 6 +++--- docs/sources/installation/rpm.md | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/sources/installation/debian.md b/docs/sources/installation/debian.md index a07e3089e65..4bd3d35b1d3 100644 --- a/docs/sources/installation/debian.md +++ b/docs/sources/installation/debian.md @@ -10,13 +10,13 @@ page_keywords: grafana, installation, debian, ubuntu, guide Description | Download ------------ | ------------- -Stable .deb for Debian-based Linux | [grafana_3.0.3-1463994644.deb](https://grafanarel.s3.amazonaws.com/builds/grafana_3.0.3-1463994644.deb) +Stable .deb for Debian-based Linux | [grafana_3.0.3-1463994644.deb](https://grafanarel.s3.amazonaws.com/builds/grafana_3.0.3-1463994644_amd64.deb) ## Install Stable - $ wget https://grafanarel.s3.amazonaws.com/builds/grafana_3.0.3-1463994644.deb + $ wget https://grafanarel.s3.amazonaws.com/builds/grafana_3.0.3-1463994644_amd64.deb $ sudo apt-get install -y adduser libfontconfig - $ sudo dpkg -i grafana_3.0.3-1463994644.deb + $ sudo dpkg -i grafana_3.0.3-1463994644_amd64.deb ## APT Repository diff --git a/docs/sources/installation/rpm.md b/docs/sources/installation/rpm.md index af3ae7f8288..4caf5764903 100644 --- a/docs/sources/installation/rpm.md +++ b/docs/sources/installation/rpm.md @@ -10,24 +10,24 @@ page_keywords: grafana, installation, centos, fedora, opensuse, redhat, guide Description | Download ------------ | ------------- -Stable .RPM for CentOS / Fedora / OpenSuse / Redhat Linux | [grafana-3.0.2-1463383025.x86_64.rpm](https://grafanarel.s3.amazonaws.com/builds/grafana-3.0.2-1463383025.x86_64.rpm) +Stable .RPM for CentOS / Fedora / OpenSuse / Redhat Linux | [grafana-3.0.3-1463994644.x86_64.rpm](https://grafanarel.s3.amazonaws.com/builds/grafana-3.0.3-1463994644.x86_64.rpm) ## Install Stable Release from package file You can install Grafana using Yum directly. - $ sudo yum install https://grafanarel.s3.amazonaws.com/builds/grafana-3.0.2-1463383025.x86_64.rpm + $ sudo yum install https://grafanarel.s3.amazonaws.com/builds/grafana-3.0.3-1463994644.x86_64.rpm Or install manually using `rpm`. #### On CentOS / Fedora / Redhat: $ sudo yum install initscripts fontconfig - $ sudo rpm -Uvh grafana-3.0.2-1463383025.x86_64.rpm + $ sudo rpm -Uvh grafana-3.0.3-1463994644.x86_64.rpm #### On OpenSuse: - $ sudo rpm -i --nodeps grafana-3.0.2-1463383025.x86_64.rpm + $ sudo rpm -i --nodeps grafana-3.0.3-1463994644.x86_64.rpm ## Install via YUM Repository From 76d18e71564d6a26a264061e64d190a2836dfc77 Mon Sep 17 00:00:00 2001 From: Trent White Date: Mon, 23 May 2016 11:45:54 -0400 Subject: [PATCH 30/50] remove height: 100% on .main-view --- public/sass/layout/_page.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/sass/layout/_page.scss b/public/sass/layout/_page.scss index 8de65053888..6203f4be083 100644 --- a/public/sass/layout/_page.scss +++ b/public/sass/layout/_page.scss @@ -4,7 +4,7 @@ } .main-view { - height: 100%; + // height: 100%; REMOVED FOR FOOTER TRW } .page-container { From a52869507efcfc899a78feff468718b42376fbe7 Mon Sep 17 00:00:00 2001 From: Trent White Date: Mon, 23 May 2016 12:46:13 -0400 Subject: [PATCH 31/50] hide footer on non-dashboard pages --- public/sass/components/_footer.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/sass/components/_footer.scss b/public/sass/components/_footer.scss index 3c8353ecbc7..0f34e4b0dd0 100644 --- a/public/sass/components/_footer.scss +++ b/public/sass/components/_footer.scss @@ -1,3 +1,7 @@ +.page-dashboard footer { + display: none; +} + footer { font-size: 75%; width: 98%; /* was causing horiz scrollbars - need to examine */ From 8a0d5aa38d6bb2c8591be10ecdd10a1466120a5f Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Mon, 23 May 2016 11:58:21 -0700 Subject: [PATCH 32/50] [Bug Fix] #5136 (#5142) --- public/app/core/time_series2.ts | 4 ++-- .../panel/graph/specs/graph_ctrl_specs.ts | 18 +++++++++--------- public/test/core/time_series_specs.js | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/public/app/core/time_series2.ts b/public/app/core/time_series2.ts index cbceff7afd8..dfae26fb48b 100644 --- a/public/app/core/time_series2.ts +++ b/public/app/core/time_series2.ts @@ -173,8 +173,8 @@ export default class TimeSeries { isMsResolutionNeeded() { for (var i = 0; i < this.datapoints.length; i++) { - if (this.datapoints[i][0] !== null) { - var timestamp = this.datapoints[i][0].toString(); + if (this.datapoints[i][1] !== null) { + var timestamp = this.datapoints[i][1].toString(); if (timestamp.length === 13 && (timestamp % 1000) !== 0) { return true; } diff --git a/public/app/plugins/panel/graph/specs/graph_ctrl_specs.ts b/public/app/plugins/panel/graph/specs/graph_ctrl_specs.ts index dfce4031772..d00c90ae6a1 100644 --- a/public/app/plugins/panel/graph/specs/graph_ctrl_specs.ts +++ b/public/app/plugins/panel/graph/specs/graph_ctrl_specs.ts @@ -22,8 +22,8 @@ describe('GraphCtrl', function() { describe('msResolution with second resolution timestamps', function() { beforeEach(function() { var data = [ - { target: 'test.cpu1', datapoints: [[1234567890, 45], [1234567899, 60]]}, - { target: 'test.cpu2', datapoints: [[1236547890, 55], [1234456709, 90]]} + { target: 'test.cpu1', datapoints: [[45, 1234567890], [60, 1234567899]]}, + { target: 'test.cpu2', datapoints: [[55, 1236547890], [90, 1234456709]]} ]; ctx.ctrl.panel.tooltip.msResolution = false; ctx.ctrl.onDataReceived(data); @@ -37,8 +37,8 @@ describe('GraphCtrl', function() { describe('msResolution with millisecond resolution timestamps', function() { beforeEach(function() { var data = [ - { target: 'test.cpu1', datapoints: [[1234567890000, 45], [1234567899000, 60]]}, - { target: 'test.cpu2', datapoints: [[1236547890001, 55], [1234456709000, 90]]} + { target: 'test.cpu1', datapoints: [[45, 1234567890000], [60, 1234567899000]]}, + { target: 'test.cpu2', datapoints: [[55, 1236547890001], [90, 1234456709000]]} ]; ctx.ctrl.panel.tooltip.msResolution = false; ctx.ctrl.onDataReceived(data); @@ -52,8 +52,8 @@ describe('GraphCtrl', function() { describe('msResolution with millisecond resolution timestamps but with trailing zeroes', function() { beforeEach(function() { var data = [ - { target: 'test.cpu1', datapoints: [[1234567890000, 45], [1234567899000, 60]]}, - { target: 'test.cpu2', datapoints: [[1236547890000, 55], [1234456709000, 90]]} + { target: 'test.cpu1', datapoints: [[45, 1234567890000], [60, 1234567899000]]}, + { target: 'test.cpu2', datapoints: [[55, 1236547890000], [90, 1234456709000]]} ]; ctx.ctrl.panel.tooltip.msResolution = false; ctx.ctrl.onDataReceived(data); @@ -67,9 +67,9 @@ describe('GraphCtrl', function() { describe('msResolution with millisecond resolution timestamps in one of the series', function() { beforeEach(function() { var data = [ - { target: 'test.cpu1', datapoints: [[1234567890000, 45], [1234567899000, 60]]}, - { target: 'test.cpu2', datapoints: [[1236547890010, 55], [1234456709000, 90]]}, - { target: 'test.cpu3', datapoints: [[1236547890000, 65], [1234456709000, 120]]} + { target: 'test.cpu1', datapoints: [[45, 1234567890000], [60, 1234567899000]]}, + { target: 'test.cpu2', datapoints: [[55, 1236547890010], [90, 1234456709000]]}, + { target: 'test.cpu3', datapoints: [[65, 1236547890000], [120, 1234456709000]]} ]; ctx.ctrl.panel.tooltip.msResolution = false; ctx.ctrl.onDataReceived(data); diff --git a/public/test/core/time_series_specs.js b/public/test/core/time_series_specs.js index 9d273c86b94..034e872e2f1 100644 --- a/public/test/core/time_series_specs.js +++ b/public/test/core/time_series_specs.js @@ -56,7 +56,7 @@ define([ }); }); - describe('can detect if serie contains ms precision', function() { + describe('can detect if series contains ms precision', function() { var fakedata; beforeEach(function() { @@ -64,13 +64,13 @@ define([ }); it('missing datapoint with ms precision', function() { - fakedata.datapoints[0] = [1234567890000, 1337]; + fakedata.datapoints[0] = [1337, 1234567890000]; series = new TimeSeries(fakedata); expect(series.isMsResolutionNeeded()).to.be(false); }); it('contains datapoint with ms precision', function() { - fakedata.datapoints[0] = [1236547890001, 1337]; + fakedata.datapoints[0] = [1337, 1236547890001]; series = new TimeSeries(fakedata); expect(series.isMsResolutionNeeded()).to.be(true); }); From ec19a97156ebe2cb599433a4f6f15f0b81dc84be Mon Sep 17 00:00:00 2001 From: Utkarsh Bhatnagar Date: Mon, 23 May 2016 11:58:21 -0700 Subject: [PATCH 33/50] [Bug Fix] #5136 (#5142) --- public/app/core/time_series2.ts | 4 ++-- .../panel/graph/specs/graph_ctrl_specs.ts | 18 +++++++++--------- public/test/core/time_series_specs.js | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/public/app/core/time_series2.ts b/public/app/core/time_series2.ts index cbceff7afd8..dfae26fb48b 100644 --- a/public/app/core/time_series2.ts +++ b/public/app/core/time_series2.ts @@ -173,8 +173,8 @@ export default class TimeSeries { isMsResolutionNeeded() { for (var i = 0; i < this.datapoints.length; i++) { - if (this.datapoints[i][0] !== null) { - var timestamp = this.datapoints[i][0].toString(); + if (this.datapoints[i][1] !== null) { + var timestamp = this.datapoints[i][1].toString(); if (timestamp.length === 13 && (timestamp % 1000) !== 0) { return true; } diff --git a/public/app/plugins/panel/graph/specs/graph_ctrl_specs.ts b/public/app/plugins/panel/graph/specs/graph_ctrl_specs.ts index dfce4031772..d00c90ae6a1 100644 --- a/public/app/plugins/panel/graph/specs/graph_ctrl_specs.ts +++ b/public/app/plugins/panel/graph/specs/graph_ctrl_specs.ts @@ -22,8 +22,8 @@ describe('GraphCtrl', function() { describe('msResolution with second resolution timestamps', function() { beforeEach(function() { var data = [ - { target: 'test.cpu1', datapoints: [[1234567890, 45], [1234567899, 60]]}, - { target: 'test.cpu2', datapoints: [[1236547890, 55], [1234456709, 90]]} + { target: 'test.cpu1', datapoints: [[45, 1234567890], [60, 1234567899]]}, + { target: 'test.cpu2', datapoints: [[55, 1236547890], [90, 1234456709]]} ]; ctx.ctrl.panel.tooltip.msResolution = false; ctx.ctrl.onDataReceived(data); @@ -37,8 +37,8 @@ describe('GraphCtrl', function() { describe('msResolution with millisecond resolution timestamps', function() { beforeEach(function() { var data = [ - { target: 'test.cpu1', datapoints: [[1234567890000, 45], [1234567899000, 60]]}, - { target: 'test.cpu2', datapoints: [[1236547890001, 55], [1234456709000, 90]]} + { target: 'test.cpu1', datapoints: [[45, 1234567890000], [60, 1234567899000]]}, + { target: 'test.cpu2', datapoints: [[55, 1236547890001], [90, 1234456709000]]} ]; ctx.ctrl.panel.tooltip.msResolution = false; ctx.ctrl.onDataReceived(data); @@ -52,8 +52,8 @@ describe('GraphCtrl', function() { describe('msResolution with millisecond resolution timestamps but with trailing zeroes', function() { beforeEach(function() { var data = [ - { target: 'test.cpu1', datapoints: [[1234567890000, 45], [1234567899000, 60]]}, - { target: 'test.cpu2', datapoints: [[1236547890000, 55], [1234456709000, 90]]} + { target: 'test.cpu1', datapoints: [[45, 1234567890000], [60, 1234567899000]]}, + { target: 'test.cpu2', datapoints: [[55, 1236547890000], [90, 1234456709000]]} ]; ctx.ctrl.panel.tooltip.msResolution = false; ctx.ctrl.onDataReceived(data); @@ -67,9 +67,9 @@ describe('GraphCtrl', function() { describe('msResolution with millisecond resolution timestamps in one of the series', function() { beforeEach(function() { var data = [ - { target: 'test.cpu1', datapoints: [[1234567890000, 45], [1234567899000, 60]]}, - { target: 'test.cpu2', datapoints: [[1236547890010, 55], [1234456709000, 90]]}, - { target: 'test.cpu3', datapoints: [[1236547890000, 65], [1234456709000, 120]]} + { target: 'test.cpu1', datapoints: [[45, 1234567890000], [60, 1234567899000]]}, + { target: 'test.cpu2', datapoints: [[55, 1236547890010], [90, 1234456709000]]}, + { target: 'test.cpu3', datapoints: [[65, 1236547890000], [120, 1234456709000]]} ]; ctx.ctrl.panel.tooltip.msResolution = false; ctx.ctrl.onDataReceived(data); diff --git a/public/test/core/time_series_specs.js b/public/test/core/time_series_specs.js index 9d273c86b94..034e872e2f1 100644 --- a/public/test/core/time_series_specs.js +++ b/public/test/core/time_series_specs.js @@ -56,7 +56,7 @@ define([ }); }); - describe('can detect if serie contains ms precision', function() { + describe('can detect if series contains ms precision', function() { var fakedata; beforeEach(function() { @@ -64,13 +64,13 @@ define([ }); it('missing datapoint with ms precision', function() { - fakedata.datapoints[0] = [1234567890000, 1337]; + fakedata.datapoints[0] = [1337, 1234567890000]; series = new TimeSeries(fakedata); expect(series.isMsResolutionNeeded()).to.be(false); }); it('contains datapoint with ms precision', function() { - fakedata.datapoints[0] = [1236547890001, 1337]; + fakedata.datapoints[0] = [1337, 1236547890001]; series = new TimeSeries(fakedata); expect(series.isMsResolutionNeeded()).to.be(true); }); From a3f2f574c6a00acacd4e1c5f0b232fec392c1497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 23 May 2016 21:23:31 +0200 Subject: [PATCH 34/50] fix(singlestat): fixed Gauge positioning issue, fixes #5143 --- public/app/plugins/panel/singlestat/module.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/app/plugins/panel/singlestat/module.ts b/public/app/plugins/panel/singlestat/module.ts index d8a623b7ac1..a7a3b765631 100644 --- a/public/app/plugins/panel/singlestat/module.ts +++ b/public/app/plugins/panel/singlestat/module.ts @@ -234,13 +234,10 @@ class SingleStatCtrl extends MetricsPanelCtrl { var panel = ctrl.panel; var templateSrv = this.templateSrv; var data, linkInfo; - var width, height; var $panelContainer = elem.find('.panel-container'); elem = elem.find('.singlestat-panel'); function setElementHeight() { - width = elem.width(); - height = elem.height(); elem.css('height', ctrl.height + 'px'); } @@ -287,6 +284,9 @@ class SingleStatCtrl extends MetricsPanelCtrl { } function addGauge() { + var width = elem.width(); + var height = elem.height(); + ctrl.invalidGaugeRange = false; if (panel.gauge.minValue > panel.gauge.maxValue) { ctrl.invalidGaugeRange = true; From f1ec270e3e6f0e01148043aad854c0c982027f5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 23 May 2016 21:24:02 +0200 Subject: [PATCH 35/50] bumped version to 3.0.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b110d6107c8..aab228bf312 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "company": "Coding Instinct AB" }, "name": "grafana", - "version": "3.0.3", + "version": "3.0.4", "repository": { "type": "git", "url": "http://github.com/grafana/grafana.git" From fff5aa30208a6982e0d5b74ccc2dc3aa71d2c889 Mon Sep 17 00:00:00 2001 From: Zdenek Styblik Date: Mon, 23 May 2016 21:24:23 +0200 Subject: [PATCH 36/50] Add missing option `Read-Only Editor` to auto_assign_org_role description (#5139) Commit adds missing option `Read-Only Editor` to `auto_assign_org_role` description. --- docs/sources/installation/configuration.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/sources/installation/configuration.md b/docs/sources/installation/configuration.md index e7d1d68523a..bbfe381d1f0 100644 --- a/docs/sources/installation/configuration.md +++ b/docs/sources/installation/configuration.md @@ -226,7 +226,7 @@ organization to be created for that new user. The role new users will be assigned for the main organization (if the above setting is set to true). Defaults to `Viewer`, other valid -options are `Admin` and `Editor`. +options are `Admin` and `Editor` and `Read-Only Editor`.
    From c41c771e9aac4a9540666439341d1f3c57e03a3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 24 May 2016 07:39:58 +0200 Subject: [PATCH 37/50] fix(home dashboard): fixed handling error when default dashboard is not found, fixes #5141 --- pkg/api/dashboard.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/pkg/api/dashboard.go b/pkg/api/dashboard.go index b55a1377bd8..589aa68e737 100644 --- a/pkg/api/dashboard.go +++ b/pkg/api/dashboard.go @@ -8,6 +8,7 @@ import ( "github.com/grafana/grafana/pkg/api/dtos" "github.com/grafana/grafana/pkg/bus" + "github.com/grafana/grafana/pkg/log" "github.com/grafana/grafana/pkg/metrics" "github.com/grafana/grafana/pkg/middleware" m "github.com/grafana/grafana/pkg/models" @@ -167,14 +168,12 @@ func GetHomeDashboard(c *middleware.Context) { if prefsQuery.Result.HomeDashboardId != 0 { slugQuery := m.GetDashboardSlugByIdQuery{Id: prefsQuery.Result.HomeDashboardId} err := bus.Dispatch(&slugQuery) - if err != nil { - c.JsonApiErr(500, "Failed to get slug from database", err) - return + if err == nil { + dashRedirect := dtos.DashboardRedirect{RedirectUri: "db/" + slugQuery.Result} + c.JSON(200, &dashRedirect) + } else { + log.Warn("Failed to get slug from database, %s", err.Error()) } - - dashRedirect := dtos.DashboardRedirect{RedirectUri: "db/" + slugQuery.Result} - c.JSON(200, &dashRedirect) - return } filePath := path.Join(setting.StaticRootPath, "dashboards/home.json") From 10c47ee27c78fc2a8a434142d2fe10a8ae33b080 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 24 May 2016 08:11:28 +0200 Subject: [PATCH 38/50] feat(footer): some minor changes to footer to make it look good in light theme, closes #4889 --- pkg/cmd/grafana-server/main.go | 2 +- public/sass/_variables.dark.scss | 4 ++ public/sass/_variables.light.scss | 4 ++ public/sass/components/_footer.scss | 66 ++++++++++++++--------------- public/views/index.html | 4 +- 5 files changed, 43 insertions(+), 37 deletions(-) diff --git a/pkg/cmd/grafana-server/main.go b/pkg/cmd/grafana-server/main.go index b2c66ba185e..35fae1cbac4 100644 --- a/pkg/cmd/grafana-server/main.go +++ b/pkg/cmd/grafana-server/main.go @@ -24,7 +24,7 @@ import ( "github.com/grafana/grafana/pkg/social" ) -var version = "3.0.0-beta4" +var version = "3.1.0" var commit = "NA" var buildstamp string var build_date string diff --git a/public/sass/_variables.dark.scss b/public/sass/_variables.dark.scss index fed3d805b82..debf15e09d5 100644 --- a/public/sass/_variables.dark.scss +++ b/public/sass/_variables.dark.scss @@ -268,3 +268,7 @@ $checkboxImageUrl: '../img/checkbox.png'; $card-background: linear-gradient(135deg, #2f2f2f, #262626); $card-background-hover: linear-gradient(135deg, #343434, #262626); $card-shadow: -1px -1px 0 0 hsla(0, 0%, 100%, .1), 1px 1px 0 0 rgba(0, 0, 0, .3); + +// footer +$footer-link-color: $gray-1; +$footer-link-hover: $gray-4; diff --git a/public/sass/_variables.light.scss b/public/sass/_variables.light.scss index 42775d989f7..90262a3134c 100644 --- a/public/sass/_variables.light.scss +++ b/public/sass/_variables.light.scss @@ -292,3 +292,7 @@ $checkboxImageUrl: '../img/checkbox_white.png'; $card-background: linear-gradient(135deg, $gray-5, $gray-6); $card-background-hover: linear-gradient(135deg, $gray-6, $gray-7); $card-shadow: -1px -1px 0 0 hsla(0, 0%, 100%, .1), 1px 1px 0 0 rgba(0, 0, 0, .1); + +// footer +$footer-link-color: $gray-3; +$footer-link-hover: $dark-5; diff --git a/public/sass/components/_footer.scss b/public/sass/components/_footer.scss index 2388048f124..8f3b9186d15 100644 --- a/public/sass/components/_footer.scss +++ b/public/sass/components/_footer.scss @@ -1,40 +1,38 @@ -.page-dashboard footer { +.page-dashboard .footer { display: none; } -footer { - font-size: 75%; - width: 98%; /* was causing horiz scrollbars - need to examine */ - a { - color: $gray-1; - } - ul { - list-style: none; - } - li { display: inline-block; - padding-right: 2px; - &:after { - content: ' | '; - padding-left: 2px; - color: $gray-1; - } - } - li:last-child { - &:after { - padding-left: 0; - content: ''; - } - } -} - -.grafana-version-info { - position: absolute; - bottom: 2px; - left: 3px; - color: darken($gray-1, 25%); - a { color: darken($gray-1, 25%); } -} - .footer { + color: $footer-link-color; padding: 5rem 0 1rem 0; + font-size: $font-size-xs; + width: 98%; /* was causing horiz scrollbars - need to examine */ + + a { + color: $footer-link-color; + + &:hover { + color: $footer-link-hover; + } + } + + ul { + list-style: none; + } + + li { + display: inline-block; + padding-right: 2px; + &:after { + content: ' | '; + padding-left: 2px; + } + } + + li:last-child { + &:after { + padding-left: 0; + content: ''; + } + } } diff --git a/public/views/index.html b/public/views/index.html index e6f05c4593b..70981fb7784 100644 --- a/public/views/index.html +++ b/public/views/index.html @@ -60,9 +60,9 @@ Community -
  • +
  • Grafana - v[[.BuildVersion]] (commit: [[.BuildCommit]]) + v[[.BuildVersion]] (commit: [[.BuildCommit]])
  • [[if .NewGrafanaVersionExists]] From 366baea099ec85908ab9afef6c8757bd97e8d267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 24 May 2016 08:14:40 +0200 Subject: [PATCH 39/50] docs(): updated changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6ec23d86bd..36bc37a3246 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * **Singlestat**: Add support for range to text mappings, closes [#1319](https://github.com/grafana/grafana/issues/1319) * **Graph**: Adds sort order options for graph tooltip, closes [#1189](https://github.com/grafana/grafana/issues/1189) * **Theme**: Add default theme to config file [#5011](https://github.com/grafana/grafana/pull/5011) +* **Page Footer**: Added page footer with links to docs, shows Grafana version and info if new version is available, closes [#4889](https://github.com/grafana/grafana/pull/4889) # 3.0.3 Patch release (2016-05-23) * **Annotations**: Annotations can now use a template variable as data source, closes [#5054](https://github.com/grafana/grafana/issues/5054) From 6f094ef215261bcf0c44313a74e299c2cb1e4856 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 24 May 2016 09:50:23 +0200 Subject: [PATCH 40/50] fix(templating): fixed issue with nested template variables and multi select, the child variable selection state is now updated like single select variables, so if none matches the first option is selected, fixes #4861 --- .../features/templating/templateValuesSrv.js | 15 ++++++- public/test/specs/templateValuesSrv-specs.js | 40 +++++++++++++++++++ 2 files changed, 53 insertions(+), 2 deletions(-) diff --git a/public/app/features/templating/templateValuesSrv.js b/public/app/features/templating/templateValuesSrv.js index 489e6291011..7c411377d87 100644 --- a/public/app/features/templating/templateValuesSrv.js +++ b/public/app/features/templating/templateValuesSrv.js @@ -244,15 +244,26 @@ function (angular, _, kbn) { this.validateVariableSelectionState = function(variable) { if (!variable.current) { if (!variable.options.length) { return; } - return self.setVariableValue(variable, variable.options[0], true); + return self.setVariableValue(variable, variable.options[0], false); } if (_.isArray(variable.current.value)) { self.selectOptionsForCurrentValue(variable); + // updated selected value + var selected = { + value: _.map(_.filter(variable.options, {selected: true}), function(op) { + return op.value; + }) + }; + // if none pick first + if (selected.value.length === 0) { + selected = variable.options[0]; + } + return self.setVariableValue(variable, selected, false); } else { var currentOption = _.findWhere(variable.options, {text: variable.current.text}); if (currentOption) { - return self.setVariableValue(variable, currentOption, true); + return self.setVariableValue(variable, currentOption, false); } else { if (!variable.options.length) { return; } return self.setVariableValue(variable, variable.options[0]); diff --git a/public/test/specs/templateValuesSrv-specs.js b/public/test/specs/templateValuesSrv-specs.js index 8652ec421b2..79aa2eafd8d 100644 --- a/public/test/specs/templateValuesSrv-specs.js +++ b/public/test/specs/templateValuesSrv-specs.js @@ -126,6 +126,46 @@ define([ }); }); + describeUpdateVariable('query variable with multi select and new options does not contain some selected values', function(scenario) { + scenario.setup(function() { + scenario.variable = { + type: 'query', + query: '', + name: 'test', + current: { + value: ['val1', 'val2', 'val3'], + text: 'val1 + val2 + val3' + } + }; + scenario.queryResult = [{text: 'val2'}, {text: 'val3'}]; + }); + + it('should update current value', function() { + expect(scenario.variable.current.value).to.eql(['val2', 'val3']); + expect(scenario.variable.current.text).to.eql('val2 + val3'); + }); + }); + + describeUpdateVariable('query variable with multi select and new options does not contain any selected values', function(scenario) { + scenario.setup(function() { + scenario.variable = { + type: 'query', + query: '', + name: 'test', + current: { + value: ['val1', 'val2', 'val3'], + text: 'val1 + val2 + val3' + } + }; + scenario.queryResult = [{text: 'val5'}, {text: 'val6'}]; + }); + + it('should update current value with first one', function() { + expect(scenario.variable.current.value).to.eql('val5'); + expect(scenario.variable.current.text).to.eql('val5'); + }); + }); + describeUpdateVariable('query variable with numeric results', function(scenario) { scenario.setup(function() { scenario.variable = { type: 'query', query: '', name: 'test', current: {} }; From 5607a114f91c5a25457deccbda102502f479bcc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 24 May 2016 09:53:28 +0200 Subject: [PATCH 41/50] updated changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36bc37a3246..a9e1b551b34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ * **Theme**: Add default theme to config file [#5011](https://github.com/grafana/grafana/pull/5011) * **Page Footer**: Added page footer with links to docs, shows Grafana version and info if new version is available, closes [#4889](https://github.com/grafana/grafana/pull/4889) +# 3.0.4 Patch release (unreleased) +* **Templating**: Fixed issue with nested multi select variables and cascading and updating child variable selection state, fixes [#4861](https://github.com/grafana/grafana/pull/4861) +* **Singlestat gauge**: Fixed issue with gauge render position, fixes [#5143](https://github.com/grafana/grafana/pull/5143) + # 3.0.3 Patch release (2016-05-23) * **Annotations**: Annotations can now use a template variable as data source, closes [#5054](https://github.com/grafana/grafana/issues/5054) * **Time picker**: Fixed issue timepicker and UTC when reading time from URL, fixes [#5078](https://github.com/grafana/grafana/issues/5078) From a81806d3d08b15ff08486a6298cb7f38e2f11951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 24 May 2016 13:57:25 +0200 Subject: [PATCH 42/50] feat(dashboard): sync time range with url, closes #458 --- public/app/features/dashboard/timeSrv.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/public/app/features/dashboard/timeSrv.js b/public/app/features/dashboard/timeSrv.js index cd52155ff5f..96ba832f8b0 100644 --- a/public/app/features/dashboard/timeSrv.js +++ b/public/app/features/dashboard/timeSrv.js @@ -10,7 +10,7 @@ define([ var module = angular.module('grafana.services'); - module.service('timeSrv', function($rootScope, $timeout, $routeParams, timer) { + module.service('timeSrv', function($rootScope, $timeout, $routeParams, timer, $location) { var self = this; this.init = function(dashboard) { @@ -108,6 +108,13 @@ define([ this.old_refresh = null; } + // update url params + var urlParams = $location.search(); + var urlRange = this.timeRangeForUrl(); + urlParams.from = urlRange.from; + urlParams.to = urlRange.to; + $location.search(urlParams); + $rootScope.appEvent('time-range-changed', this.time); $timeout(this.refreshDashboard, 0); }; From 41deea90ee0f977863d2dddb6161467f47dd9b01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Tue, 24 May 2016 16:34:17 +0200 Subject: [PATCH 43/50] feat(dashboard): template variable changes updates url, closes #5002 --- CHANGELOG.md | 2 ++ .../app/features/dashboard/submenu/submenu.ts | 24 ++++++++++++++++++- .../features/templating/templateValuesSrv.js | 6 +++-- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9e1b551b34..3d8252b6a85 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # 3.1.0 (unreleased) ### Enhancements +* **Dashboard Url**: Time range changes updates url, closes [#458](https://github.com/grafana/grafana/issues/458) +* **Dashboard Url**: Template variable change updates url, closes [#5002](https://github.com/grafana/grafana/issues/5002) * **Singlestat**: Add support for range to text mappings, closes [#1319](https://github.com/grafana/grafana/issues/1319) * **Graph**: Adds sort order options for graph tooltip, closes [#1189](https://github.com/grafana/grafana/issues/1189) * **Theme**: Add default theme to config file [#5011](https://github.com/grafana/grafana/pull/5011) diff --git a/public/app/features/dashboard/submenu/submenu.ts b/public/app/features/dashboard/submenu/submenu.ts index a9899c3a4b8..ee1dc77def8 100644 --- a/public/app/features/dashboard/submenu/submenu.ts +++ b/public/app/features/dashboard/submenu/submenu.ts @@ -1,6 +1,7 @@ /// import angular from 'angular'; +import _ from 'lodash'; export class SubmenuCtrl { annotations: any; @@ -8,7 +9,11 @@ export class SubmenuCtrl { dashboard: any; /** @ngInject */ - constructor(private $rootScope, private templateValuesSrv, private dynamicDashboardSrv) { + constructor(private $rootScope, + private templateValuesSrv, + private templateSrv, + private dynamicDashboardSrv, + private $location) { this.annotations = this.dashboard.templating.list; this.variables = this.dashboard.templating.list; } @@ -22,8 +27,25 @@ export class SubmenuCtrl { return this.templateValuesSrv.getValuesForTag(variable, tagKey); } + updateUrlParamsWithCurrentVariables() { + // update url + var params = this.$location.search(); + // remove variable params + _.each(params, function(value, key) { + if (key.indexOf('var-') === 0) { + delete params[key]; + } + }); + + // add new values + this.templateSrv.fillVariableValuesForUrl(params); + // update url + this.$location.search(params); + } + variableUpdated(variable) { this.templateValuesSrv.variableUpdated(variable).then(() => { + this.updateUrlParamsWithCurrentVariables(); this.dynamicDashboardSrv.update(this.dashboard); this.$rootScope.$emit('template-variable-value-updated'); this.$rootScope.$broadcast('refresh'); diff --git a/public/app/features/templating/templateValuesSrv.js b/public/app/features/templating/templateValuesSrv.js index 7c411377d87..ce41bc6af7b 100644 --- a/public/app/features/templating/templateValuesSrv.js +++ b/public/app/features/templating/templateValuesSrv.js @@ -79,7 +79,6 @@ function (angular, _, kbn) { else if (variable.refresh === 1 || variable.refresh === 2) { return self.updateOptions(variable).then(function() { if (_.isEmpty(variable.current) && variable.options.length) { - console.log("setting current for %s", variable.name); self.setVariableValue(variable, variable.options[0]); } lock.resolve(); @@ -102,7 +101,10 @@ function (angular, _, kbn) { } return promise.then(function() { - var option = _.findWhere(variable.options, { text: urlValue }); + var option = _.find(variable.options, function(op) { + return op.text === urlValue || op.value === urlValue; + }); + option = option || { text: urlValue, value: urlValue }; self.updateAutoInterval(variable); From 71d62012e1731e3e3c3f39783e90118c35154969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 25 May 2016 09:46:15 +0200 Subject: [PATCH 44/50] fix(panel): fixed issue with fullscreen panel view and switching to another dashboard, fixes #5163 --- public/app/features/dashboard/rowCtrl.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/app/features/dashboard/rowCtrl.js b/public/app/features/dashboard/rowCtrl.js index 8ab1fcf88f8..4534b9bc510 100644 --- a/public/app/features/dashboard/rowCtrl.js +++ b/public/app/features/dashboard/rowCtrl.js @@ -142,9 +142,10 @@ function (angular, _, config) { }); module.directive('panelWidth', function() { - var fullscreen = false; return function(scope, element) { + var fullscreen = false; + function updateWidth() { if (!fullscreen) { element[0].style.width = ((scope.panel.span / 1.2) * 10) + '%'; From 8c2b6b532dc97b56639c5e268532793950767177 Mon Sep 17 00:00:00 2001 From: bergquist Date: Wed, 25 May 2016 09:56:45 +0200 Subject: [PATCH 45/50] fix(preferences): fixes broken default home dashboard closes #5167 --- pkg/api/api.go | 2 +- pkg/api/dashboard.go | 14 ++++++-------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/pkg/api/api.go b/pkg/api/api.go index 684633e0bcd..f4b096f0b04 100644 --- a/pkg/api/api.go +++ b/pkg/api/api.go @@ -209,7 +209,7 @@ func Register(r *macaron.Macaron) { r.Combo("/db/:slug").Get(GetDashboard).Delete(DeleteDashboard) r.Post("/db", reqEditorRole, bind(m.SaveDashboardCommand{}), PostDashboard) r.Get("/file/:file", GetDashboardFromJsonFile) - r.Get("/home", GetHomeDashboard) + r.Get("/home", wrap(GetHomeDashboard)) r.Get("/tags", GetDashboardTags) r.Post("/import", bind(dtos.ImportDashboardCommand{}), wrap(ImportDashboard)) }) diff --git a/pkg/api/dashboard.go b/pkg/api/dashboard.go index 589aa68e737..cad9da19e82 100644 --- a/pkg/api/dashboard.go +++ b/pkg/api/dashboard.go @@ -159,10 +159,10 @@ func canEditDashboard(role m.RoleType) bool { return role == m.ROLE_ADMIN || role == m.ROLE_EDITOR || role == m.ROLE_READ_ONLY_EDITOR } -func GetHomeDashboard(c *middleware.Context) { +func GetHomeDashboard(c *middleware.Context) Response { prefsQuery := m.GetPreferencesWithDefaultsQuery{OrgId: c.OrgId, UserId: c.UserId} if err := bus.Dispatch(&prefsQuery); err != nil { - c.JsonApiErr(500, "Failed to get preferences", err) + return ApiError(500, "Failed to get preferences", err) } if prefsQuery.Result.HomeDashboardId != 0 { @@ -170,7 +170,7 @@ func GetHomeDashboard(c *middleware.Context) { err := bus.Dispatch(&slugQuery) if err == nil { dashRedirect := dtos.DashboardRedirect{RedirectUri: "db/" + slugQuery.Result} - c.JSON(200, &dashRedirect) + return Json(200, &dashRedirect) } else { log.Warn("Failed to get slug from database, %s", err.Error()) } @@ -179,8 +179,7 @@ func GetHomeDashboard(c *middleware.Context) { filePath := path.Join(setting.StaticRootPath, "dashboards/home.json") file, err := os.Open(filePath) if err != nil { - c.JsonApiErr(500, "Failed to load home dashboard", err) - return + return ApiError(500, "Failed to load home dashboard", err) } dash := dtos.DashboardFullWithMeta{} @@ -188,11 +187,10 @@ func GetHomeDashboard(c *middleware.Context) { dash.Meta.CanEdit = canEditDashboard(c.OrgRole) jsonParser := json.NewDecoder(file) if err := jsonParser.Decode(&dash.Dashboard); err != nil { - c.JsonApiErr(500, "Failed to load home dashboard", err) - return + return ApiError(500, "Failed to load home dashboard", err) } - c.JSON(200, &dash) + return Json(200, &dash) } func GetDashboardFromJsonFile(c *middleware.Context) { From ec98b7d672f81f9a10130aa6633ceebb1cce69de Mon Sep 17 00:00:00 2001 From: bergquist Date: Wed, 25 May 2016 10:01:49 +0200 Subject: [PATCH 46/50] docs(changelog): add note about fix for 5167 --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d8252b6a85..03b375ec51b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ # 3.0.4 Patch release (unreleased) * **Templating**: Fixed issue with nested multi select variables and cascading and updating child variable selection state, fixes [#4861](https://github.com/grafana/grafana/pull/4861) * **Singlestat gauge**: Fixed issue with gauge render position, fixes [#5143](https://github.com/grafana/grafana/pull/5143) +* **Home dashboard**: Fixes broken home dashboard api, fixes [#5167](https://github.com/grafana/grafana/issues/5167) # 3.0.3 Patch release (2016-05-23) * **Annotations**: Annotations can now use a template variable as data source, closes [#5054](https://github.com/grafana/grafana/issues/5054) From 0daadc954c189d2f2b1d1c67f1959262a2ca7a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 25 May 2016 10:46:35 +0200 Subject: [PATCH 47/50] fix(templating): fixed issue with detecting data source variable in other template variable definition, fixes #5165 --- public/app/features/templating/templateSrv.js | 2 +- public/test/specs/templateSrv-specs.js | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/public/app/features/templating/templateSrv.js b/public/app/features/templating/templateSrv.js index 2e5f945c96a..b8d6cbaee2d 100644 --- a/public/app/features/templating/templateSrv.js +++ b/public/app/features/templating/templateSrv.js @@ -103,7 +103,7 @@ function (angular, _) { } variableName = regexEscape(variableName); - var findVarRegex = new RegExp('\\$(' + variableName + ')[\\W|$]|\\[\\[(' + variableName + ')\\]\\]', 'g'); + var findVarRegex = new RegExp('\\$(' + variableName + ')(?:\\W|$)|\\[\\[(' + variableName + ')\\]\\]', 'g'); var match = findVarRegex.exec(str); return match !== null; }; diff --git a/public/test/specs/templateSrv-specs.js b/public/test/specs/templateSrv-specs.js index c5f33d4f72f..a592cc7a152 100644 --- a/public/test/specs/templateSrv-specs.js +++ b/public/test/specs/templateSrv-specs.js @@ -205,6 +205,10 @@ define([ expect(contains).to.be(true); }); + it('should find it its the only thing', function() { + var contains = _templateSrv.containsVariable('$env', 'env'); + expect(contains).to.be(true); + }); }); describe('updateTemplateData with simple value', function() { From 5040570ea9ec96d8577af50324272afcbdd1e534 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 25 May 2016 11:07:29 +0200 Subject: [PATCH 48/50] docs(): updated changelog --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03b375ec51b..323aaaecac2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,8 +8,10 @@ * **Theme**: Add default theme to config file [#5011](https://github.com/grafana/grafana/pull/5011) * **Page Footer**: Added page footer with links to docs, shows Grafana version and info if new version is available, closes [#4889](https://github.com/grafana/grafana/pull/4889) -# 3.0.4 Patch release (unreleased) +# 3.0.4 Patch release (2016-05-25) +* **Panel**: Fixed blank dashboard issue when switching to other dashboard while in fullscreen edit mode, fixes [#5163](https://github.com/grafana/grafana/pull/5163) * **Templating**: Fixed issue with nested multi select variables and cascading and updating child variable selection state, fixes [#4861](https://github.com/grafana/grafana/pull/4861) +* **Templating**: Fixed issue with using templated data source in another template variable query, fixes [#5165](https://github.com/grafana/grafana/pull/5165) * **Singlestat gauge**: Fixed issue with gauge render position, fixes [#5143](https://github.com/grafana/grafana/pull/5143) * **Home dashboard**: Fixes broken home dashboard api, fixes [#5167](https://github.com/grafana/grafana/issues/5167) From 3312a042dd7f5bd185d9ab4d101f7e5e653a5aef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 25 May 2016 11:50:00 +0200 Subject: [PATCH 49/50] docs(): updated download links --- docs/sources/installation/debian.md | 6 +++--- docs/sources/installation/rpm.md | 8 ++++---- docs/sources/installation/windows.md | 2 +- packaging/publish/publish.sh | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/sources/installation/debian.md b/docs/sources/installation/debian.md index 4bd3d35b1d3..6084b9b317d 100644 --- a/docs/sources/installation/debian.md +++ b/docs/sources/installation/debian.md @@ -10,13 +10,13 @@ page_keywords: grafana, installation, debian, ubuntu, guide Description | Download ------------ | ------------- -Stable .deb for Debian-based Linux | [grafana_3.0.3-1463994644.deb](https://grafanarel.s3.amazonaws.com/builds/grafana_3.0.3-1463994644_amd64.deb) +Stable .deb for Debian-based Linux | [grafana_3.0.4-1464167696.deb](https://grafanarel.s3.amazonaws.com/builds/grafana_3.0.4-1464167696_amd64.deb) ## Install Stable - $ wget https://grafanarel.s3.amazonaws.com/builds/grafana_3.0.3-1463994644_amd64.deb + $ wget https://grafanarel.s3.amazonaws.com/builds/grafana_3.0.4-1464167696_amd64.deb $ sudo apt-get install -y adduser libfontconfig - $ sudo dpkg -i grafana_3.0.3-1463994644_amd64.deb + $ sudo dpkg -i grafana_3.0.4-1464167696_amd64.deb ## APT Repository diff --git a/docs/sources/installation/rpm.md b/docs/sources/installation/rpm.md index 4caf5764903..854ba91fcf7 100644 --- a/docs/sources/installation/rpm.md +++ b/docs/sources/installation/rpm.md @@ -10,24 +10,24 @@ page_keywords: grafana, installation, centos, fedora, opensuse, redhat, guide Description | Download ------------ | ------------- -Stable .RPM for CentOS / Fedora / OpenSuse / Redhat Linux | [grafana-3.0.3-1463994644.x86_64.rpm](https://grafanarel.s3.amazonaws.com/builds/grafana-3.0.3-1463994644.x86_64.rpm) +Stable .RPM for CentOS / Fedora / OpenSuse / Redhat Linux | [grafana-3.0.4-1464167696.x86_64.rpm](https://grafanarel.s3.amazonaws.com/builds/grafana-3.0.4-1464167696.x86_64.rpm) ## Install Stable Release from package file You can install Grafana using Yum directly. - $ sudo yum install https://grafanarel.s3.amazonaws.com/builds/grafana-3.0.3-1463994644.x86_64.rpm + $ sudo yum install https://grafanarel.s3.amazonaws.com/builds/grafana-3.0.4-1464167696.x86_64.rpm Or install manually using `rpm`. #### On CentOS / Fedora / Redhat: $ sudo yum install initscripts fontconfig - $ sudo rpm -Uvh grafana-3.0.3-1463994644.x86_64.rpm + $ sudo rpm -Uvh grafana-3.0.4-1464167696.x86_64.rpm #### On OpenSuse: - $ sudo rpm -i --nodeps grafana-3.0.3-1463994644.x86_64.rpm + $ sudo rpm -i --nodeps grafana-3.0.4-1464167696.x86_64.rpm ## Install via YUM Repository diff --git a/docs/sources/installation/windows.md b/docs/sources/installation/windows.md index ea9a8de049c..858f8cfea2d 100644 --- a/docs/sources/installation/windows.md +++ b/docs/sources/installation/windows.md @@ -10,7 +10,7 @@ page_keywords: grafana, installation, windows guide Description | Download ------------ | ------------- -Stable Zip package for Windows | [grafana.3.0.3.windows-x64.zip](https://grafanarel.s3.amazonaws.com/winbuilds/dist/grafana-3.0.3.windows-x64.zip) +Stable Zip package for Windows | [grafana.3.0.4.windows-x64.zip](https://grafanarel.s3.amazonaws.com/winbuilds/dist/grafana-3.0.4.windows-x64.zip) ## Configure diff --git a/packaging/publish/publish.sh b/packaging/publish/publish.sh index d17a5d01627..892bfc178cc 100755 --- a/packaging/publish/publish.sh +++ b/packaging/publish/publish.sh @@ -1,7 +1,7 @@ #! /usr/bin/env bash -deb_ver=3.0.3-1463994644 -rpm_ver=3.0.3-1463994644 +deb_ver=3.0.4-1464167696 +rpm_ver=3.0.4-1464167696 wget https://grafanarel.s3.amazonaws.com/builds/grafana_${deb_ver}_amd64.deb From 2712d9ae8bf612c9b9dcf401c22f583b9a3fa88f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Wed, 25 May 2016 12:23:32 +0200 Subject: [PATCH 50/50] Update latest.json --- latest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/latest.json b/latest.json index 9a54260bc92..7fe27b91983 100644 --- a/latest.json +++ b/latest.json @@ -1,4 +1,4 @@ { - "stable": "3.0.3", - "testing": "3.0.3" + "stable": "3.0.4", + "testing": "3.0.4" }