Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
35679d46
Unverified
Commit
35679d46
authored
Jan 10, 2020
by
Torkel Ödegaard
Committed by
GitHub
Jan 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Logos: Refactoring a bit how logos are rendered (#21421)
parent
cfba2563
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
16 deletions
+23
-16
pkg/api/dtos/index.go
+2
-0
pkg/api/index.go
+2
-0
public/app/core/components/Branding/Branding.tsx
+12
-7
public/app/core/components/Login/LoginPage.tsx
+1
-2
public/app/core/components/sidemenu/SideMenu.tsx
+2
-1
public/app/core/components/sidemenu/__snapshots__/SideMenu.test.tsx.snap
+1
-4
public/views/index-template.html
+3
-2
No files found.
pkg/api/dtos/index.go
View file @
35679d46
...
...
@@ -15,6 +15,8 @@ type IndexViewData struct {
NewGrafanaVersion
string
AppName
string
AppNameBodyClass
string
FavIcon
string
AppleTouchIcon
string
}
type
PluginCss
struct
{
...
...
pkg/api/index.go
View file @
35679d46
...
...
@@ -85,6 +85,8 @@ func (hs *HTTPServer) setIndexViewData(c *m.ReqContext) (*dtos.IndexViewData, er
NewGrafanaVersionExists
:
plugins
.
GrafanaHasUpdate
,
AppName
:
setting
.
ApplicationName
,
AppNameBodyClass
:
getAppNameBodyClass
(
hs
.
License
.
HasValidLicense
()),
FavIcon
:
"public/img/fav32.png"
,
AppleTouchIcon
:
"public/img/apple-touch-icon.png"
,
}
if
setting
.
DisableGravatar
{
...
...
public/app/core/components/Branding/Branding.tsx
View file @
35679d46
import
React
,
{
FC
}
from
'react'
;
export
interface
BrandComponentProps
{
className
:
string
;
className
?
:
string
;
}
export
const
LogoIcon
:
FC
<
BrandComponentProps
>
=
({
className
})
=>
{
return
<
img
className=
{
className
}
src=
"public/img/grafana_icon.svg"
alt=
"Grafana"
/>;
export
const
LoginLogo
:
FC
<
BrandComponentProps
>
=
({
className
})
=>
{
return
(
<>
<
img
className=
{
className
}
src=
"public/img/grafana_icon.svg"
alt=
"Grafana"
/>
<
div
className=
"logo-wordmark"
/>
</>
);
};
export
const
Wordmark
:
FC
<
BrandComponentProps
>
=
({
className
})
=>
{
return
<
div
className=
{
className
}
/>;
export
const
MenuLogo
:
FC
<
BrandComponentProps
>
=
({
className
})
=>
{
return
<
img
className=
{
className
}
src=
"public/img/grafana_icon.svg"
alt=
"Grafana"
/>;
};
export
class
Branding
{
static
Log
oIcon
=
LogoIcon
;
static
Wordmark
=
Wordmark
;
static
Log
inLogo
=
LoginLogo
;
static
MenuLogo
=
MenuLogo
;
}
public/app/core/components/Login/LoginPage.tsx
View file @
35679d46
...
...
@@ -12,8 +12,7 @@ export const LoginPage: FC = () => {
<
div
className=
"login container"
>
<
div
className=
"login-content"
>
<
div
className=
"login-branding"
>
<
Branding
.
LogoIcon
className=
"logo-icon"
/>
<
Branding
.
Wordmark
className=
"logo-wordmark"
/>
<
Branding
.
LoginLogo
className=
"logo-icon"
/>
</
div
>
<
LoginCtrl
>
{
({
...
...
public/app/core/components/sidemenu/SideMenu.tsx
View file @
35679d46
...
...
@@ -4,6 +4,7 @@ import TopSection from './TopSection';
import
BottomSection
from
'./BottomSection'
;
import
config
from
'app/core/config'
;
import
{
CoreEvents
}
from
'app/types'
;
import
{
Branding
}
from
'app/core/components/Branding/Branding'
;
const
homeUrl
=
config
.
appSubUrl
||
'/'
;
...
...
@@ -15,7 +16,7 @@ export class SideMenu extends PureComponent {
render
()
{
return
[
<
a
href=
{
homeUrl
}
className=
"sidemenu__logo"
key=
"logo"
>
<
img
src=
"public/img/grafana_icon.svg"
alt=
"Grafana"
/>
<
Branding
.
MenuLogo
/>
</
a
>,
<
div
className=
"sidemenu__logo_small_breakpoint"
onClick=
{
this
.
toggleSideMenuSmallBreakpoint
}
key=
"hamburger"
>
<
i
className=
"fa fa-bars"
/>
...
...
public/app/core/components/sidemenu/__snapshots__/SideMenu.test.tsx.snap
View file @
35679d46
...
...
@@ -7,10 +7,7 @@ Array [
href="/"
key="logo"
>
<img
alt="Grafana"
src="public/img/grafana_icon.svg"
/>
<Component />
</a>,
<div
className="sidemenu__logo_small_breakpoint"
...
...
public/views/index-template.html
View file @
35679d46
...
...
@@ -29,9 +29,10 @@
as=
"font"
crossorigin
/>
<link
rel=
"icon"
type=
"image/png"
href=
"public/img/fav32.png"
/>
<link
rel=
"icon"
type=
"image/png"
href=
"[[.FavIcon]]"
/>
<link
rel=
"apple-touch-icon"
sizes=
"180x180"
href=
"[[.AppleTouchIcon]]"
/>
<link
rel=
"mask-icon"
href=
"public/img/grafana_mask_icon.svg"
color=
"#F05A28"
/>
<link
rel=
"apple-touch-icon"
sizes=
"180x180"
href=
"public/img/apple-touch-icon.png"
/>
<link
rel=
"stylesheet"
href=
"public/build/grafana.[[ .Theme ]].<%= webpack.hash %>.css"
/>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment