From 2b1dcaf5e38a1e912236b2ec78822021991169aa Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 11 Aug 2014 11:25:30 +0200 Subject: [PATCH 1/2] added global page title prefix setting --- src/app/components/settings.js | 1 + src/app/controllers/dash.js | 2 +- src/config.sample.js | 11 +++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/app/components/settings.js b/src/app/components/settings.js index 165bbc6c476..9601d80de79 100644 --- a/src/app/components/settings.js +++ b/src/app/components/settings.js @@ -14,6 +14,7 @@ function (_, crypto) { */ var defaults = { datasources : {}, + title : 'Grafana - ', panels : ['graph', 'text'], plugins : {}, default_route : '/dashboard/file/default.json', diff --git a/src/app/controllers/dash.js b/src/app/controllers/dash.js index e40db93fd7e..55f19905192 100644 --- a/src/app/controllers/dash.js +++ b/src/app/controllers/dash.js @@ -40,7 +40,7 @@ function (angular, $, config, _) { $scope.panelMoveOver = panelMove.onOver; $scope.panelMoveOut = panelMove.onOut; - window.document.title = 'Grafana - ' + $scope.dashboard.title; + window.document.title = (config.title ? config.title : '') + $scope.dashboard.title; // start auto refresh if($scope.dashboard.refresh) { diff --git a/src/config.sample.js b/src/config.sample.js index 9bce1540fa4..4bc6864e442 100644 --- a/src/config.sample.js +++ b/src/config.sample.js @@ -73,6 +73,17 @@ function (Settings) { * ======================================================== */ + /* title: + * The global page title prefix that is prepended before the specific dashboard titles. + * Defaults to 'Grafana - '. + * + * title: undefined, // default prefix, page title = 'Grafana - ' + * title: null, // no prefix, page title = + * title: '', // no prefix, page title = + * title: 'Custom | ', // custom prefix, page title = 'Custom | ' + */ + title: undefined, + // specify the limit for dashboard search results search: { max_results: 20 From 6f80862517c0db225b720a4d1299885bc49150a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Sun, 24 Aug 2014 14:45:00 +0200 Subject: [PATCH 2/2] Dashboard: new config.js option to change/remove window title prefix from 'Grafana -' to anything, PR #685 --- CHANGELOG.md | 1 + src/app/components/settings.js | 2 +- src/app/controllers/dashboardCtrl.js | 2 +- src/config.sample.js | 16 ++++------------ 4 files changed, 7 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 61b7aea105e..c1b37967ff0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - [Issue #709](https://github.com/grafana/grafana/issues/709). Dashboard: Small UI look polish to search results, made dashboard title link are larger - [Issue #425](https://github.com/grafana/grafana/issues/425). Graph: New section in 'Display Styles' tab to override any display setting on per series bases (mix and match lines, bars, points, fill, stack, line width etc) - [Issue #634](https://github.com/grafana/grafana/issues/634). Dashboard: Dashboard tags now in different colors (from fixed palette) determined by tag name. +- [Issue #685](https://github.com/grafana/grafana/issues/685). Dashboard: New config.js option to change/remove window title prefix. **Fixes** - [Issue #696](https://github.com/grafana/grafana/issues/696). Graph: Fix for y-axis format 'none' when values are in scientific notation (ex 2.3e-13) diff --git a/src/app/components/settings.js b/src/app/components/settings.js index fff5d9dd4a4..6afba222b4b 100644 --- a/src/app/components/settings.js +++ b/src/app/components/settings.js @@ -14,7 +14,7 @@ function (_, crypto) { */ var defaults = { datasources : {}, - title : 'Grafana - ', + window_title_prefix : 'Grafana - ', panels : ['graph', 'text'], plugins : {}, default_route : '/dashboard/file/default.json', diff --git a/src/app/controllers/dashboardCtrl.js b/src/app/controllers/dashboardCtrl.js index 33a190273d7..694fe59a319 100644 --- a/src/app/controllers/dashboardCtrl.js +++ b/src/app/controllers/dashboardCtrl.js @@ -56,7 +56,7 @@ function (angular, $, config, _) { $scope.panelMoveOver = panelMove.onOver; $scope.panelMoveOut = panelMove.onOut; - window.document.title = (config.title ? config.title : '') + $scope.dashboard.title; + window.document.title = config.window_title_prefix + $scope.dashboard.title; // start auto refresh if($scope.dashboard.refresh) { diff --git a/src/config.sample.js b/src/config.sample.js index aa7341085d7..6046a753d5a 100644 --- a/src/config.sample.js +++ b/src/config.sample.js @@ -73,23 +73,12 @@ function (Settings) { * ======================================================== */ - /* title: - * The global page title prefix that is prepended before the specific dashboard titles. - * Defaults to 'Grafana - '. - * - * title: undefined, // default prefix, page title = 'Grafana - ' - * title: null, // no prefix, page title = - * title: '', // no prefix, page title = - * title: 'Custom | ', // custom prefix, page title = 'Custom | ' - */ - title: undefined, - // specify the limit for dashboard search results search: { max_results: 20 }, - // default start dashboard + // default home dashboard default_route: '/dashboard/file/default.json', // set to false to disable unsaved changes warning @@ -105,6 +94,9 @@ function (Settings) { password: '' }, + // Change window title prefix from 'Grafana - ' + window_title_prefix: 'Grafana - ', + // Add your own custom pannels plugins: { // list of plugin panels