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
bbbd3320
Commit
bbbd3320
authored
Feb 25, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created seperate admin sidenav #1506
parent
32450640
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
143 additions
and
70 deletions
+143
-70
src/app/controllers/sidemenuCtrl.js
+77
-31
src/app/features/admin/partials/orgs.html
+15
-0
src/app/features/admin/partials/settings.html
+2
-7
src/app/features/admin/partials/users.html
+2
-3
src/app/features/org/partials/orgDetails.html
+2
-2
src/app/partials/sidemenu.html
+11
-27
src/app/routes/backend/all.js
+3
-0
src/css/less/sidemenu.less
+31
-0
No files found.
src/app/controllers/sidemenuCtrl.js
View file @
bbbd3320
...
...
@@ -15,55 +15,101 @@ function (angular, _, $, config) {
return
config
.
appSubUrl
+
url
;
};
$scope
.
mainLinks
=
[];
$scope
.
mainLinks
.
push
({
text
:
"Dashboards"
,
icon
:
"fa fa-fw fa-th-large"
,
href
:
$scope
.
getUrl
(
"/"
),
});
if
(
contextSrv
.
hasRole
(
'Admin'
))
{
$scope
.
setupMainNav
=
function
()
{
$scope
.
mainLinks
.
push
({
text
:
"Da
ta Source
s"
,
icon
:
"fa fa-fw fa-
databas
e"
,
href
:
$scope
.
getUrl
(
"/
datasources
"
),
text
:
"Da
shboard
s"
,
icon
:
"fa fa-fw fa-
th-larg
e"
,
href
:
$scope
.
getUrl
(
"/"
),
});
}
$scope
.
bottomLinks
=
[];
if
(
contextSrv
.
user
.
isSignedIn
)
{
$scope
.
bottomLinks
.
push
({
text
:
contextSrv
.
user
.
name
,
imgSrc
:
contextSrv
.
user
.
gravatarUrl
,
href
:
$scope
.
getUrl
(
"/profile"
),
}
);
if
(
contextSrv
.
hasRole
(
'Admin'
))
{
$scope
.
mainLinks
.
push
(
{
text
:
"Data Sources"
,
icon
:
"fa fa-fw fa-database"
,
href
:
$scope
.
getUrl
(
"/datasources"
)
,
});
}
$scope
.
bottomLinks
.
push
({
text
:
contextSrv
.
user
.
orgName
,
href
:
$scope
.
getUrl
(
"/org"
),
icon
:
"fa fa-fw fa-users"
,
});
if
(
contextSrv
.
user
.
isSignedIn
)
{
$scope
.
bottomLinks
.
push
({
text
:
contextSrv
.
user
.
name
,
imgSrc
:
contextSrv
.
user
.
gravatarUrl
,
href
:
$scope
.
getUrl
(
"/profile"
),
});
$scope
.
bottomLinks
.
push
({
text
:
contextSrv
.
user
.
orgName
,
href
:
$scope
.
getUrl
(
"/org"
),
icon
:
"fa fa-fw fa-users"
,
});
if
(
contextSrv
.
hasRole
(
'Admin'
))
{
$scope
.
bottomLinks
.
push
({
text
:
"Grafana admin"
,
icon
:
"fa fa-fw fa-cog"
,
href
:
$scope
.
getUrl
(
"/admin/settings"
),
});
}
if
(
contextSrv
.
hasRole
(
'Admin'
))
{
$scope
.
bottomLinks
.
push
({
text
:
"S
ystem admin
"
,
icon
:
"fa fa-fw fa-
cog
"
,
href
:
$scope
.
getUrl
(
"/
admin/settings
"
),
text
:
"S
ign out
"
,
icon
:
"fa fa-fw fa-
sign-out
"
,
href
:
$scope
.
getUrl
(
"/
logout
"
),
});
}
};
$scope
.
setupAdminNav
=
function
()
{
$scope
.
systemSection
=
true
;
$scope
.
grafanaVersion
=
config
.
buildInfo
.
version
;
$scope
.
mainLinks
.
push
({
text
:
"System info"
,
icon
:
"fa fa-fw fa-info"
,
href
:
$scope
.
getUrl
(
"/admin/settings"
),
});
$scope
.
mainLinks
.
push
({
text
:
"Global Users"
,
icon
:
"fa fa-fw fa-user"
,
href
:
$scope
.
getUrl
(
"/admin/users"
),
});
$scope
.
mainLinks
.
push
({
text
:
"Global Orgs"
,
icon
:
"fa fa-fw fa-users"
,
href
:
$scope
.
getUrl
(
"/admin/orgs"
),
});
$scope
.
bottomLinks
.
push
({
text
:
"Exit admin"
,
icon
:
"fa fa-fw fa-backward"
,
href
:
$scope
.
getUrl
(
"/"
),
});
$scope
.
bottomLinks
.
push
({
text
:
"Sign out"
,
icon
:
"fa fa-fw fa-sign-out"
,
href
:
$scope
.
getUrl
(
"/logout"
),
});
}
}
;
$scope
.
updateState
=
function
()
{
$scope
.
updateMenu
=
function
()
{
$scope
.
systemSection
=
false
;
$scope
.
mainLinks
=
[];
$scope
.
bottomLinks
=
[];
var
currentPath
=
$location
.
path
();
if
(
currentPath
.
indexOf
(
'/admin'
)
===
0
)
{
$scope
.
setupAdminNav
();
}
else
{
$scope
.
setupMainNav
();
}
};
$scope
.
init
=
function
()
{
$scope
.
updateState
();
$scope
.
updateMenu
();
$scope
.
$on
(
'$routeChangeSuccess'
,
$scope
.
updateMenu
);
};
});
...
...
src/app/features/admin/partials/orgs.html
0 → 100644
View file @
bbbd3320
<topnav
icon=
"fa fa-fw fa-users"
title=
"Global Orgs"
subnav=
"true"
>
<ul
class=
"nav"
>
<li
class=
"active"
><a
href=
"admin/users"
>
Overview
</a></li>
</ul>
</topnav>
<div
class=
"page-container"
>
<div
class=
"page"
>
<h2>
Organizations
</h2>
View not implemented yet...
</div>
</div>
src/app/features/admin/partials/settings.html
View file @
bbbd3320
<topnav
icon=
"fa fa-fw fa-cogs"
title=
"System Admin"
subnav=
"true"
>
<ul
class=
"nav"
>
<li
class=
"active"
><a
href=
"admin/settings"
>
Settings
</a></li>
<li><a
href=
"admin/users"
>
Users
</a></li>
<li><a
href=
"admin/users/create"
>
Create user
</a></li>
</ul>
<topnav
icon=
"fa fa-fw fa-info"
title=
"System info"
>
</topnav>
<div
class=
"page-container"
>
<div
class=
"page"
>
<h2>
System
settings
System
information
</h2>
<div
class=
"grafana-info-box span8"
style=
"margin: 20px 0 25px 0"
>
...
...
src/app/features/admin/partials/users.html
View file @
bbbd3320
<topnav
icon=
"fa fa-fw fa-
cogs"
title=
"System Admin
"
subnav=
"true"
>
<topnav
icon=
"fa fa-fw fa-
user"
title=
"Global users
"
subnav=
"true"
>
<ul
class=
"nav"
>
<li><a
href=
"admin/settings"
>
Settings
</a></li>
<li
class=
"active"
><a
href=
"admin/users"
>
Users
</a></li>
<li
class=
"active"
><a
href=
"admin/users"
>
Overview
</a></li>
<li><a
href=
"admin/users/create"
>
Create user
</a></li>
</ul>
</topnav>
...
...
src/app/features/org/partials/orgDetails.html
View file @
bbbd3320
...
...
@@ -10,7 +10,7 @@
<h2>
Organization Details
</h2>
<form
name=
"
account
Form"
>
<form
name=
"
org
Form"
>
<div>
<div
class=
"tight-form"
>
<ul
class=
"tight-form-list"
>
...
...
@@ -32,7 +32,7 @@
API Keys
</h2>
<div
ng-controller=
"ApiKeysCtrl"
>
<div
ng-controller=
"
Org
ApiKeysCtrl"
>
<form
name=
"addTokenrForm"
class=
"form-inline tight-form last"
>
<ul
class=
"tight-form-list"
>
<li
class=
"tight-form-item"
style=
"width: 100px"
>
...
...
src/app/partials/sidemenu.html
View file @
bbbd3320
...
...
@@ -9,6 +9,16 @@
</a>
</li>
<li
class=
"sidemenu-system-section"
ng-if=
"systemSection"
>
<div
class=
"sidemenu-system-section-inner"
>
<i
class=
"fa fa-fw fa-cubes"
></i>
<div
class=
"sidemenu-section-text-wrapper"
>
<div
class=
"sidemenu-section-heading"
>
Grafana Admin
</div>
<div
class=
"sidemenu-section-tagline"
>
v {{grafanaVersion}}
</div>
</div>
</div>
</li>
<li
ng-repeat=
"item in mainLinks"
>
<a
href=
"{{item.href}}"
class=
"sidemenu-item"
target=
"{{item.target}}"
>
<span
class=
"icon-circle sidemenu-icon"
><i
class=
"{{item.icon}}"
></i></span>
...
...
@@ -18,13 +28,7 @@
</ul>
<ul
class=
"sidemenu sidemenu-small"
style=
"margin-top:50px"
>
<!-- <li> -->
<!-- <a href="profile" class="sidemenu-item sidemenu-user"> -->
<!-- <img ng-src="{{contextSrv.user.gravatarUrl}}"> -->
<!-- <span class="sidemenu-item-text">{{contextSrv.user.name}}</a> -->
<!-- </a> -->
<!-- </li> -->
<!-- -->
<li
ng-repeat=
"item in bottomLinks"
>
<a
href=
"{{item.href}}"
class=
"sidemenu-item"
target=
"{{item.target}}"
>
<img
ng-if=
"item.imgSrc"
ng-src=
"{{item.imgSrc}}"
>
...
...
@@ -33,25 +37,5 @@
</a>
</li>
<!-- <li ng-if="contextSrv.user.isGrafanaAdmin"> -->
<!-- <a href="admin/settings" class="sidemenu-item"> -->
<!-- <span class="icon-circle sidemenu-icon"><i class="fa fw-fw fa-cogs"></i></span> -->
<!-- <span class="sidemenu-item-text">System Admin</span> -->
<!-- </a> -->
<!-- </li> -->
<!-- -->
<!-- <li> -->
<!-- <a href="logout" class="sidemenu-item" target="_self"> -->
<!-- <span class="icon-circle sidemenu-icon"><i class="fa fa-fw fa-sign-out"></i></span> -->
<!-- <span class="sidemenu-item-text">Sign out</span> -->
<!-- </a> -->
<!-- </li> -->
<!-- -->
<!-- <li ng-if="!contextSrv.user.isSignedIn" style="margin-top:50px"> -->
<!-- <a href="/login" class="sidemenu-item" target="_self"> -->
<!-- <span class="sidemenu-icon"><i class="fa fa-fw fa-sign-in"></i></span> -->
<!-- <span class="sidemenu-item-text">Sign in</span> -->
<!-- </a> -->
<!-- </li> -->
</ul>
</div>
src/app/routes/backend/all.js
View file @
bbbd3320
...
...
@@ -82,6 +82,9 @@ define([
templateUrl
:
'app/features/admin/partials/edit_user.html'
,
controller
:
'AdminEditUserCtrl'
,
})
.
when
(
'/admin/orgs'
,
{
templateUrl
:
'app/features/admin/partials/orgs.html'
,
})
.
when
(
'/login'
,
{
templateUrl
:
'app/partials/login.html'
,
controller
:
'LoginCtrl'
,
...
...
src/css/less/sidemenu.less
View file @
bbbd3320
...
...
@@ -138,4 +138,35 @@
}
}
.sidemenu-system-section {
background-color: @blueDark;
color: @white;
padding: 3px 0;
margin-left: 10px;
margin-right: 10px;
border-radius: 2px;
.sidemenu-system-section-inner {
border: 2px solid black;
border-left: none;
border-right: none;
padding: 4px;
overflow: hidden;
}
.fa {
float: left;
font-size: 120%;
line-height: 41px;
padding: 0 15px;
}
}
.sidemenu-section-tagline {
font-style: italic;
font-size: 75%;
line-height: 10px;
}
.sidemenu-section-text-wrapper {
padding-top: 4px;
}
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