mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
moved new teams page
This commit is contained in:
26
public/app/features/teams/CreateTeamCtrl.ts
Normal file
26
public/app/features/teams/CreateTeamCtrl.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import coreModule from 'app/core/core_module';
|
||||
|
||||
export default class CreateTeamCtrl {
|
||||
name: string;
|
||||
email: string;
|
||||
navModel: any;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private backendSrv, private $location, navModelSrv) {
|
||||
this.navModel = navModelSrv.getNav('cfg', 'teams', 0);
|
||||
}
|
||||
|
||||
create() {
|
||||
const payload = {
|
||||
name: this.name,
|
||||
email: this.email,
|
||||
};
|
||||
this.backendSrv.post('/api/teams', payload).then(result => {
|
||||
if (result.teamId) {
|
||||
this.$location.path('/org/teams/edit/' + result.teamId);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
coreModule.controller('CreateTeamCtrl', CreateTeamCtrl);
|
||||
26
public/app/features/teams/partials/create_team.html
Normal file
26
public/app/features/teams/partials/create_team.html
Normal file
@@ -0,0 +1,26 @@
|
||||
<page-header model="ctrl.navModel"></page-header>
|
||||
|
||||
<div class="page-container page-body" ng-cloak>
|
||||
<h3 class="page-sub-heading">New Team</h3>
|
||||
|
||||
<form name="ctrl.saveForm" class="gf-form-group" ng-submit="ctrl.create()">
|
||||
<div class="gf-form max-width-30">
|
||||
<span class="gf-form-label width-10">Name</span>
|
||||
<input type="text" required ng-model="ctrl.name" class="gf-form-input max-width-22" give-focus="true">
|
||||
</div>
|
||||
<div class="gf-form max-width-30">
|
||||
<span class="gf-form-label width-10">
|
||||
Email
|
||||
<info-popover mode="right-normal">
|
||||
This is optional and is primarily used for allowing custom team avatars.
|
||||
</info-popover>
|
||||
</span>
|
||||
<input class="gf-form-input max-width-22" type="email" ng-model="ctrl.email" placeholder="email@test.com">
|
||||
</div>
|
||||
<div class="gf-form-button-row">
|
||||
<button type="submit" class="btn btn-success width-12">
|
||||
<i class="fa fa-save"></i> Create
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
Reference in New Issue
Block a user