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
54057363
Commit
54057363
authored
Aug 15, 2017
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ux: nav fixes & polish
parent
d659a5d7
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
105 additions
and
60 deletions
+105
-60
pkg/api/avatar/avatar.go
+1
-1
pkg/api/index.go
+17
-4
public/app/core/components/navbar/navbar.ts
+3
-2
public/app/core/components/sidemenu/sidemenu.html
+68
-46
public/app/core/components/sidemenu/sidemenu.ts
+3
-3
public/sass/components/_query_editor.scss
+1
-1
public/sass/components/_search.scss
+2
-2
public/sass/layout/_page.scss
+10
-1
No files found.
pkg/api/avatar/avatar.go
View file @
54057363
...
@@ -65,7 +65,7 @@ func New(hash string) *Avatar {
...
@@ -65,7 +65,7 @@ func New(hash string) *Avatar {
return
&
Avatar
{
return
&
Avatar
{
hash
:
hash
,
hash
:
hash
,
reqParams
:
url
.
Values
{
reqParams
:
url
.
Values
{
"d"
:
{
"
404
"
},
"d"
:
{
"
retro
"
},
"size"
:
{
"200"
},
"size"
:
{
"200"
},
"r"
:
{
"pg"
}}
.
Encode
(),
"r"
:
{
"pg"
}}
.
Encode
(),
}
}
...
...
pkg/api/index.go
View file @
54057363
...
@@ -113,10 +113,11 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
...
@@ -113,10 +113,11 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
if
c
.
IsSignedIn
{
if
c
.
IsSignedIn
{
data
.
NavTree
=
append
(
data
.
NavTree
,
&
dtos
.
NavLink
{
data
.
NavTree
=
append
(
data
.
NavTree
,
&
dtos
.
NavLink
{
Text
:
"Your Profile"
,
Text
:
c
.
SignedInUser
.
Login
,
Id
:
"profile"
,
Id
:
"profile"
,
Icon
:
"fa fa-fw fa-user"
,
Img
:
data
.
User
.
GravatarUrl
,
Url
:
setting
.
AppSubUrl
+
"/profile"
,
Url
:
setting
.
AppSubUrl
+
"/profile"
,
HideFromMenu
:
true
,
Children
:
[]
*
dtos
.
NavLink
{
Children
:
[]
*
dtos
.
NavLink
{
{
Text
:
"Signout"
,
Url
:
setting
.
AppSubUrl
+
"/logout"
,
Icon
:
"fa fa-fw fa-sign-out"
,
Target
:
"_self"
},
{
Text
:
"Signout"
,
Url
:
setting
.
AppSubUrl
+
"/logout"
,
Icon
:
"fa fa-fw fa-sign-out"
,
Target
:
"_self"
},
{
Text
:
"Your profile"
,
Url
:
setting
.
AppSubUrl
+
"/profile"
,
Icon
:
"fa fa-fw fa-sliders"
},
{
Text
:
"Your profile"
,
Url
:
setting
.
AppSubUrl
+
"/profile"
,
Icon
:
"fa fa-fw fa-sliders"
},
...
@@ -256,6 +257,18 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
...
@@ -256,6 +257,18 @@ func setIndexViewData(c *middleware.Context) (*dtos.IndexViewData, error) {
})
})
}
}
data
.
NavTree
=
append
(
data
.
NavTree
,
&
dtos
.
NavLink
{
Text
:
"Help"
,
Id
:
"help"
,
Url
:
"/help"
,
Icon
:
"fa fa-fw fa-question"
,
HideFromMenu
:
true
,
Children
:
[]
*
dtos
.
NavLink
{
{
Text
:
"Shortcuts"
,
Url
:
"/shortcuts"
,
Icon
:
"fa fa-fw fa-keyboard-o"
,
Target
:
"_self"
},
{
Text
:
"Community site"
,
Url
:
"http://community.grafana.com"
,
Icon
:
"fa fa-fw fa-comment"
,
Target
:
"_blank"
},
{
Text
:
"Documentation"
,
Url
:
"http://docs.grafana.org"
,
Icon
:
"fa fa-fw fa-file"
,
Target
:
"_blank"
},
},
})
data
.
NavTree
=
append
(
data
.
NavTree
,
cfgNode
)
data
.
NavTree
=
append
(
data
.
NavTree
,
cfgNode
)
}
}
...
...
public/app/core/components/navbar/navbar.ts
View file @
54057363
...
@@ -46,8 +46,9 @@ export function pageH1() {
...
@@ -46,8 +46,9 @@ export function pageH1() {
restrict
:
'E'
,
restrict
:
'E'
,
template
:
`
template
:
`
<h1>
<h1>
<i class="{{model.node.icon}}"></i>
<i class="{{::model.node.icon}}" ng-if="::model.node.icon"></i>
{{model.node.text}}
<img ng-src="{{::model.node.img}}" ng-if="::model.node.img"></i>
{{::model.node.text}}
</h1>
</h1>
`
,
`
,
scope
:
{
scope
:
{
...
...
public/app/core/components/sidemenu/sidemenu.html
View file @
54057363
...
@@ -28,52 +28,74 @@
...
@@ -28,52 +28,74 @@
</div>
</div>
<div
class=
"sidemenu__bottom"
>
<div
class=
"sidemenu__bottom"
>
<div
ng-show=
"::!ctrl.isSignedIn"
class=
"sidemenu-item"
>
<a
href=
"{{ctrl.loginUrl}}"
class=
"sidemenu-link"
target=
"_self"
>
<span
class=
"icon-circle sidemenu-icon"
><i
class=
"fa fa-fw fa-sign-in"
></i></span>
</a>
<ul
class=
"dropdown-menu dropdown-menu--sidemenu"
role=
"menu"
>
<li
class=
"side-menu-header"
>
<span
class=
"sidemenu-item-text"
>
Sign in
</span>
</li>
</ul>
</div>
<div
class=
"sidemenu-item dropup dropdown"
ng-if=
"::ctrl.isSignedIn"
>
<a
class=
"sidemenu-link"
href=
"profile"
>
<span
class=
"icon-circle sidemenu-icon sidemenu-org-avatar"
>
<img
ng-src=
"{{::ctrl.user.gravatarUrl}}"
>
<span
class=
"sidemenu-org-avatar--missing"
>
<i
class=
"fa fa-fw fa-user"
></i>
</span>
</a>
<ul
class=
"dropdown-menu dropdown-menu--sidemenu dropup"
role=
"menu"
>
<li
ng-show=
"ctrl.orgs.length > ctrl.maxshownorgs"
style=
"margin-left: 10px;width: 90%"
>
<span
class=
"sidemenu-item-text"
>
max shown : {{::ctrl.maxshownorgs}}
</span>
<input
ng-model=
"::ctrl.orgfilter"
style=
"padding-left: 5px"
type=
"text"
ng-change=
"::ctrl.loadorgsitems();"
class=
"gf-input-small width-12"
placeholder=
"filter"
>
</li>
<li
ng-repeat=
"orgitem in ctrl.orgitems"
ng-class=
"::orgitem.cssclass"
>
<a
href=
"{{::orgitem.url}}"
ng-show=
"::orgitem.url"
target=
"{{::orgitem.target}}"
>
<i
class=
"{{::orgitem.icon}}"
ng-show=
"::orgitem.icon"
></i>
{{::orgitem.text}}
</a>
</li>
<li
ng-repeat=
"menuItem in ctrl.profileNav.children"
ng-class=
"::menuItem.cssClass"
ng-hide=
"menuItem.hideFromMenu"
>
<a
href=
"{{::menuItem.url}}"
ng-show=
"::menuItem.url"
target=
"{{::menuItem.target}}"
>
<i
class=
"{{::menuItem.icon}}"
ng-show=
"::menuItem.icon"
></i>
{{::menuItem.text}}
</a>
</li>
<li
class=
"side-menu-header"
>
<span
class=
"sidemenu-item-text"
>
{{::ctrl.user.name}}
</span>
</li>
</ul>
</div>
<div
class=
"sidemenu-item"
>
<div
ng-repeat=
"item in ::ctrl.bottomNav"
class=
"sidemenu-item dropdown dropup"
>
<a
href=
"http://docs.grafana.org"
class=
"sidemenu-link"
target=
"_blank"
>
<a
href=
"{{::item.url}}"
class=
"sidemenu-link"
target=
"{{::item.target}}"
>
<span
class=
"icon-circle sidemenu-icon"
><i
class=
"fa fa-fw fa-question"
></i></span>
<span
class=
"icon-circle sidemenu-icon"
>
</a>
<i
class=
"{{::item.icon}}"
ng-show=
"::item.icon"
></i>
</div>
<img
ng-src=
"{{::item.img}}"
ng-show=
"::item.img"
>
</span>
</a>
<ul
class=
"dropdown-menu dropdown-menu--sidemenu"
role=
"menu"
ng-if=
"::item.children"
>
<li
ng-repeat=
"child in ::item.children"
ng-class=
"{divider: child.divider}"
ng-hide=
"::child.hideFromMenu"
>
<a
href=
"{{::child.url}}"
target=
"{{::child.target}}"
>
<i
class=
"{{::child.icon}}"
ng-show=
"::child.icon"
></i>
{{::child.text}}
</a>
</li>
<li
class=
"side-menu-header"
>
<span
class=
"sidemenu-item-text"
>
{{::item.text}}
</span>
</li>
</ul>
</div>
<!-- <div ng-show="::!ctrl.isSignedIn" class="sidemenu-item"> -->
<!-- <a href="{{ctrl.loginUrl}}" class="sidemenu-link" target="_self"> -->
<!-- <span class="icon-circle sidemenu-icon"><i class="fa fa-fw fa-sign-in"></i></span> -->
<!-- </a> -->
<!-- <ul class="dropdown-menu dropdown-menu--sidemenu" role="menu"> -->
<!-- <li class="side-menu-header"> -->
<!-- <span class="sidemenu-item-text">Sign in</span> -->
<!-- </li> -->
<!-- </ul> -->
<!-- </div> -->
<!-- -->
<!-- <div class="sidemenu-item dropup dropdown" ng-if="::ctrl.isSignedIn"> -->
<!-- <a class="sidemenu-link" href="profile"> -->
<!-- <span class="icon-circle sidemenu-icon sidemenu-org-avatar"> -->
<!-- <img ng-src="{{::ctrl.user.gravatarUrl}}"> -->
<!-- <span class="sidemenu-org-avatar--missing"> -->
<!-- <i class="fa fa-fw fa-user"></i> -->
<!-- </span> -->
<!-- </span> -->
<!-- </a> -->
<!-- <ul class="dropdown-menu dropdown-menu--sidemenu dropup" role="menu"> -->
<!-- <li ng-repeat="menuItem in ctrl.profileNav.children" ng-class="::menuItem.cssClass" ng-hide="menuItem.hideFromMenu"> -->
<!-- <a href="{{::menuItem.url}}" ng-show="::menuItem.url" target="{{::menuItem.target}}"> -->
<!-- <i class="{{::menuItem.icon}}" ng-show="::menuItem.icon"></i> -->
<!-- {{::menuItem.text}} -->
<!-- </a> -->
<!-- </li> -->
<!-- <li class="side-menu-header"> -->
<!-- <span class="sidemenu-item-text">{{::ctrl.user.name}}</span> -->
<!-- </li> -->
<!-- </ul> -->
<!-- </div> -->
<!-- -->
<!-- <div class="sidemenu-item dropdown dropup"> -->
<!-- <a href="http://docs.grafana.org" class="sidemenu-link" target="_blank"> -->
<!-- <span class="icon-circle sidemenu-icon"><i class="fa fa-fw fa-question"></i></span> -->
<!-- </a> -->
<!-- <ul class="dropdown-menu dropdown-menu--sidemenu" role="menu"> -->
<!-- <li ng-repeat="menuItem in ctrl.helpNav.children" ng-class="::menuItem.cssClass" ng-hide="menuItem.hideFromMenu"> -->
<!-- <a href="{{::menuItem.url}}" ng-show="::menuItem.url" target="{{::menuItem.target}}"> -->
<!-- <i class="{{::menuItem.icon}}" ng-show="::menuItem.icon"></i> -->
<!-- {{::menuItem.text}} -->
<!-- </a> -->
<!-- </li> -->
<!-- <li class="side-menu-header"> -->
<!-- <span class="sidemenu-item-text">Help</span> -->
<!-- </li> -->
<!-- </ul> -->
<!-- </div> -->
</div>
</div>
public/app/core/components/sidemenu/sidemenu.ts
View file @
54057363
...
@@ -9,7 +9,7 @@ export class SideMenuCtrl {
...
@@ -9,7 +9,7 @@ export class SideMenuCtrl {
isSignedIn
:
boolean
;
isSignedIn
:
boolean
;
user
:
any
;
user
:
any
;
mainLinks
:
any
;
mainLinks
:
any
;
profile
Nav
:
any
;
bottom
Nav
:
any
;
appSubUrl
:
string
;
appSubUrl
:
string
;
loginUrl
:
string
;
loginUrl
:
string
;
orgFilter
:
string
;
orgFilter
:
string
;
...
@@ -23,8 +23,8 @@ export class SideMenuCtrl {
...
@@ -23,8 +23,8 @@ export class SideMenuCtrl {
this
.
user
=
contextSrv
.
user
;
this
.
user
=
contextSrv
.
user
;
this
.
appSubUrl
=
config
.
appSubUrl
;
this
.
appSubUrl
=
config
.
appSubUrl
;
this
.
maxShownOrgs
=
10
;
this
.
maxShownOrgs
=
10
;
this
.
mainLinks
=
_
.
filter
(
config
.
bootData
.
navTree
,
item
=>
item
.
id
!==
'profile'
);
this
.
mainLinks
=
_
.
filter
(
config
.
bootData
.
navTree
,
item
=>
!
item
.
hideFromMenu
);
this
.
profileNav
=
_
.
find
(
config
.
bootData
.
navTree
,
{
id
:
'profile'
}
);
this
.
bottomNav
=
_
.
filter
(
config
.
bootData
.
navTree
,
item
=>
item
.
hideFromMenu
);
this
.
loginUrl
=
'login?redirect='
+
encodeURIComponent
(
this
.
$location
.
path
());
this
.
loginUrl
=
'login?redirect='
+
encodeURIComponent
(
this
.
$location
.
path
());
this
.
$scope
.
$on
(
'$routeChangeSuccess'
,
()
=>
{
this
.
$scope
.
$on
(
'$routeChangeSuccess'
,
()
=>
{
...
...
public/sass/components/_query_editor.scss
View file @
54057363
.query-keyword
{
.query-keyword
{
font-weight
:
bold
;
font-weight
:
$font-weight-semi-
bold
;
color
:
$blue
;
color
:
$blue
;
}
}
...
...
public/sass/components/_search.scss
View file @
54057363
...
@@ -65,7 +65,7 @@
...
@@ -65,7 +65,7 @@
max-width
:
1100px
;
max-width
:
1100px
;
visibility
:
none
;
visibility
:
none
;
opacity
:
0
;
opacity
:
0
;
height
:
100
%
;
height
:
65
%
;
&
--fade-in
{
&
--fade-in
{
visibility
:
visible
;
visibility
:
visible
;
...
@@ -75,7 +75,7 @@
...
@@ -75,7 +75,7 @@
}
}
.search-results-container
{
.search-results-container
{
height
:
9
0%
;
height
:
10
0%
;
overflow
:
auto
;
overflow
:
auto
;
display
:
block
;
display
:
block
;
line-height
:
28px
;
line-height
:
28px
;
...
...
public/sass/layout/_page.scss
View file @
54057363
...
@@ -58,7 +58,16 @@
...
@@ -58,7 +58,16 @@
font-size
:
$font-size-h2
;
font-size
:
$font-size-h2
;
flex-grow
:
1
;
flex-grow
:
1
;
display
:
inline-block
;
display
:
inline-block
;
margin-bottom
:
2rem
;
margin-bottom
:
1rem
;
img
{
width
:
30px
;
height
:
30px
;
border-radius
:
50%
;
margin-right
:
0
.5rem
;
position
:
relative
;
top
:
-3px
;
}
}
}
a
,
button
{
a
,
button
{
...
...
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