From 8987cfe0a21b99751a2fe14eec76c89dcaca748b Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Sat, 21 May 2016 17:56:57 +0900 Subject: [PATCH 001/175] (templating) add sort order option --- public/app/features/templating/editorCtrl.js | 7 ++++ .../features/templating/partials/editor.html | 11 ++++++ .../features/templating/templateValuesSrv.js | 20 ++++++++-- public/test/specs/templateValuesSrv-specs.js | 38 +++++++++++++++++++ 4 files changed, 73 insertions(+), 3 deletions(-) diff --git a/public/app/features/templating/editorCtrl.js b/public/app/features/templating/editorCtrl.js index 5efebc21e30..a8181ee1db3 100644 --- a/public/app/features/templating/editorCtrl.js +++ b/public/app/features/templating/editorCtrl.js @@ -13,6 +13,7 @@ function (angular, _) { type: 'query', datasource: null, refresh: 0, + sort: 1, name: '', hide: 0, options: [], @@ -34,6 +35,12 @@ function (angular, _) { {value: 2, text: "On Time Range Change"}, ]; + $scope.sortOptions = [ + {value: 0, text: "Without Sort"}, + {value: 1, text: "Alphabetical"}, + {value: 2, text: "Numerical"}, + ]; + $scope.hideOptions = [ {value: 0, text: ""}, {value: 1, text: "Label"}, diff --git a/public/app/features/templating/partials/editor.html b/public/app/features/templating/partials/editor.html index dd5aa6fa543..b55959bad93 100644 --- a/public/app/features/templating/partials/editor.html +++ b/public/app/features/templating/partials/editor.html @@ -181,6 +181,17 @@ +
+ + Sort + + How to sort the values of this variable. + + +
+ +
+
Query diff --git a/public/app/features/templating/templateValuesSrv.js b/public/app/features/templating/templateValuesSrv.js index fb751a2ce3a..896c152ce35 100644 --- a/public/app/features/templating/templateValuesSrv.js +++ b/public/app/features/templating/templateValuesSrv.js @@ -327,7 +327,7 @@ function (angular, _, kbn) { this.metricNamesToVariableValues = function(variable, metricNames) { var regex, options, i, matches; - options = {}; // use object hash to remove duplicates + options = []; if (variable.regex) { regex = kbn.stringToJsRegex(templateSrv.replace(variable.regex)); @@ -355,10 +355,24 @@ function (angular, _, kbn) { } } - options[value] = {text: text, value: value}; + options.push({text: text, value: value}); } + options = _.uniq(options, 'value'); - return _.sortBy(options, 'text'); + if (variable.sort === 1) { + return _.sortBy(options, 'text'); + } else if (variable.sort === 2) { + return _.sortBy(options, function(opt) { + var matches = opt.text.match(/.*?(\d+).*/); + if (!matches) { + return 0; + } else { + return parseInt(matches[1], 10); + } + }); + } else { + return options; + } }; this.addAllOption = function(variable) { diff --git a/public/test/specs/templateValuesSrv-specs.js b/public/test/specs/templateValuesSrv-specs.js index 7a8d8c1fccb..df59b798f3d 100644 --- a/public/test/specs/templateValuesSrv-specs.js +++ b/public/test/specs/templateValuesSrv-specs.js @@ -386,5 +386,43 @@ define([ }); }); + describeUpdateVariable('without sort', function(scenario) { + scenario.setup(function() { + scenario.variable = {type: 'query', query: 'apps.*', name: 'test', sort: 0}; + scenario.queryResult = [{text: 'bbb2'}, {text: 'aaa10'}, { text: 'ccc3'}]; + }); + + it('should return options without sort', function() { + expect(scenario.variable.options[0].text).to.be('bbb2'); + expect(scenario.variable.options[1].text).to.be('aaa10'); + expect(scenario.variable.options[2].text).to.be('ccc3'); + }); + }); + + describeUpdateVariable('with alphabetical sort', function(scenario) { + scenario.setup(function() { + scenario.variable = {type: 'query', query: 'apps.*', name: 'test', sort: 1}; + scenario.queryResult = [{text: 'bbb2'}, {text: 'aaa10'}, { text: 'ccc3'}]; + }); + + it('should return options with alphabetical sort', function() { + expect(scenario.variable.options[0].text).to.be('aaa10'); + expect(scenario.variable.options[1].text).to.be('bbb2'); + expect(scenario.variable.options[2].text).to.be('ccc3'); + }); + }); + + describeUpdateVariable('with numerical sort', function(scenario) { + scenario.setup(function() { + scenario.variable = {type: 'query', query: 'apps.*', name: 'test', sort: 2}; + scenario.queryResult = [{text: 'bbb2'}, {text: 'aaa10'}, { text: 'ccc3'}]; + }); + + it('should return options with numerical sort', function() { + expect(scenario.variable.options[0].text).to.be('bbb2'); + expect(scenario.variable.options[1].text).to.be('ccc3'); + expect(scenario.variable.options[2].text).to.be('aaa10'); + }); + }); }); }); From 16dc095329da44a96a9d344f7faba22ccb1edc5d Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Sat, 18 Jun 2016 02:08:24 +0900 Subject: [PATCH 002/175] (templating) support asc/desc sort --- public/app/features/templating/editorCtrl.js | 6 ++-- .../features/templating/templateValuesSrv.js | 31 ++++++++++++------- public/test/specs/templateValuesSrv-specs.js | 30 ++++++++++++++++-- 3 files changed, 52 insertions(+), 15 deletions(-) diff --git a/public/app/features/templating/editorCtrl.js b/public/app/features/templating/editorCtrl.js index a8181ee1db3..5c923271278 100644 --- a/public/app/features/templating/editorCtrl.js +++ b/public/app/features/templating/editorCtrl.js @@ -37,8 +37,10 @@ function (angular, _) { $scope.sortOptions = [ {value: 0, text: "Without Sort"}, - {value: 1, text: "Alphabetical"}, - {value: 2, text: "Numerical"}, + {value: 1, text: "Alphabetical (asc)"}, + {value: 2, text: "Alphabetical (desc)"}, + {value: 3, text: "Numerical (asc)"}, + {value: 4, text: "Numerical (desc)"}, ]; $scope.hideOptions = [ diff --git a/public/app/features/templating/templateValuesSrv.js b/public/app/features/templating/templateValuesSrv.js index 896c152ce35..38f305f3f40 100644 --- a/public/app/features/templating/templateValuesSrv.js +++ b/public/app/features/templating/templateValuesSrv.js @@ -359,18 +359,27 @@ function (angular, _, kbn) { } options = _.uniq(options, 'value'); - if (variable.sort === 1) { - return _.sortBy(options, 'text'); - } else if (variable.sort === 2) { - return _.sortBy(options, function(opt) { - var matches = opt.text.match(/.*?(\d+).*/); - if (!matches) { - return 0; - } else { - return parseInt(matches[1], 10); - } - }); + var sortType = Math.ceil(variable.sort / 2); + if (sortType === 0) { + return options; } else { + if (sortType === 1) { + options = _.sortBy(options, 'text'); + } else if (sortType === 2) { + options = _.sortBy(options, function(opt) { + var matches = opt.text.match(/.*?(\d+).*/); + if (!matches) { + return 0; + } else { + return parseInt(matches[1], 10); + } + }); + } + + if (variable.sort % 2 === 0) { + options = options.reverse(); + } + return options; } }; diff --git a/public/test/specs/templateValuesSrv-specs.js b/public/test/specs/templateValuesSrv-specs.js index df59b798f3d..1742f5739c3 100644 --- a/public/test/specs/templateValuesSrv-specs.js +++ b/public/test/specs/templateValuesSrv-specs.js @@ -399,7 +399,7 @@ define([ }); }); - describeUpdateVariable('with alphabetical sort', function(scenario) { + describeUpdateVariable('with alphabetical sort (asc)', function(scenario) { scenario.setup(function() { scenario.variable = {type: 'query', query: 'apps.*', name: 'test', sort: 1}; scenario.queryResult = [{text: 'bbb2'}, {text: 'aaa10'}, { text: 'ccc3'}]; @@ -412,17 +412,43 @@ define([ }); }); - describeUpdateVariable('with numerical sort', function(scenario) { + describeUpdateVariable('with alphabetical sort (desc)', function(scenario) { scenario.setup(function() { scenario.variable = {type: 'query', query: 'apps.*', name: 'test', sort: 2}; scenario.queryResult = [{text: 'bbb2'}, {text: 'aaa10'}, { text: 'ccc3'}]; }); + it('should return options with alphabetical sort', function() { + expect(scenario.variable.options[0].text).to.be('ccc3'); + expect(scenario.variable.options[1].text).to.be('bbb2'); + expect(scenario.variable.options[2].text).to.be('aaa10'); + }); + }); + + describeUpdateVariable('with numerical sort (asc)', function(scenario) { + scenario.setup(function() { + scenario.variable = {type: 'query', query: 'apps.*', name: 'test', sort: 3}; + scenario.queryResult = [{text: 'bbb2'}, {text: 'aaa10'}, { text: 'ccc3'}]; + }); + it('should return options with numerical sort', function() { expect(scenario.variable.options[0].text).to.be('bbb2'); expect(scenario.variable.options[1].text).to.be('ccc3'); expect(scenario.variable.options[2].text).to.be('aaa10'); }); }); + + describeUpdateVariable('with numerical sort (desc)', function(scenario) { + scenario.setup(function() { + scenario.variable = {type: 'query', query: 'apps.*', name: 'test', sort: 4}; + scenario.queryResult = [{text: 'bbb2'}, {text: 'aaa10'}, { text: 'ccc3'}]; + }); + + it('should return options with numerical sort', function() { + expect(scenario.variable.options[0].text).to.be('aaa10'); + expect(scenario.variable.options[1].text).to.be('ccc3'); + expect(scenario.variable.options[2].text).to.be('bbb2'); + }); + }); }); }); From 8af3bb739c1050656e853eedc4d9aa12bacd86e8 Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Sun, 26 Jun 2016 22:15:57 +0900 Subject: [PATCH 003/175] refactor --- .../features/templating/templateValuesSrv.js | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/public/app/features/templating/templateValuesSrv.js b/public/app/features/templating/templateValuesSrv.js index 38f305f3f40..cd74c2b665f 100644 --- a/public/app/features/templating/templateValuesSrv.js +++ b/public/app/features/templating/templateValuesSrv.js @@ -359,29 +359,29 @@ function (angular, _, kbn) { } options = _.uniq(options, 'value'); - var sortType = Math.ceil(variable.sort / 2); - if (sortType === 0) { - return options; - } else { - if (sortType === 1) { - options = _.sortBy(options, 'text'); - } else if (sortType === 2) { - options = _.sortBy(options, function(opt) { - var matches = opt.text.match(/.*?(\d+).*/); - if (!matches) { - return 0; - } else { - return parseInt(matches[1], 10); - } - }); - } - - if (variable.sort % 2 === 0) { - options = options.reverse(); - } - + if (variable.sort === 0) { return options; } + + var sortType = Math.ceil(variable.sort / 2); + var reverseSort = (variable.sort % 2 === 0); + if (sortType === 1) { + options = _.sortBy(options, 'text'); + } else if (sortType === 2) { + options = _.sortBy(options, function(opt) { + var matches = opt.text.match(/.*?(\d+).*/); + if (!matches) { + return 0; + } else { + return parseInt(matches[1], 10); + } + }); + } + if (reverseSort) { + options = options.reverse(); + } + + return options; }; this.addAllOption = function(variable) { From b4646b6c3a4256a17cab41dacc496d9c885a2544 Mon Sep 17 00:00:00 2001 From: Kevin Fitzpatrick Date: Tue, 12 Apr 2016 17:54:45 -0700 Subject: [PATCH 004/175] Allow users to use a generic oauth that conforms to the github style. Enables users to set their own link text. --- pkg/api/login.go | 2 ++ pkg/setting/setting_oauth.go | 5 +++-- pkg/social/social.go | 18 +++++++++++++++++- public/app/core/controllers/login_ctrl.js | 4 +++- public/app/partials/login.html | 4 ++++ 5 files changed, 29 insertions(+), 4 deletions(-) diff --git a/pkg/api/login.go b/pkg/api/login.go index 4f976f753a2..789765ee01e 100644 --- a/pkg/api/login.go +++ b/pkg/api/login.go @@ -27,6 +27,8 @@ func LoginView(c *middleware.Context) { viewData.Settings["googleAuthEnabled"] = setting.OAuthService.Google viewData.Settings["githubAuthEnabled"] = setting.OAuthService.GitHub + viewData.Settings["genericOAuthEnabled"] = setting.OAuthService.Generic + viewData.Settings["oauthProviderName"] = setting.OAuthService.OAuthProviderName viewData.Settings["disableUserSignUp"] = !setting.AllowUserSignUp viewData.Settings["loginHint"] = setting.LoginHint viewData.Settings["allowUserPassLogin"] = setting.AllowUserPassLogin diff --git a/pkg/setting/setting_oauth.go b/pkg/setting/setting_oauth.go index db2f0fb3802..71c4ade1468 100644 --- a/pkg/setting/setting_oauth.go +++ b/pkg/setting/setting_oauth.go @@ -11,8 +11,9 @@ type OAuthInfo struct { } type OAuther struct { - GitHub, Google, Twitter bool - OAuthInfos map[string]*OAuthInfo + GitHub, Google, Twitter, Generic bool + OAuthInfos map[string]*OAuthInfo + OAuthProviderName string } var OAuthService *OAuther diff --git a/pkg/social/social.go b/pkg/social/social.go index 4a8cb8bac5d..402f02449ff 100644 --- a/pkg/social/social.go +++ b/pkg/social/social.go @@ -42,7 +42,7 @@ func NewOAuthService() { setting.OAuthService = &setting.OAuther{} setting.OAuthService.OAuthInfos = make(map[string]*setting.OAuthInfo) - allOauthes := []string{"github", "google"} + allOauthes := []string{"github", "google", "generic-oauth"} for _, name := range allOauthes { sec := setting.Cfg.Section("auth." + name) @@ -98,6 +98,22 @@ func NewOAuthService() { allowSignup: info.AllowSignup, } } + + // Generic - Uses the same scheme as Github. + if name == "generic-oauth" { + setting.OAuthService.Generic = true + setting.OAuthService.OAuthProviderName = sec.Key("oauth_provider_name").String() + teamIds := sec.Key("team_ids").Ints(",") + allowedOrganizations := sec.Key("allowed_organizations").Strings(" ") + SocialMap["generic-oauth"] = &SocialGithub{ + Config: &config, + allowedDomains: info.AllowedDomains, + apiUrl: info.ApiUrl, + allowSignup: info.AllowSignup, + teamIds: teamIds, + allowedOrganizations: allowedOrganizations, + } + } } } diff --git a/public/app/core/controllers/login_ctrl.js b/public/app/core/controllers/login_ctrl.js index 8696d94f4f3..60136a05c0c 100644 --- a/public/app/core/controllers/login_ctrl.js +++ b/public/app/core/controllers/login_ctrl.js @@ -17,8 +17,10 @@ function (angular, coreModule, config) { $scope.googleAuthEnabled = config.googleAuthEnabled; $scope.githubAuthEnabled = config.githubAuthEnabled; - $scope.oauthEnabled = config.githubAuthEnabled || config.googleAuthEnabled; + $scope.oauthEnabled = config.githubAuthEnabled || config.googleAuthEnabled || config.genericOAuthEnabled; $scope.allowUserPassLogin = config.allowUserPassLogin; + $scope.genericOAuthEnabled = config.genericOAuthEnabled; + $scope.oauthProviderName = config.oauthProviderName; $scope.disableUserSignUp = config.disableUserSignUp; $scope.loginHint = config.loginHint; diff --git a/public/app/partials/login.html b/public/app/partials/login.html index 5bee63e6214..200200ee4b9 100644 --- a/public/app/partials/login.html +++ b/public/app/partials/login.html @@ -59,6 +59,10 @@ with Github + + + with {{oauthProviderName || "OAuth 2"}} +
From f2baa5b210b2000509bbb2aa319a6bedf238903f Mon Sep 17 00:00:00 2001 From: Kevin Fitzpatrick Date: Wed, 18 May 2016 13:37:04 -0700 Subject: [PATCH 005/175] Make Generic OAuth Configs ENV VARS-friendly Use underscores instead of dashes. --- pkg/social/social.go | 6 +++--- public/app/partials/login.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/social/social.go b/pkg/social/social.go index 402f02449ff..3c970f89e4f 100644 --- a/pkg/social/social.go +++ b/pkg/social/social.go @@ -42,7 +42,7 @@ func NewOAuthService() { setting.OAuthService = &setting.OAuther{} setting.OAuthService.OAuthInfos = make(map[string]*setting.OAuthInfo) - allOauthes := []string{"github", "google", "generic-oauth"} + allOauthes := []string{"github", "google", "generic_oauth"} for _, name := range allOauthes { sec := setting.Cfg.Section("auth." + name) @@ -100,12 +100,12 @@ func NewOAuthService() { } // Generic - Uses the same scheme as Github. - if name == "generic-oauth" { + if name == "generic_oauth" { setting.OAuthService.Generic = true setting.OAuthService.OAuthProviderName = sec.Key("oauth_provider_name").String() teamIds := sec.Key("team_ids").Ints(",") allowedOrganizations := sec.Key("allowed_organizations").Strings(" ") - SocialMap["generic-oauth"] = &SocialGithub{ + SocialMap["generic_oauth"] = &SocialGithub{ Config: &config, allowedDomains: info.AllowedDomains, apiUrl: info.ApiUrl, diff --git a/public/app/partials/login.html b/public/app/partials/login.html index 200200ee4b9..f4f5fb26d7e 100644 --- a/public/app/partials/login.html +++ b/public/app/partials/login.html @@ -59,7 +59,7 @@ with Github - + with {{oauthProviderName || "OAuth 2"}} From 35b90afdd03e44c299010e6da1ac4497624b92dc Mon Sep 17 00:00:00 2001 From: Trent White Date: Wed, 24 Aug 2016 17:41:29 -0400 Subject: [PATCH 006/175] initial styling --- conf/defaults.ini | 2 +- emails/assets/css/ink.css | 2 + emails/assets/css/style.css | 8 +- emails/templates/alert_notification.html | 4 +- emails/templates/layouts/default.html | 238 +++++++++++++----- public/emails/alert_notification.html | 306 ++++++++++++++++------- public/emails/invited_to_org.html | 270 ++++++++++++++------ public/emails/new_user_invite.html | 274 ++++++++++++++------ public/emails/reset_password.html | 264 +++++++++++++------ public/emails/signup_started.html | 268 ++++++++++++++------ public/emails/welcome_on_signup.html | 260 +++++++++++++------ 11 files changed, 1366 insertions(+), 530 deletions(-) diff --git a/conf/defaults.ini b/conf/defaults.ini index 2219b56a77d..6f3fede698a 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -372,7 +372,7 @@ global_session = -1 # \______(_______;;;)__;;;) [alerting] -enabled = false +enabled = true #################################### Internal Grafana Metrics ########################## # Metrics available at HTTP API Url /api/metrics diff --git a/emails/assets/css/ink.css b/emails/assets/css/ink.css index e65aed19194..926db026ea6 100644 --- a/emails/assets/css/ink.css +++ b/emails/assets/css/ink.css @@ -17,6 +17,8 @@ body{ padding:0; } + + .ExternalClass { width:100%; } diff --git a/emails/assets/css/style.css b/emails/assets/css/style.css index f138a0c1296..63c7aaa5b3b 100644 --- a/emails/assets/css/style.css +++ b/emails/assets/css/style.css @@ -9,7 +9,8 @@ h1 {font-size: 40px;} h2 {font-size: 36px;} h3 { font-size: 22px; - margin-top: 20px; + margin-top: 10px; + margin-bottom: 10px; } h4 {font-size: 20px;} h5 {font-size: 18px;} @@ -79,10 +80,13 @@ table.google-plus:hover td { } .header { - background: #333; +margin-top:25px; +margin-bottom: 25px; } .footer { + background-color: #2e2e2e; + color: #999999; margin-top: 20px; } diff --git a/emails/templates/alert_notification.html b/emails/templates/alert_notification.html index 5adcda1a620..2f64854ce4e 100644 --- a/emails/templates/alert_notification.html +++ b/emails/templates/alert_notification.html @@ -6,7 +6,7 @@
-

[[.Title]]

+

[[.Title]]

@@ -42,7 +42,7 @@ Value - [[range .EvalMatches]] + [[range .EvalMatches]] dwds [[.Metric]] diff --git a/emails/templates/layouts/default.html b/emails/templates/layouts/default.html index 0fd5b35ea48..eb968ed7cbc 100644 --- a/emails/templates/layouts/default.html +++ b/emails/templates/layouts/default.html @@ -3,77 +3,199 @@ - - - - + + + + - + + -
-
- - - - - -
-
- - - - - -
- - - - - - -
- -
- -
- -
-
- - +
+ +
- + +
- {{> body }} - - - - - - + +
+ + + + +
+ + + + + + +
+ +
+ +
+ +
+
+ + + + + + + - +
+ {{> body }}
+ + + + +
diff --git a/public/emails/alert_notification.html b/public/emails/alert_notification.html index f80a8330eaf..a292fb45af9 100644 --- a/public/emails/alert_notification.html +++ b/public/emails/alert_notification.html @@ -3,9 +3,9 @@ - + - - - -
-
+ + + +
+
+ + + + - -
+
- - - + +
-
+ + + - -
- - - + +
+ + + + + +
+ +
- - - - - -
- -
+
-
+
+
-
-
- - - -
+ + + + + +
{{Subject .Subject "{{.Title}}"}} - - -
- - -
-

{{.Title}}

+ + +
+ + +
+

{{.Title}}

@@ -129,13 +249,13 @@ color: #FFFFFF !important;
- - -
- - -
-

{{.Message}}

+ + +
+ + +
+

{{.Message}}

@@ -144,25 +264,25 @@ color: #FFFFFF !important;
{{if ne .State "ok" }} - - -
-
- - -
+ + +
+
+ + + - - {{range .EvalMatches}} - - + - @@ -174,13 +294,13 @@ color: #FFFFFF !important;
Metric name + Value
+ {{range .EvalMatches}} dwds +
{{.Metric}} + {{.Value}}
{{end}} - - -
- - -
- + + +
+ + +
+
@@ -189,13 +309,13 @@ color: #FFFFFF !important;
- - -
- - - -
- Alert rule - Alerts page + + + - +
+ + +
+ Alert rule - Alerts page
@@ -206,34 +326,32 @@ color: #FFFFFF !important; - - - - - - -
+ + + + +
diff --git a/public/emails/invited_to_org.html b/public/emails/invited_to_org.html index 8263fb65a15..ac80a3983ae 100644 --- a/public/emails/invited_to_org.html +++ b/public/emails/invited_to_org.html @@ -3,9 +3,9 @@ - + - - - -
-
+ + + +
+
+ + + + - -
+
- - - + +
-
+ + + - -
- - - + +
+ + + + + +
+ +
- - - - - -
- -
+
-
+
+
-
-
- - - -
+ + + + + +
{{Subject .Subject "{{.InvitedBy}} has added you to the {{.OrgName}} organization"}} - - -
+ + +
- - -
-

You have been added to {{.OrgName}}

+ + + - +
+

You have been added to {{.OrgName}}

@@ -134,22 +254,22 @@ color: #FFFFFF !important;
- - -
- - -
-

{{.InvitedBy}} has added you to the {{.OrgName}} organization in Grafana. -

Once logged in, {{.OrgName}} will be available in the left side menu, in the dropdown below your username.

+ + + -
+ + + - + - - - +
+

{{.InvitedBy}} has added you to the {{.OrgName}} organization in Grafana. +

Once logged in, {{.OrgName}} will be available in the left side menu, in the dropdown below your username.

- - - + + @@ -162,34 +282,32 @@ color: #FFFFFF !important; -
Log in now
+ + +
Log in now
- - - - - -
+ + + + +
diff --git a/public/emails/new_user_invite.html b/public/emails/new_user_invite.html index 15de19a7bf6..3bd942ac051 100644 --- a/public/emails/new_user_invite.html +++ b/public/emails/new_user_invite.html @@ -3,9 +3,9 @@ - + - - - -
-
+ + + +
+
+ + + + - -
+
- - - + +
-
+ + + - -
- - - + +
+ + + + + +
+ +
- - - - - -
- -
+
-
+
+
-
-
- - - -
+ + + + + +
{{Subject .Subject "{{.InvitedBy}} has invited you to join Grafana"}} - - -
+ + +
- - -
-

You're invited to join {{.OrgName}}

+ + + - +
+

You're invited to join {{.OrgName}}

@@ -134,63 +254,61 @@ color: #FFFFFF !important;
- - -
- - - -
-

You've been invited to join the {{.OrgName}} organization by {{.InvitedBy}}. To accept your invitation and join the team, please click the link below:

+ + + - +
+ + + - -
+

You've been invited to join the {{.OrgName}} organization by {{.InvitedBy}}. To accept your invitation and join the team, please click the link below:

- - - + + - - + - +
Accept Invitation
+ + +
Accept Invitation
-

You can also copy/paste this link into your browser directly: {{.LinkUrl}}

+
+

You can also copy/paste this link into your browser directly: {{.LinkUrl}}

- - - - - - -
+ + + + +
diff --git a/public/emails/reset_password.html b/public/emails/reset_password.html index 46947a74c30..e32821d6c57 100644 --- a/public/emails/reset_password.html +++ b/public/emails/reset_password.html @@ -3,9 +3,9 @@ - + - - - -
-
+ + + +
+
+ + + + - -
+
- - - + +
-
+ + + - -
- - - + +
+ + + + + +
+ +
- - - - - -
- -
+
-
+
+
-
-
- - - -
+ + + + + +
{{Subject .Subject "Reset your Grafana password - {{.Name}}"}} - - -
+ + +
- - -
-

Hi {{.Name}}

+ + + - +
+

Hi {{.Name}}

@@ -132,21 +252,21 @@ color: #FFFFFF !important;
- - -
- - - -
-

+ + + - +
+ + + - +
+

Please click the following link to reset your password within {{.EmailCodeValidHours}} hours.

-

- {{.AppUrl}}user/password/reset?code={{.Code}} +

+ {{.AppUrl}}user/password/reset?code={{.Code}}

-

Not working? Try copying and pasting it to your browser.

+

Not working? Try copying and pasting it to your browser.

@@ -157,34 +277,32 @@ color: #FFFFFF !important; - - - - - - -
+ + + + +

diff --git a/public/emails/signup_started.html b/public/emails/signup_started.html index a8ee02174a8..1dad4fd4e04 100644 --- a/public/emails/signup_started.html +++ b/public/emails/signup_started.html @@ -3,9 +3,9 @@ - + - - - -
-
+ + + +
+
+ + + + - -
+
- - - + +
-
+ + + - -
- - - + +
+ + + + + +
+ +
- - - - - -
- -
+
-
+
+
-
-
- - - -
+ + + + + +
{{Subject .Subject "Welcome to Grafana, please complete your sign up!"}} - - -
+ + +
- - -
-

Complete the signup

+ + + - +
+

Complete the signup

@@ -132,23 +252,23 @@ color: #FFFFFF !important;
- - -
- - -
+ + + -
+ + + - + - - - +
Copy and past the email verification code:
- {{.Code}}
in + {{.Code}}
in the sign up form or use the link below.
- - - + + @@ -161,34 +281,32 @@ color: #FFFFFF !important; -
Complete Sign Up
+ + +
Complete Sign Up
- - - - - -
+ + + + +
diff --git a/public/emails/welcome_on_signup.html b/public/emails/welcome_on_signup.html index f2f931689c1..265281b7eb1 100644 --- a/public/emails/welcome_on_signup.html +++ b/public/emails/welcome_on_signup.html @@ -3,9 +3,9 @@ - + - - - -
-
+ + + +
+
+ + + + - -
+
- - - + +
-
+ + + - -
- - - + +
+ + + + + +
+ +
- - - - - -
- -
+
-
+
+
-
-
- - - -
+ + + + + +
{{Subject .Subject "Welcome to Grafana"}} - - -
+ + +
- - -
-

Hi {{.Name}}

+ + + - +
+

Hi {{.Name}}

@@ -132,17 +252,17 @@ color: #FFFFFF !important;
- - - -
- - - - +
-

- If you are new to Grafana please read the Getting Started guide. + + + @@ -152,34 +272,32 @@ color: #FFFFFF !important; -
+ + + - +
+

+ If you are new to Grafana please read the Getting Started guide.

- - - - - -

+ + + + +
From ab4f06bc5403752e4fb6c5ecf42e1ccb24a3d241 Mon Sep 17 00:00:00 2001 From: Trent White Date: Fri, 26 Aug 2016 14:25:39 -0400 Subject: [PATCH 007/175] redesign email template --- emails/assets/css/style.css | 43 +++ emails/templates/alert_notification.html | 41 +- .../templates/alert_notification_example.html | 115 ++++++ emails/templates/invited_to_org.html | 4 +- emails/templates/layouts/default.html | 65 +--- emails/templates/new_user_invite.html | 4 +- emails/templates/reset_password.html | 4 +- emails/templates/signup_started.html | 2 +- emails/templates/welcome_on_signup.html | 14 +- public/emails/alert_notification.html | 110 +++--- public/emails/alert_notification_example.html | 359 ++++++++++++++++++ public/emails/invited_to_org.html | 73 ++-- public/emails/new_user_invite.html | 73 ++-- public/emails/reset_password.html | 73 ++-- public/emails/signup_started.html | 71 ++-- public/emails/welcome_on_signup.html | 83 ++-- 16 files changed, 770 insertions(+), 364 deletions(-) create mode 100644 emails/templates/alert_notification_example.html create mode 100644 public/emails/alert_notification_example.html diff --git a/emails/assets/css/style.css b/emails/assets/css/style.css index 63c7aaa5b3b..6f46d36581d 100644 --- a/emails/assets/css/style.css +++ b/emails/assets/css/style.css @@ -84,6 +84,10 @@ margin-top:25px; margin-bottom: 25px; } +.data { + font-size: 16px; +} + .footer { background-color: #2e2e2e; color: #999999; @@ -138,6 +142,45 @@ table.columns td.better-button { color: #FFFFFF !important; } +table.better-button-alt { + margin-top: 10px; + margin-bottom: 20px; +} + +table.columns td.better-button-alt { + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + padding-bottom: 0px; +} + +.better-button-alt a { + text-decoration: none; + -webkit-border-radius: 2px; + -moz-border-radius: 2px; + border-radius: 2px; + + padding: 12px 25px; + border: 1px solid #ff8f2b; + background-color: #EFEFEF; + display: inline-block; + color: #ff8f2b; +} + +.better-button-alt:hover a { + color: #ff8f2b !important; + background-color: #DDDDDD; + border: 1px solid #F2821E; +} + +.better-button-alt:visited a { + color: #ff8f2b !important; +} + +.better-button-alt:active a { + color: #ff8f2b !important; +} + .verification-code { background-color: #EEEEEE; padding: 3px; diff --git a/emails/templates/alert_notification.html b/emails/templates/alert_notification.html index 2f64854ce4e..4c7eed1d5d9 100644 --- a/emails/templates/alert_notification.html +++ b/emails/templates/alert_notification.html @@ -16,7 +16,7 @@ -
+
@@ -31,24 +31,24 @@ [[if ne .State "ok" ]] -
+
- - - [[range .EvalMatches]] dwds + [[range .EvalMatches]] - - [[end]] @@ -79,8 +79,23 @@
- Metric name + +
Metric name
- Value + +
Value
- [[.Metric]] + +
[[.Metric]]
- [[.Value]] + +
[[.Value]]
- +
- Alert rule - Alerts page + + + + + +
+ View your Alert rule +
+
+ + + + +
+ Go to the Alerts page +
diff --git a/emails/templates/alert_notification_example.html b/emails/templates/alert_notification_example.html new file mode 100644 index 00000000000..7b618130e57 --- /dev/null +++ b/emails/templates/alert_notification_example.html @@ -0,0 +1,115 @@ + + + + +
+ + + + +
+

[CRITICAL] Imaginary timeserie alert

+
+
+ + + + + +
+ + + + +
+

Alert message that will support markdown in some distant future.

+
+
+ + + + + + +
+
+ + + + + + + + + + + + + + + + + +
+ Metric name + + Value +
+ desktop + + 40 +
+ mobile + + 20 +
+
+
+ + + + + + +
+ + + + +
+ +
+
+ + + + + + +
+ + + + + +
+ + + + +
+ View your Alert rule +
+
+ + + + +
+ Go to the Alerts page +
+
+
+ + + \ No newline at end of file diff --git a/emails/templates/invited_to_org.html b/emails/templates/invited_to_org.html index 59e76cd5a77..681830604b9 100644 --- a/emails/templates/invited_to_org.html +++ b/emails/templates/invited_to_org.html @@ -9,7 +9,7 @@ @@ -25,7 +25,7 @@
-

You have been added to [[.OrgName]]

+

You have been added to [[.OrgName]]

diff --git a/emails/templates/layouts/default.html b/emails/templates/layouts/default.html index eb968ed7cbc..6dece2f29c3 100644 --- a/emails/templates/layouts/default.html +++ b/emails/templates/layouts/default.html @@ -10,25 +10,25 @@ @@ -174,14 +135,14 @@ td[class="stack-column-center"] {
-

[[.InvitedBy]] has added you to the [[.OrgName]] organization in Grafana. +

[[.InvitedBy]] has added you to the [[.OrgName]] organization in Grafana.

Once logged in, [[.OrgName]] will be available in the left side menu, in the dropdown below your username.

- +