moving things around

This commit is contained in:
Torkel Ödegaard
2018-09-02 07:11:21 -07:00
parent de456f8b73
commit 2ac202b22f
23 changed files with 53 additions and 34 deletions

View File

@@ -0,0 +1,28 @@
import { coreModule } from 'app/core/core';
export class AlertNotificationsListCtrl {
notifications: any;
navModel: any;
/** @ngInject */
constructor(private backendSrv, navModelSrv) {
this.loadNotifications();
this.navModel = navModelSrv.getNav('alerting', 'channels', 0);
}
loadNotifications() {
this.backendSrv.get(`/api/alert-notifications`).then(result => {
this.notifications = result;
});
}
deleteNotification(id) {
this.backendSrv.delete(`/api/alert-notifications/${id}`).then(() => {
this.notifications = this.notifications.filter(notification => {
return notification.id !== id;
});
});
}
}
coreModule.controller('AlertNotificationsListCtrl', AlertNotificationsListCtrl);