mirror of https://github.com/grafana/grafana
parent
5bc3672296
commit
ecfbc2edca
@ -0,0 +1,33 @@ |
||||
///<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); |
||||
@ -1,2 +1,3 @@ |
||||
import './alerts_ctrl'; |
||||
import './alert_log_ctrl'; |
||||
|
||||
|
||||
@ -0,0 +1,29 @@ |
||||
<navbar icon="fa fa-fw fa-list" title="Alerts" title-url="alerts"> |
||||
</navbar> |
||||
|
||||
<div class="page-container" > |
||||
<div class="page-header"> |
||||
<h1>Alert history for {{ctrl.alert.title}}</h1> |
||||
</div> |
||||
|
||||
<table class="filter-table"> |
||||
<thead> |
||||
<th style="width: 68px"></th> |
||||
<th><strong>Time</strong></th> |
||||
<th>Description</th> |
||||
</thead> |
||||
<tr ng-repeat="alertLog in ctrl.alertLogs"> |
||||
<td> |
||||
{{alertLog.newState}} |
||||
</td> |
||||
<td> |
||||
{{alertLog.created}} |
||||
</td> |
||||
<td> |
||||
{{alertLog.info}} |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
</div> |
||||
|
||||
|
||||
Loading…
Reference in new issue