mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 10:03:33 -06:00
34 lines
781 B
TypeScript
34 lines
781 B
TypeScript
|
///<reference path="../../headers/common.d.ts" />
|
||
|
|
||
|
import angular from 'angular';
|
||
|
import _ from 'lodash';
|
||
|
import coreModule from '../../core/core_module';
|
||
|
import config from 'app/core/config';
|
||
|
|
||
|
export class AlertLogCtrl {
|
||
|
|
||
|
alertLogs: any;
|
||
|
alert: any;
|
||
|
alertId: any;
|
||
|
|
||
|
/** @ngInject */
|
||
|
constructor(private $route, private backendSrv) {
|
||
|
if ($route.current.params.alertId) {
|
||
|
this.alertId = $route.current.params.alertId;
|
||
|
this.loadAlertLogs();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
loadAlertLogs() {
|
||
|
this.backendSrv.get('/api/alerts/events/' + this.alertId).then(result => {
|
||
|
this.alertLogs = result;
|
||
|
});
|
||
|
|
||
|
this.backendSrv.get('/api/alerts/' + this.alertId).then(result => {
|
||
|
this.alert = result;
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
|
||
|
coreModule.controller('AlertLogCtrl', AlertLogCtrl);
|