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
1bb5a570
Commit
1bb5a570
authored
Jul 27, 2018
by
Patrick O'Carroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
frontend part with mock-team-list
parent
0550ec6d
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
2 deletions
+34
-2
public/app/features/org/partials/profile.html
+19
-2
public/app/features/org/profile_ctrl.ts
+15
-0
No files found.
public/app/features/org/partials/profile.html
View file @
1bb5a570
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<div
class=
"gf-form max-width-30"
>
<div
class=
"gf-form max-width-30"
>
<span
class=
"gf-form-label width-8"
>
Name
</span>
<span
class=
"gf-form-label width-8"
>
Name
</span>
<input
class=
"gf-form-input max-width-22"
type=
"text"
required
ng-model=
"ctrl.user.name"
>
<input
class=
"gf-form-input max-width-22"
type=
"text"
required
ng-model=
"ctrl.user.name"
>
</div>
</div>
<div
class=
"gf-form max-width-30"
>
<div
class=
"gf-form max-width-30"
>
<span
class=
"gf-form-label width-8"
>
Email
</span>
<span
class=
"gf-form-label width-8"
>
Email
</span>
...
@@ -26,6 +26,24 @@
...
@@ -26,6 +26,24 @@
<prefs-control
mode=
"user"
></prefs-control>
<prefs-control
mode=
"user"
></prefs-control>
<h3
class=
"page-heading"
>
Teams
</h3>
<div
class=
"gf-form-group"
ng-show=
"ctrl.showTeamsList"
>
<table
class=
"filter-table form-inline"
>
<thead>
<tr>
<th>
Name
</th>
<th>
Email
</th>
</tr>
</thead>
<tbody>
<tr
ng-repeat=
"team in ctrl.user.teams"
>
<td>
{{team.name}}
</td>
<td>
{{team.email}}
</td>
</tr>
</tbody>
</table>
</div>
<h3
class=
"page-heading"
ng-show=
"ctrl.showOrgsList"
>
Organizations
</h3>
<h3
class=
"page-heading"
ng-show=
"ctrl.showOrgsList"
>
Organizations
</h3>
<div
class=
"gf-form-group"
ng-show=
"ctrl.showOrgsList"
>
<div
class=
"gf-form-group"
ng-show=
"ctrl.showOrgsList"
>
<table
class=
"filter-table form-inline"
>
<table
class=
"filter-table form-inline"
>
...
@@ -52,4 +70,3 @@
...
@@ -52,4 +70,3 @@
</tbody>
</tbody>
</table>
</table>
</div>
</div>
public/app/features/org/profile_ctrl.ts
View file @
1bb5a570
...
@@ -4,8 +4,10 @@ import { coreModule } from 'app/core/core';
...
@@ -4,8 +4,10 @@ import { coreModule } from 'app/core/core';
export
class
ProfileCtrl
{
export
class
ProfileCtrl
{
user
:
any
;
user
:
any
;
old_theme
:
any
;
old_theme
:
any
;
teams
:
any
=
[];
orgs
:
any
=
[];
orgs
:
any
=
[];
userForm
:
any
;
userForm
:
any
;
showTeamsList
=
false
;
showOrgsList
=
false
;
showOrgsList
=
false
;
readonlyLoginFields
=
config
.
disableLoginForm
;
readonlyLoginFields
=
config
.
disableLoginForm
;
navModel
:
any
;
navModel
:
any
;
...
@@ -13,6 +15,7 @@ export class ProfileCtrl {
...
@@ -13,6 +15,7 @@ export class ProfileCtrl {
/** @ngInject **/
/** @ngInject **/
constructor
(
private
backendSrv
,
private
contextSrv
,
private
$location
,
navModelSrv
)
{
constructor
(
private
backendSrv
,
private
contextSrv
,
private
$location
,
navModelSrv
)
{
this
.
getUser
();
this
.
getUser
();
this
.
getUserTeams
();
this
.
getUserOrgs
();
this
.
getUserOrgs
();
this
.
navModel
=
navModelSrv
.
getNav
(
'profile'
,
'profile-settings'
,
0
);
this
.
navModel
=
navModelSrv
.
getNav
(
'profile'
,
'profile-settings'
,
0
);
}
}
...
@@ -24,6 +27,18 @@ export class ProfileCtrl {
...
@@ -24,6 +27,18 @@ export class ProfileCtrl {
});
});
}
}
getUserTeams
()
{
console
.
log
(
this
.
backendSrv
.
get
(
'/api/teams'
));
this
.
backendSrv
.
get
(
'/api/user'
).
then
(
teams
=>
{
this
.
user
.
teams
=
[
{
name
:
'Backend'
,
email
:
'backend@grafana.com'
,
members
:
2
},
{
name
:
'Frontend'
,
email
:
'frontend@grafana.com'
,
members
:
2
},
{
name
:
'Ops'
,
email
:
'ops@grafana.com'
,
members
:
2
},
];
this
.
showTeamsList
=
this
.
user
.
teams
.
length
>
1
;
});
}
getUserOrgs
()
{
getUserOrgs
()
{
this
.
backendSrv
.
get
(
'/api/user/orgs'
).
then
(
orgs
=>
{
this
.
backendSrv
.
get
(
'/api/user/orgs'
).
then
(
orgs
=>
{
this
.
orgs
=
orgs
;
this
.
orgs
=
orgs
;
...
...
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