mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
frontend part with mock-team-list
This commit is contained in:
parent
0550ec6de1
commit
1bb5a57036
@ -26,6 +26,24 @@
|
||||
|
||||
<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>
|
||||
<div class="gf-form-group" ng-show="ctrl.showOrgsList">
|
||||
<table class="filter-table form-inline">
|
||||
@ -52,4 +70,3 @@
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -4,8 +4,10 @@ import { coreModule } from 'app/core/core';
|
||||
export class ProfileCtrl {
|
||||
user: any;
|
||||
old_theme: any;
|
||||
teams: any = [];
|
||||
orgs: any = [];
|
||||
userForm: any;
|
||||
showTeamsList = false;
|
||||
showOrgsList = false;
|
||||
readonlyLoginFields = config.disableLoginForm;
|
||||
navModel: any;
|
||||
@ -13,6 +15,7 @@ export class ProfileCtrl {
|
||||
/** @ngInject **/
|
||||
constructor(private backendSrv, private contextSrv, private $location, navModelSrv) {
|
||||
this.getUser();
|
||||
this.getUserTeams();
|
||||
this.getUserOrgs();
|
||||
this.navModel = navModelSrv.getNav('profile', 'profile-settings', 0);
|
||||
}
|
||||
@ -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() {
|
||||
this.backendSrv.get('/api/user/orgs').then(orgs => {
|
||||
this.orgs = orgs;
|
||||
|
Loading…
Reference in New Issue
Block a user