Commit 65ce01fb by Torkel Ödegaard

feat(alerting): fixing failing typescript build

parent fe9d591b
# New Grafana Release Processes
## Building release packages
1) Update package.json so that it has the right version.
2) Packages from master a built automatically by circle CI for this repo [grafana/grafana-packer](https://github.com/grafana/grafana-packer)
### Non master branch
When building from non master branch create a new branch in repo [grafana/grafana-packer](https://github.com/grafana/grafana-packer)
and configure circle.yml to deploy that branch as well, https://github.com/grafana/grafana-packer/blob/master/circle.yml#L25
///<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';
import alertDef from './alert_def';
import moment from 'moment';
export class AlertLogCtrl {
alertLogs: any;
alert: any;
/** @ngInject */
constructor(private $route, private backendSrv) {
if ($route.current.params.alertId) {
this.loadAlertLogs($route.current.params.alertId);
}
}
loadAlertLogs(alertId: number) {
this.backendSrv.get(`/api/alerts/${alertId}/states`).then(result => {
this.alertLogs = _.map(result, log => {
log.iconCss = alertDef.getSeverityIconClass(log.severity);
log.humanTime = moment(log.created).format("YYYY-MM-DD HH:mm:ss");
return log;
});
});
this.backendSrv.get(`/api/alerts/${alertId}`).then(result => {
this.alert = result;
});
}
}
coreModule.controller('AlertLogCtrl', AlertLogCtrl);
import './alert_list_ctrl';
import './alert_log_ctrl';
import './notifications_list_ctrl';
import './notification_edit_ctrl';
<navbar icon="fa fa-fw fa-list" title="Alerts" title-url="alerting">
</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">Status</th>
<th style="width: 160px">Time</th>
<th>Description</th>
</thead>
<tr ng-repeat="alertLog in ctrl.alertLogs">
<td>
<i class="icon-gf {{alertLog.iconCss}}"></i>
</td>
<td>
{{alertLog.humanTime}}
</td>
<td>
{{alertLog.info}}
</td>
</tr>
</table>
</div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment