Merge pull request #13922 from grafana/login-page-update
Updated login page logo & wordmark and responsive behavior
This commit is contained in:
@@ -14,6 +14,7 @@ type IndexViewData struct {
|
|||||||
NewGrafanaVersionExists bool
|
NewGrafanaVersionExists bool
|
||||||
NewGrafanaVersion string
|
NewGrafanaVersion string
|
||||||
AppName string
|
AppName string
|
||||||
|
AppNameBodyClass string
|
||||||
}
|
}
|
||||||
|
|
||||||
type PluginCss struct {
|
type PluginCss struct {
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ func (hs *HTTPServer) setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, er
|
|||||||
NewGrafanaVersion: plugins.GrafanaLatestVersion,
|
NewGrafanaVersion: plugins.GrafanaLatestVersion,
|
||||||
NewGrafanaVersionExists: plugins.GrafanaHasUpdate,
|
NewGrafanaVersionExists: plugins.GrafanaHasUpdate,
|
||||||
AppName: setting.ApplicationName,
|
AppName: setting.ApplicationName,
|
||||||
|
AppNameBodyClass: getAppNameBodyClass(setting.ApplicationName),
|
||||||
}
|
}
|
||||||
|
|
||||||
if setting.DisableGravatar {
|
if setting.DisableGravatar {
|
||||||
@@ -377,3 +378,14 @@ func (hs *HTTPServer) NotFoundHandler(c *m.ReqContext) {
|
|||||||
|
|
||||||
c.HTML(404, "index", data)
|
c.HTML(404, "index", data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getAppNameBodyClass(name string) string {
|
||||||
|
switch name {
|
||||||
|
case setting.APP_NAME:
|
||||||
|
return "app-grafana"
|
||||||
|
case setting.APP_NAME_ENTERPRISE:
|
||||||
|
return "app-enterprise"
|
||||||
|
default:
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -31,9 +31,11 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
DEV string = "development"
|
DEV = "development"
|
||||||
PROD string = "production"
|
PROD = "production"
|
||||||
TEST string = "test"
|
TEST = "test"
|
||||||
|
APP_NAME = "Grafana"
|
||||||
|
APP_NAME_ENTERPRISE = "Grafana Enterprise"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@@ -531,9 +533,9 @@ func (cfg *Cfg) Load(args *CommandLineArgs) error {
|
|||||||
// Temporary keep global, to make refactor in steps
|
// Temporary keep global, to make refactor in steps
|
||||||
Raw = cfg.Raw
|
Raw = cfg.Raw
|
||||||
|
|
||||||
ApplicationName = "Grafana"
|
ApplicationName = APP_NAME
|
||||||
if IsEnterprise {
|
if IsEnterprise {
|
||||||
ApplicationName += " Enterprise"
|
ApplicationName = APP_NAME_ENTERPRISE
|
||||||
}
|
}
|
||||||
|
|
||||||
Env = iniFile.Section("").Key("app_mode").MustString("development")
|
Env = iniFile.Section("").Key("app_mode").MustString("development")
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<div class="login-content">
|
<div class="login-content">
|
||||||
<div class="login-branding">
|
<div class="login-branding">
|
||||||
<img class="logo-icon" src="public/img/grafana_icon.svg" alt="Grafana" />
|
<img class="logo-icon" src="public/img/grafana_icon.svg" alt="Grafana" />
|
||||||
<i class="icon-gf icon-gf-grafana_wordmark"></i>
|
<div class="logo-wordmark" />
|
||||||
</div>
|
</div>
|
||||||
<div class="login-outer-box">
|
<div class="login-outer-box">
|
||||||
<div class="login-inner-box" id="login-view">
|
<div class="login-inner-box" id="login-view">
|
||||||
|
|||||||
@@ -40,15 +40,15 @@
|
|||||||
|
|
||||||
.login-page {
|
.login-page {
|
||||||
.footer {
|
.footer {
|
||||||
|
bottom: $spacer;
|
||||||
|
position: absolute;
|
||||||
padding: 1rem 0 1rem 0;
|
padding: 1rem 0 1rem 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@include media-breakpoint-up(md) {
|
@include media-breakpoint-up(sm) {
|
||||||
.login-page {
|
.login-page {
|
||||||
.footer {
|
.footer {
|
||||||
bottom: $spacer;
|
|
||||||
position: absolute;
|
|
||||||
padding: 5rem 0 1rem 0;
|
padding: 5rem 0 1rem 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
$login-border: #8daac5;
|
$login-border: #8daac5;
|
||||||
|
|
||||||
.login {
|
.login {
|
||||||
min-height: 85vh;
|
min-height: 100vh;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
min-width: 100%;
|
min-width: 100%;
|
||||||
@@ -97,6 +97,7 @@ select:-webkit-autofill:focus {
|
|||||||
|
|
||||||
.login-content {
|
.login-content {
|
||||||
max-width: 700px;
|
max-width: 700px;
|
||||||
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: stretch;
|
align-items: stretch;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@@ -120,18 +121,29 @@ select:-webkit-autofill:focus {
|
|||||||
width: 70px;
|
width: 70px;
|
||||||
margin-bottom: 15px;
|
margin-bottom: 15px;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.icon-gf-grafana_wordmark {
|
.app-grafana {
|
||||||
color: darken($white, 11%);
|
.logo-wordmark {
|
||||||
position: relative;
|
background: url('../img/grafana_typelogo.svg') top center no-repeat;
|
||||||
font-size: 2rem;
|
width: 100%;
|
||||||
text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
|
height: 70px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.app-enterprise {
|
||||||
|
.logo-wordmark {
|
||||||
|
background: url('../img/grafana_enterprise_typelogo.svg') top center no-repeat;
|
||||||
|
width: 100%;
|
||||||
|
height: 70px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-outer-box {
|
.login-outer-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-inner-box {
|
.login-inner-box {
|
||||||
@@ -143,6 +155,7 @@ select:-webkit-autofill:focus {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
max-width: 415px;
|
max-width: 415px;
|
||||||
|
width: 100%;
|
||||||
transform: tranlate(0px, 0px);
|
transform: tranlate(0px, 0px);
|
||||||
transition: 0.25s ease;
|
transition: 0.25s ease;
|
||||||
|
|
||||||
@@ -324,23 +337,19 @@ select:-webkit-autofill:focus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@include media-breakpoint-up(sm) {
|
@include media-breakpoint-up(sm) {
|
||||||
.login-content {
|
|
||||||
flex-direction: row;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-branding {
|
.login-branding {
|
||||||
width: 35%;
|
padding: 1rem;
|
||||||
padding: 4rem 2rem;
|
|
||||||
border-right: 1px solid $login-border;
|
|
||||||
|
|
||||||
.logo-icon {
|
.logo-icon {
|
||||||
width: 80px;
|
width: 80px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.login-inner-box {
|
@include media-breakpoint-up(md) {
|
||||||
width: 65%;
|
.login-content {
|
||||||
padding: 1rem 2rem;
|
flex-direction: row;
|
||||||
|
flex: 1 0 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-divider {
|
.login-divider {
|
||||||
@@ -348,29 +357,16 @@ select:-webkit-autofill:focus {
|
|||||||
width: 110px;
|
width: 110px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@include media-breakpoint-up(md) {
|
|
||||||
.login {
|
|
||||||
min-height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-content {
|
|
||||||
flex: 1 0 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-branding {
|
.login-branding {
|
||||||
width: 45%;
|
width: 45%;
|
||||||
padding: 2rem 4rem;
|
padding: 2rem;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
border-right: 1px solid $login-border;
|
||||||
|
|
||||||
.logo-icon {
|
.logo-icon {
|
||||||
width: 130px;
|
width: 130px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-gf-grafana_wordmark {
|
|
||||||
font-size: 3.2rem;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-inner-box {
|
.login-inner-box {
|
||||||
@@ -386,9 +382,7 @@ select:-webkit-autofill:focus {
|
|||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
padding-left: 10px;
|
padding-left: 10px;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@include media-breakpoint-up(lg) {
|
|
||||||
.login-form-input {
|
.login-form-input {
|
||||||
min-width: 300px;
|
min-width: 300px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
<meta name="msapplication-config" content="public/img/browserconfig.xml">
|
<meta name="msapplication-config" content="public/img/browserconfig.xml">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body class="theme-[[ .Theme ]]">
|
<body class="theme-[[ .Theme ]] [[.AppNameBodyClass]]">
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
.preloader {
|
.preloader {
|
||||||
|
|||||||
Reference in New Issue
Block a user