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
5b93e097
Commit
5b93e097
authored
Jan 15, 2015
by
Torkel Ödegaard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Very basic start for accounts admin view
parent
cf344abf
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
110 additions
and
6 deletions
+110
-6
src/app/controllers/sideMenuCtrl.js
+40
-0
src/app/features/admin/accountsCtrl.js
+26
-0
src/app/features/admin/partials/accounts.html
+37
-0
src/app/features/all.js
+1
-1
src/app/partials/sidemenu.html
+1
-1
src/app/routes/backend/all.js
+3
-3
src/css/less/tables_lists.less
+2
-1
No files found.
src/app/controllers/sideMenuCtrl.js
0 → 100644
View file @
5b93e097
define
([
'angular'
,
'config'
,
],
function
(
angular
,
config
)
{
'use strict'
;
var
module
=
angular
.
module
(
'grafana.controllers'
);
module
.
controller
(
'SideMenuCtrl'
,
function
(
$scope
)
{
$scope
.
menu
=
[
{
href
:
config
.
appSubUrl
,
text
:
'Dashboards'
,
icon
:
'fa fa-th-large'
},
{
href
:
'panels'
,
text
:
'Panels'
,
icon
:
'fa fa-signal'
,
},
{
href
:
'alerts'
,
text
:
'Alerts'
,
icon
:
'fa fa-bolt'
,
},
{
href
:
'account'
,
text
:
'Account'
,
icon
:
'fa fa-user'
,
},
];
$scope
.
init
=
function
()
{
};
});
});
src/app/features/admin/accountsCtrl.js
0 → 100644
View file @
5b93e097
define
([
'angular'
,
],
function
(
angular
)
{
'use strict'
;
var
module
=
angular
.
module
(
'grafana.controllers'
);
module
.
controller
(
'AccountsCtrl'
,
function
(
$scope
,
backendSrv
)
{
$scope
.
init
=
function
()
{
$scope
.
accounts
=
[];
$scope
.
getAccounts
();
};
$scope
.
getAccounts
=
function
()
{
backendSrv
.
get
(
'/api/admin/accounts'
).
then
(
function
(
accounts
)
{
console
.
log
(
accounts
);
$scope
.
accounts
=
accounts
;
});
};
$scope
.
init
();
});
});
src/app/features/admin/partials/accounts.html
0 → 100644
View file @
5b93e097
<div
ng-include=
"'app/partials/navbar.html'"
ng-init=
"pageTitle='Accounts'"
></div>
<div
class=
"dashboard-edit-view"
style=
"min-height: 500px"
>
<div
class=
"row-fluid"
>
<div
class=
"span8"
>
<table
class=
"grafana-options-table"
>
<tr>
<th
style=
"text-align:left"
>
Id
</th>
<th>
Login
</th>
<th>
Email
</th>
<th>
Name
</th>
<th>
Admin
</th>
<th></th>
</tr>
<tr
ng-repeat=
"account in accounts"
>
<td>
{{account.id}}
</td>
<td>
{{account.login}}
</td>
<td>
{{account.email}}
</td>
<td>
{{account.name}}
</td>
<td>
{{account.isAdmin}}
</td>
<td
style=
"width: 1%"
>
<a
ng-click=
"edit(variable)"
class=
"btn btn-success"
>
<i
class=
"fa fa-edit"
></i>
Edit
</a>
<a
ng-click=
"edit(variable)"
class=
"btn btn-danger"
>
<i
class=
"fa fa-remove"
></i>
</a>
</td>
</tr>
</table>
</div>
</div>
</div>
src/app/features/all.js
View file @
5b93e097
...
...
@@ -9,6 +9,6 @@ define([
'./dashboard/all'
,
'./account/accountCtrl'
,
'./account/datasourcesCtrl'
,
'./admin/a
dmin
Ctrl'
,
'./admin/a
ccounts
Ctrl'
,
'./grafanaDatasource/datasource'
,
],
function
()
{});
src/app/partials/sidemenu.html
View file @
5b93e097
...
...
@@ -28,7 +28,7 @@
<i
class=
"fa fa-user"
></i>
Account
</a>
<a
class=
"pro-sidemenu-link"
href=
"admin"
ng-if=
"grafana.user.isAdmin"
>
<a
class=
"pro-sidemenu-link"
href=
"admin
/accounts
"
ng-if=
"grafana.user.isAdmin"
>
<i
class=
"fa fa-institution"
></i>
Admin
</a>
<a
class=
"pro-sidemenu-link"
href=
"login?logout"
>
...
...
src/app/routes/backend/all.js
View file @
5b93e097
...
...
@@ -38,9 +38,9 @@ define([
templateUrl
:
'app/features/account/partials/account.html'
,
controller
:
'AccountCtrl'
,
})
.
when
(
'/admin/'
,
{
templateUrl
:
'app/features/admin/partials/a
dmin
.html'
,
controller
:
'A
dmin
Ctrl'
,
.
when
(
'/admin/
accounts
'
,
{
templateUrl
:
'app/features/admin/partials/a
ccounts
.html'
,
controller
:
'A
ccounts
Ctrl'
,
})
.
when
(
'/login'
,
{
templateUrl
:
'app/partials/login.html'
,
...
...
src/css/less/tables_lists.less
View file @
5b93e097
...
...
@@ -5,7 +5,8 @@
background-color: @grafanaListAccent;
}
td {
td, th {
text-align: left;
padding: 5px 10px;
white-space: nowrap;
border-bottom: 1px solid @grafanaListBorderBottom;
...
...
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