From 8ef3aebc29e2ae41200312761924612c41bc8f66 Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Wed, 27 Feb 2019 00:20:29 -0800 Subject: [PATCH 01/14] Fixed alias in Cloudwatch Expressions --- pkg/tsdb/cloudwatch/cloudwatch.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/tsdb/cloudwatch/cloudwatch.go b/pkg/tsdb/cloudwatch/cloudwatch.go index 278025db75a..bfd9f85dbf9 100644 --- a/pkg/tsdb/cloudwatch/cloudwatch.go +++ b/pkg/tsdb/cloudwatch/cloudwatch.go @@ -496,9 +496,9 @@ func parseQuery(model *simplejson.Json) (*CloudWatchQuery, error) { } alias := model.Get("alias").MustString() - if alias == "" { + /*if alias == "" { alias = "{{metric}}_{{stat}}" - } + }*/ returnData := model.Get("returnData").MustBool(false) highResolution := model.Get("highResolution").MustBool(false) @@ -521,7 +521,11 @@ func parseQuery(model *simplejson.Json) (*CloudWatchQuery, error) { func formatAlias(query *CloudWatchQuery, stat string, dimensions map[string]string) string { if len(query.Id) > 0 && len(query.Expression) > 0 { - return query.Id + if len(query.Alias) > 0 { + return query.Alias + } else { + return query.Id + } } data := map[string]string{} From 37033080b7790bc09e749ee922a49f04d5093dd0 Mon Sep 17 00:00:00 2001 From: utkarshcmu Date: Wed, 27 Feb 2019 00:33:40 -0800 Subject: [PATCH 02/14] Removed commented code --- pkg/tsdb/cloudwatch/cloudwatch.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/pkg/tsdb/cloudwatch/cloudwatch.go b/pkg/tsdb/cloudwatch/cloudwatch.go index bfd9f85dbf9..6d68e6902e5 100644 --- a/pkg/tsdb/cloudwatch/cloudwatch.go +++ b/pkg/tsdb/cloudwatch/cloudwatch.go @@ -496,9 +496,6 @@ func parseQuery(model *simplejson.Json) (*CloudWatchQuery, error) { } alias := model.Get("alias").MustString() - /*if alias == "" { - alias = "{{metric}}_{{stat}}" - }*/ returnData := model.Get("returnData").MustBool(false) highResolution := model.Get("highResolution").MustBool(false) From e04218e550da7ae9c14687cd6fa8ed7390e1c411 Mon Sep 17 00:00:00 2001 From: sandeep Date: Sun, 3 Mar 2019 18:10:38 +0530 Subject: [PATCH 03/14] Fix: #14706 Incorrect index pattern padding in alerting queries When weekly index pattern is used, indices names contain single digit week number for week 1-9 This fix makes sure indice names always contain 2 digit week number for weekly pattern --- pkg/tsdb/elasticsearch/client/index_pattern.go | 2 +- pkg/tsdb/elasticsearch/client/index_pattern_test.go | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/tsdb/elasticsearch/client/index_pattern.go b/pkg/tsdb/elasticsearch/client/index_pattern.go index 952b5c4f806..da3c471424d 100644 --- a/pkg/tsdb/elasticsearch/client/index_pattern.go +++ b/pkg/tsdb/elasticsearch/client/index_pattern.go @@ -279,7 +279,7 @@ func formatDate(t time.Time, pattern string) string { isoYearShort := fmt.Sprintf("%d", isoYear)[2:4] formatted = strings.Replace(formatted, "", fmt.Sprintf("%d", isoYear), -1) formatted = strings.Replace(formatted, "", isoYearShort, -1) - formatted = strings.Replace(formatted, "", fmt.Sprintf("%d", isoWeek), -1) + formatted = strings.Replace(formatted, "", fmt.Sprintf("%02d", isoWeek), -1) formatted = strings.Replace(formatted, "", fmt.Sprintf("%d", t.Unix()), -1) diff --git a/pkg/tsdb/elasticsearch/client/index_pattern_test.go b/pkg/tsdb/elasticsearch/client/index_pattern_test.go index ca20b39d532..a3a056da04f 100644 --- a/pkg/tsdb/elasticsearch/client/index_pattern_test.go +++ b/pkg/tsdb/elasticsearch/client/index_pattern_test.go @@ -76,6 +76,15 @@ func TestIndexPattern(t *testing.T) { So(indices, ShouldHaveLength, 1) So(indices[0], ShouldEqual, "2018-data") }) + + Convey("Should return 01 week", func() { + from = fmt.Sprintf("%d", time.Date(2018, 1, 15, 17, 50, 0, 0, time.UTC).UnixNano()/int64(time.Millisecond)) + to = fmt.Sprintf("%d", time.Date(2018, 1, 15, 17, 55, 0, 0, time.UTC).UnixNano()/int64(time.Millisecond)) + indexPatternScenario(intervalWeekly, "[data-]GGGG.WW", tsdb.NewTimeRange(from, to), func(indices []string) { + So(indices, ShouldHaveLength, 1) + So(indices[0], ShouldEqual, "data-2018.03") + }) + }) }) Convey("Hourly interval", t, func() { From d6449ee629ce10b79aa822c80e7a42154533a4d1 Mon Sep 17 00:00:00 2001 From: Johannes Schill Date: Thu, 7 Mar 2019 09:36:40 +0100 Subject: [PATCH 04/14] fix: Logo goes Home instead of toggling side menu #15482 --- .../components/sidemenu/SideMenu.test.tsx | 16 --------------- .../app/core/components/sidemenu/SideMenu.tsx | 20 +++++-------------- public/app/core/services/context_srv.ts | 10 +--------- public/app/routes/GrafanaCtrl.ts | 5 ----- 4 files changed, 6 insertions(+), 45 deletions(-) diff --git a/public/app/core/components/sidemenu/SideMenu.test.tsx b/public/app/core/components/sidemenu/SideMenu.test.tsx index f7b7df69cfc..6352833490a 100644 --- a/public/app/core/components/sidemenu/SideMenu.test.tsx +++ b/public/app/core/components/sidemenu/SideMenu.test.tsx @@ -2,7 +2,6 @@ import React from 'react'; import { shallow } from 'enzyme'; import { SideMenu } from './SideMenu'; import appEvents from '../../app_events'; -import { contextSrv } from 'app/core/services/context_srv'; jest.mock('../../app_events', () => ({ emit: jest.fn(), @@ -26,7 +25,6 @@ jest.mock('app/core/services/context_srv', () => ({ isGrafanaAdmin: false, isEditor: false, hasEditPermissionFolders: false, - toggleSideMenu: jest.fn(), }, })); @@ -54,20 +52,6 @@ describe('Render', () => { }); describe('Functions', () => { - describe('toggle side menu', () => { - const wrapper = setup(); - const instance = wrapper.instance() as SideMenu; - instance.toggleSideMenu(); - - it('should call contextSrv.toggleSideMenu', () => { - expect(contextSrv.toggleSideMenu).toHaveBeenCalled(); - }); - - it('should emit toggle sidemenu event', () => { - expect(appEvents.emit).toHaveBeenCalledWith('toggle-sidemenu'); - }); - }); - describe('toggle side menu on mobile', () => { const wrapper = setup(); const instance = wrapper.instance() as SideMenu; diff --git a/public/app/core/components/sidemenu/SideMenu.tsx b/public/app/core/components/sidemenu/SideMenu.tsx index 1428ae181f5..b0ef053f746 100644 --- a/public/app/core/components/sidemenu/SideMenu.tsx +++ b/public/app/core/components/sidemenu/SideMenu.tsx @@ -1,31 +1,21 @@ import React, { PureComponent } from 'react'; import appEvents from '../../app_events'; -import { contextSrv } from 'app/core/services/context_srv'; import TopSection from './TopSection'; import BottomSection from './BottomSection'; -import { store } from 'app/store/store'; +import config from 'app/core/config'; + +const homeUrl = config.appSubUrl || '/'; export class SideMenu extends PureComponent { - toggleSideMenu = () => { - // ignore if we just made a location change, stops hiding sidemenu on double clicks of back button - const timeSinceLocationChanged = new Date().getTime() - store.getState().location.lastUpdated; - if (timeSinceLocationChanged < 1000) { - return; - } - - contextSrv.toggleSideMenu(); - appEvents.emit('toggle-sidemenu'); - }; - toggleSideMenuSmallBreakpoint = () => { appEvents.emit('toggle-sidemenu-mobile'); }; render() { return [ -
+ Grafana -
, + ,
diff --git a/public/app/core/services/context_srv.ts b/public/app/core/services/context_srv.ts index 7bb753e6f71..b186d1fde87 100644 --- a/public/app/core/services/context_srv.ts +++ b/public/app/core/services/context_srv.ts @@ -1,7 +1,6 @@ import config from 'app/core/config'; import _ from 'lodash'; import coreModule from 'app/core/core_module'; -import store from 'app/core/store'; export class User { isGrafanaAdmin: any; @@ -29,13 +28,11 @@ export class ContextSrv { isSignedIn: any; isGrafanaAdmin: any; isEditor: any; - sidemenu: any; + sidemenu = true; sidemenuSmallBreakpoint = false; hasEditPermissionInFolders: boolean; constructor() { - this.sidemenu = store.getBool('grafana.sidemenu', true); - if (!config.bootData) { config.bootData = { user: {}, settings: {} }; } @@ -55,11 +52,6 @@ export class ContextSrv { return !!(document.visibilityState === undefined || document.visibilityState === 'visible'); } - toggleSideMenu() { - this.sidemenu = !this.sidemenu; - store.set('grafana.sidemenu', this.sidemenu); - } - hasAccessToExplore() { return (this.isEditor || config.viewersCanEdit) && config.exploreEnabled; } diff --git a/public/app/routes/GrafanaCtrl.ts b/public/app/routes/GrafanaCtrl.ts index 479c5e77f3d..45a06706cd9 100644 --- a/public/app/routes/GrafanaCtrl.ts +++ b/public/app/routes/GrafanaCtrl.ts @@ -116,11 +116,6 @@ export function grafanaAppDirective(playlistSrv, contextSrv, $timeout, $rootScop sidemenuOpen = scope.contextSrv.sidemenu; body.toggleClass('sidemenu-open', sidemenuOpen); - appEvents.on('toggle-sidemenu', () => { - sidemenuOpen = scope.contextSrv.sidemenu; - body.toggleClass('sidemenu-open'); - }); - appEvents.on('toggle-sidemenu-mobile', () => { body.toggleClass('sidemenu-open--xs'); }); From 06e9c116af053422904fdf59f63f5194faf7b591 Mon Sep 17 00:00:00 2001 From: Johannes Schill Date: Thu, 7 Mar 2019 09:54:39 +0100 Subject: [PATCH 05/14] fix: Update test snapshot --- .../sidemenu/__snapshots__/SideMenu.test.tsx.snap | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/public/app/core/components/sidemenu/__snapshots__/SideMenu.test.tsx.snap b/public/app/core/components/sidemenu/__snapshots__/SideMenu.test.tsx.snap index ec2fa845c6d..8d23cdc1565 100644 --- a/public/app/core/components/sidemenu/__snapshots__/SideMenu.test.tsx.snap +++ b/public/app/core/components/sidemenu/__snapshots__/SideMenu.test.tsx.snap @@ -2,16 +2,16 @@ exports[`Render should render component 1`] = ` Array [ -
Grafana -
, + ,
Date: Thu, 7 Mar 2019 15:37:17 +0100 Subject: [PATCH 06/14] changed root font to 100%(default 16px), changed font-size from px to rem, updated rem sizes in template and default.ts files, removed display classes and variables since not used, removed lead class and variables since not usedremoved serif font since not used and probably never should be used --- .../src/themes/_variables.scss.tmpl.ts | 66 ++++++++----------- packages/grafana-ui/src/themes/default.ts | 24 +++---- packages/grafana-ui/src/types/theme.ts | 2 +- public/sass/_variables.generated.scss | 52 ++++++--------- public/sass/base/_type.scss | 23 ------- public/sass/mixins/_mixins.scss | 9 --- 6 files changed, 58 insertions(+), 118 deletions(-) diff --git a/packages/grafana-ui/src/themes/_variables.scss.tmpl.ts b/packages/grafana-ui/src/themes/_variables.scss.tmpl.ts index ca210902ced..260f165f499 100644 --- a/packages/grafana-ui/src/themes/_variables.scss.tmpl.ts +++ b/packages/grafana-ui/src/themes/_variables.scss.tmpl.ts @@ -17,7 +17,7 @@ $enable-hover-media-query: false !default; // Control the default styling of most Bootstrap elements by modifying these // variables. Mostly focused on spacing. -$spacer: 1rem !default; +$spacer: .875rem !default; $spacer-x: $spacer !default; $spacer-y: $spacer !default; $spacers: ( @@ -84,46 +84,32 @@ $enable-flex: true; // Typography // ------------------------- -$font-family-sans-serif: 'Roboto', Helvetica, Arial, sans-serif; -$font-family-serif: Georgia, 'Times New Roman', Times, serif; -$font-family-monospace: Menlo, Monaco, Consolas, 'Courier New', monospace; +$font-family-sans-serif: ${theme.typography.fontFamily.sansSerif}; +$font-family-monospace: ${theme.typography.fontFamily.monospace}; $font-family-base: $font-family-sans-serif !default; -$font-size-root: 14px !default; -$font-size-base: 13px !default; +$font-size-root: ${theme.typography.size.root} !default; +$font-size-base: ${theme.typography.size.base} !default; -$font-size-lg: 18px !default; -$font-size-md: 14px !default; -$font-size-sm: 12px !default; -$font-size-xs: 10px !default; +$font-size-lg: ${theme.typography.size.l} !default; +$font-size-md: ${theme.typography.size.m} !default; +$font-size-sm: ${theme.typography.size.s} !default; +$font-size-xs: ${theme.typography.size.xs} !default; -$line-height-base: 1.5 !default; -$font-weight-semi-bold: 500; +$line-height-base: ${theme.typography.lineHeight.l} !default; +$font-weight-semi-bold: ${theme.typography.weight.semibold}; -$font-size-h1: 2rem !default; -$font-size-h2: 1.75rem !default; -$font-size-h3: 1.5rem !default; -$font-size-h4: 1.3rem !default; -$font-size-h5: 1.2rem !default; -$font-size-h6: 1rem !default; - -$display1-size: 6rem !default; -$display2-size: 5.5rem !default; -$display3-size: 4.5rem !default; -$display4-size: 3.5rem !default; - -$display1-weight: 400 !default; -$display2-weight: 400 !default; -$display3-weight: 400 !default; -$display4-weight: 400 !default; - -$lead-font-size: 1.25rem !default; -$lead-font-weight: 300 !default; +$font-size-h1: ${theme.typography.heading.h1} !default; +$font-size-h2: ${theme.typography.heading.h2} !default; +$font-size-h3: ${theme.typography.heading.h3} !default; +$font-size-h4: ${theme.typography.heading.h4} !default; +$font-size-h5: ${theme.typography.heading.h5} !default; +$font-size-h6: ${theme.typography.heading.h6} !default; $headings-margin-bottom: ($spacer / 2) !default; $headings-font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif; -$headings-font-weight: 400 !default; -$headings-line-height: 1.1 !default; +$headings-font-weight: ${theme.typography.weight.normal} !default; +$headings-line-height: ${theme.typography.lineHeight.s} !default; $hr-border-width: $border-width !default; $dt-font-weight: bold !default; @@ -141,8 +127,8 @@ $border-radius-sm: 2px !default; // Page -$page-sidebar-width: 11rem; -$page-sidebar-margin: 4rem; +$page-sidebar-width: 9.625rem; +$page-sidebar-margin: 3.5rem; // Links // ------------------------- @@ -174,7 +160,7 @@ $input-padding-y-lg: 10px !default; $input-height: 35px !default; -$gf-form-margin: 0.2rem; +$gf-form-margin: 0.175rem; $gf-form-input-height: 35px; $cursor-disabled: not-allowed !default; @@ -199,12 +185,12 @@ $zindex-typeahead: 1060; // Buttons // -$btn-padding-x: 1rem !default; -$btn-padding-y: 0.7rem !default; +$btn-padding-x: .875rem !default; +$btn-padding-y: 0.6125rem !default; $btn-line-height: 1 !default; -$btn-font-weight: 500 !default; +$btn-font-weight: ${theme.typography.weight.semibold} !default; -$btn-padding-x-sm: 0.5rem !default; +$btn-padding-x-sm: 0.4375rem !default; $btn-padding-y-sm: 0.25rem !default; $btn-padding-x-lg: 21px !default; diff --git a/packages/grafana-ui/src/themes/default.ts b/packages/grafana-ui/src/themes/default.ts index 104edced000..72f09ea1325 100644 --- a/packages/grafana-ui/src/themes/default.ts +++ b/packages/grafana-ui/src/themes/default.ts @@ -5,23 +5,23 @@ const theme: GrafanaThemeCommons = { typography: { fontFamily: { sansSerif: "'Roboto', Helvetica, Arial, sans-serif", - serif: "Georgia, 'Times New Roman', Times, serif", monospace: "Menlo, Monaco, Consolas, 'Courier New', monospace", }, size: { - base: '13px', - xs: '10px', - s: '12px', - m: '14px', - l: '18px', + root: '100%', + base: '.8125rem', + xs: '.625rem', + s: '.75rem', + m: '.875rem', + l: '1.125rem', }, heading: { - h1: '2rem', - h2: '1.75rem', - h3: '1.5rem', - h4: '1.3rem', - h5: '1.2rem', - h6: '1rem', + h1: '1.75rem', + h2: '1.5rem', + h3: '1.3125rem', + h4: '1.125rem', + h5: '1rem', + h6: '.875rem', }, weight: { light: 300, diff --git a/packages/grafana-ui/src/types/theme.ts b/packages/grafana-ui/src/types/theme.ts index 30f1bf4685b..e3a73d90ea7 100644 --- a/packages/grafana-ui/src/types/theme.ts +++ b/packages/grafana-ui/src/types/theme.ts @@ -16,10 +16,10 @@ export interface GrafanaThemeCommons { typography: { fontFamily: { sansSerif: string; - serif: string; monospace: string; }; size: { + root: string; base: string; xs: string; s: string; diff --git a/public/sass/_variables.generated.scss b/public/sass/_variables.generated.scss index 713bfb7a336..a6f3c874aa1 100644 --- a/public/sass/_variables.generated.scss +++ b/public/sass/_variables.generated.scss @@ -20,7 +20,7 @@ $enable-hover-media-query: false !default; // Control the default styling of most Bootstrap elements by modifying these // variables. Mostly focused on spacing. -$spacer: 1rem !default; +$spacer: 0.875rem !default; $spacer-x: $spacer !default; $spacer-y: $spacer !default; $spacers: ( @@ -88,40 +88,26 @@ $enable-flex: true; // ------------------------- $font-family-sans-serif: 'Roboto', Helvetica, Arial, sans-serif; -$font-family-serif: Georgia, 'Times New Roman', Times, serif; $font-family-monospace: Menlo, Monaco, Consolas, 'Courier New', monospace; $font-family-base: $font-family-sans-serif !default; -$font-size-root: 14px !default; -$font-size-base: 13px !default; +$font-size-root: 100% !default; +$font-size-base: 0.8125rem !default; -$font-size-lg: 18px !default; -$font-size-md: 14px !default; -$font-size-sm: 12px !default; -$font-size-xs: 10px !default; +$font-size-lg: 1.125rem !default; +$font-size-md: 0.875rem !default; +$font-size-sm: 0.75rem !default; +$font-size-xs: 0.625rem !default; $line-height-base: 1.5 !default; $font-weight-semi-bold: 500; -$font-size-h1: 2rem !default; -$font-size-h2: 1.75rem !default; -$font-size-h3: 1.5rem !default; -$font-size-h4: 1.3rem !default; -$font-size-h5: 1.2rem !default; -$font-size-h6: 1rem !default; - -$display1-size: 6rem !default; -$display2-size: 5.5rem !default; -$display3-size: 4.5rem !default; -$display4-size: 3.5rem !default; - -$display1-weight: 400 !default; -$display2-weight: 400 !default; -$display3-weight: 400 !default; -$display4-weight: 400 !default; - -$lead-font-size: 1.25rem !default; -$lead-font-weight: 300 !default; +$font-size-h1: 1.75rem !default; +$font-size-h2: 1.5rem !default; +$font-size-h3: 1.3125rem !default; +$font-size-h4: 1.125rem !default; +$font-size-h5: 1rem !default; +$font-size-h6: 0.875rem !default; $headings-margin-bottom: ($spacer / 2) !default; $headings-font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif; @@ -144,8 +130,8 @@ $border-radius-sm: 2px !default; // Page -$page-sidebar-width: 11rem; -$page-sidebar-margin: 4rem; +$page-sidebar-width: 9.625rem; +$page-sidebar-margin: 3.5rem; // Links // ------------------------- @@ -177,7 +163,7 @@ $input-padding-y-lg: 10px !default; $input-height: 35px !default; -$gf-form-margin: 0.2rem; +$gf-form-margin: 0.175rem; $gf-form-input-height: 35px; $cursor-disabled: not-allowed !default; @@ -202,12 +188,12 @@ $zindex-typeahead: 1060; // Buttons // -$btn-padding-x: 1rem !default; -$btn-padding-y: 0.7rem !default; +$btn-padding-x: 0.875rem !default; +$btn-padding-y: 0.6125rem !default; $btn-line-height: 1 !default; $btn-font-weight: 500 !default; -$btn-padding-x-sm: 0.5rem !default; +$btn-padding-x-sm: 0.4375rem !default; $btn-padding-y-sm: 0.25rem !default; $btn-padding-x-lg: 21px !default; diff --git a/public/sass/base/_type.scss b/public/sass/base/_type.scss index ea24116795a..ab4fbc33a55 100644 --- a/public/sass/base/_type.scss +++ b/public/sass/base/_type.scss @@ -141,29 +141,6 @@ h6, font-size: $font-size-h6; } -.lead { - font-size: $lead-font-size; - font-weight: $lead-font-weight; -} - -// Type display classes -.display-1 { - font-size: $display1-size; - font-weight: $display1-weight; -} -.display-2 { - font-size: $display2-size; - font-weight: $display2-weight; -} -.display-3 { - font-size: $display3-size; - font-weight: $display3-weight; -} -.display-4 { - font-size: $display4-size; - font-weight: $display4-weight; -} - // // Horizontal rules // diff --git a/public/sass/mixins/_mixins.scss b/public/sass/mixins/_mixins.scss index 89285cc2496..298ea0c64ad 100644 --- a/public/sass/mixins/_mixins.scss +++ b/public/sass/mixins/_mixins.scss @@ -79,10 +79,6 @@ // FONTS // -------------------------------------------------- -@mixin font-family-serif() { - font-family: $font-family-serif; -} - @mixin font-family-sans-serif() { font-family: $font-family-sans-serif; } @@ -97,11 +93,6 @@ line-height: $lineHeight; } -@mixin font-serif($size: $font-size-base, $weight: normal, $lineHeight: $line-height-base) { - @include font-family-serif(); - @include font-shorthand($size, $weight, $lineHeight); -} - @mixin font-sans-serif($size: $font-size-base, $weight: normal, $lineHeight: $line-height-base) { @include font-family-sans-serif(); @include font-shorthand($size, $weight, $lineHeight); From 946e54241297ef171c5bdf4199de393d38854f2f Mon Sep 17 00:00:00 2001 From: "Woodward, Joshua" Date: Thu, 7 Mar 2019 14:00:04 -0800 Subject: [PATCH 07/14] Make password hint configurable from settings/defaults.ini --- conf/defaults.ini | 1 + pkg/api/login.go | 1 + pkg/setting/setting.go | 2 ++ public/app/core/config.ts | 1 + public/app/core/controllers/login_ctrl.ts | 1 + public/app/partials/login.html | 2 +- 6 files changed, 7 insertions(+), 1 deletion(-) diff --git a/conf/defaults.ini b/conf/defaults.ini index df02e01235b..33fe17a2aa6 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -231,6 +231,7 @@ verify_email_enabled = false # Background text for the user field on the login page login_hint = email or username +passowrd_hint = password # Default UI theme ("dark" or "light") default_theme = dark diff --git a/pkg/api/login.go b/pkg/api/login.go index 1445463852b..f6c3e802988 100644 --- a/pkg/api/login.go +++ b/pkg/api/login.go @@ -36,6 +36,7 @@ func (hs *HTTPServer) LoginView(c *m.ReqContext) { viewData.Settings["oauth"] = enabledOAuths viewData.Settings["disableUserSignUp"] = !setting.AllowUserSignUp viewData.Settings["loginHint"] = setting.LoginHint + viewData.Settings["passwordHint"] = setting.PasswordHint viewData.Settings["disableLoginForm"] = setting.DisableLoginForm if loginError, ok := tryGetEncryptedCookie(c, LoginErrorCookieName); ok { diff --git a/pkg/setting/setting.go b/pkg/setting/setting.go index 5d44a3585dc..7b6e99255aa 100644 --- a/pkg/setting/setting.go +++ b/pkg/setting/setting.go @@ -109,6 +109,7 @@ var ( AutoAssignOrgRole string VerifyEmailEnabled bool LoginHint string + PasswordHint string DefaultTheme string DisableLoginForm bool DisableSignoutMenu bool @@ -656,6 +657,7 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error { AutoAssignOrgRole = users.Key("auto_assign_org_role").In("Editor", []string{"Editor", "Admin", "Viewer"}) VerifyEmailEnabled = users.Key("verify_email_enabled").MustBool(false) LoginHint = users.Key("login_hint").String() + PasswordHint = users.Key("password_hint").String() DefaultTheme = users.Key("default_theme").String() ExternalUserMngLinkUrl = users.Key("external_manage_link_url").String() ExternalUserMngLinkName = users.Key("external_manage_link_name").String() diff --git a/public/app/core/config.ts b/public/app/core/config.ts index 8fefc1aeb0a..bbf7fb88d62 100644 --- a/public/app/core/config.ts +++ b/public/app/core/config.ts @@ -34,6 +34,7 @@ export class Settings { oauth: any; disableUserSignUp: boolean; loginHint: any; + passwordHint: any; loginError: any; viewersCanEdit: boolean; editorsCanOwn: boolean; diff --git a/public/app/core/controllers/login_ctrl.ts b/public/app/core/controllers/login_ctrl.ts index de4e3415dfb..3a72379aa81 100644 --- a/public/app/core/controllers/login_ctrl.ts +++ b/public/app/core/controllers/login_ctrl.ts @@ -25,6 +25,7 @@ export class LoginCtrl { $scope.disableLoginForm = config.disableLoginForm; $scope.disableUserSignUp = config.disableUserSignUp; $scope.loginHint = config.loginHint; + $scope.passwordHint = config.passwordHint; $scope.loginMode = true; $scope.submitBtnText = 'Log in'; diff --git a/public/app/partials/login.html b/public/app/partials/login.html index 674c9581ce5..33872c7d6d5 100644 --- a/public/app/partials/login.html +++ b/public/app/partials/login.html @@ -13,7 +13,7 @@
)} {showLocalTime && ( -
+
{row.timeLocal}
)} diff --git a/public/sass/components/_panel_logs.scss b/public/sass/components/_panel_logs.scss index 5ecfa7259b1..5d35f8fddc0 100644 --- a/public/sass/components/_panel_logs.scss +++ b/public/sass/components/_panel_logs.scss @@ -63,6 +63,7 @@ $column-horizontal-spacing: 10px; font-size: $font-size-sm; display: table; table-layout: fixed; + width: 100%; } .logs-row { @@ -83,16 +84,22 @@ $column-horizontal-spacing: 10px; .logs-row__time { white-space: nowrap; + width: 19em; +} + +.logs-row__localtime { + white-space: nowrap; + width: 12.5em; } .logs-row__labels { - max-width: 20%; + width: 20%; line-height: 1.2; + position: relative; } .logs-row__message { word-break: break-all; - min-width: 80%; } .logs-row__match-highlight { @@ -112,6 +119,7 @@ $column-horizontal-spacing: 10px; .logs-row__level { position: relative; + width: 10px; &::after { content: ''; @@ -165,6 +173,7 @@ $column-horizontal-spacing: 10px; .logs-row__duplicates { text-align: right; + width: 4.5em; } .logs-row__field-highlight { @@ -193,15 +202,20 @@ $column-horizontal-spacing: 10px; } } +.logs-labels { + display: flex; + flex-wrap: wrap; +} + .logs-label { - display: inline-block; + display: flex; padding: 0 2px; background-color: $btn-inverse-bg; border-radius: $border-radius; margin: 0 4px 2px 0; text-overflow: ellipsis; white-space: nowrap; - position: relative; + overflow: hidden; } .logs-label__icon { @@ -211,6 +225,13 @@ $column-horizontal-spacing: 10px; margin-left: 2px; } +.logs-label__value { + display: inline-block; + max-width: 20em; + text-overflow: ellipsis; + overflow: hidden; +} + .logs-label__stats { position: absolute; top: 1.25em;