mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge branch 'master' into 10277_logout_route_full_page_reload
This commit is contained in:
@@ -57,7 +57,7 @@ function popoverSrv($compile, $rootScope, $timeout) {
|
||||
openOn: options.openOn,
|
||||
hoverCloseDelay: 200,
|
||||
tetherOptions: {
|
||||
constraints: [{to: 'scrollParent', attachment: "none both"}]
|
||||
constraints: [{to: 'scrollParent', attachment: 'together'}]
|
||||
}
|
||||
});
|
||||
|
||||
@@ -79,3 +79,4 @@ function popoverSrv($compile, $rootScope, $timeout) {
|
||||
}
|
||||
|
||||
coreModule.service('popoverSrv', popoverSrv);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -53,7 +53,8 @@ module.directive('graphLegend', function(popoverSrv, $timeout) {
|
||||
$timeout(function() {
|
||||
popoverSrv.show({
|
||||
element: el[0],
|
||||
position: 'bottom center',
|
||||
position: 'bottom left',
|
||||
targetAttachment: 'top left',
|
||||
template: '<series-color-picker series="series" onToggleAxis="toggleAxis" onColorChange="colorSelected">' +
|
||||
'</series-color-picker>',
|
||||
openOn: 'hover',
|
||||
|
||||
Reference in New Issue
Block a user