mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
tech: added prettier to precommit
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
///<reference path="../../headers/common.d.ts" />
|
||||
|
||||
import coreModule from 'app/core/core_module';
|
||||
import {appEvents} from 'app/core/core';
|
||||
import coreModule from "app/core/core_module";
|
||||
import { appEvents } from "app/core/core";
|
||||
|
||||
export class TeamsCtrl {
|
||||
teams: any;
|
||||
@@ -10,18 +10,23 @@ export class TeamsCtrl {
|
||||
page = 1;
|
||||
totalPages: number;
|
||||
showPaging = false;
|
||||
query: any = '';
|
||||
query: any = "";
|
||||
navModel: any;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private backendSrv, navModelSrv) {
|
||||
this.navModel = navModelSrv.getNav('cfg', 'teams', 0);
|
||||
this.navModel = navModelSrv.getNav("cfg", "teams", 0);
|
||||
this.get();
|
||||
}
|
||||
|
||||
get() {
|
||||
this.backendSrv.get(`/api/teams/search?perpage=${this.perPage}&page=${this.page}&query=${this.query}`)
|
||||
.then((result) => {
|
||||
this.backendSrv
|
||||
.get(
|
||||
`/api/teams/search?perpage=${this.perPage}&page=${this.page}&query=${
|
||||
this.query
|
||||
}`
|
||||
)
|
||||
.then(result => {
|
||||
this.teams = result.teams;
|
||||
this.page = result.page;
|
||||
this.perPage = result.perPage;
|
||||
@@ -29,8 +34,8 @@ export class TeamsCtrl {
|
||||
this.showPaging = this.totalPages > 1;
|
||||
this.pages = [];
|
||||
|
||||
for (var i = 1; i < this.totalPages+1; i++) {
|
||||
this.pages.push({ page: i, current: i === this.page});
|
||||
for (var i = 1; i < this.totalPages + 1; i++) {
|
||||
this.pages.push({ page: i, current: i === this.page });
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -41,9 +46,9 @@ export class TeamsCtrl {
|
||||
}
|
||||
|
||||
deleteTeam(team) {
|
||||
appEvents.emit('confirm-modal', {
|
||||
title: 'Delete',
|
||||
text: 'Are you sure you want to delete Team ' + team.name + '?',
|
||||
appEvents.emit("confirm-modal", {
|
||||
title: "Delete",
|
||||
text: "Are you sure you want to delete Team " + team.name + "?",
|
||||
yesText: "Delete",
|
||||
icon: "fa-warning",
|
||||
onConfirm: () => {
|
||||
@@ -53,16 +58,15 @@ export class TeamsCtrl {
|
||||
}
|
||||
|
||||
deleteTeamConfirmed(team) {
|
||||
this.backendSrv.delete('/api/teams/' + team.id)
|
||||
.then(this.get.bind(this));
|
||||
this.backendSrv.delete("/api/teams/" + team.id).then(this.get.bind(this));
|
||||
}
|
||||
|
||||
openTeamModal() {
|
||||
appEvents.emit('show-modal', {
|
||||
templateHtml: '<create-team-modal></create-team-modal>',
|
||||
modalClass: 'modal--narrow'
|
||||
appEvents.emit("show-modal", {
|
||||
templateHtml: "<create-team-modal></create-team-modal>",
|
||||
modalClass: "modal--narrow"
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
coreModule.controller('TeamsCtrl', TeamsCtrl);
|
||||
coreModule.controller("TeamsCtrl", TeamsCtrl);
|
||||
|
||||
Reference in New Issue
Block a user