mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
moving things around
This commit is contained in:
28
public/app/features/alerting/NotificationsListCtrl.ts
Normal file
28
public/app/features/alerting/NotificationsListCtrl.ts
Normal 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);
|
||||
Reference in New Issue
Block a user