mirror of
https://github.com/grafana/grafana.git
synced 2025-02-09 23:16:16 -06:00
feat(alerting): restored alert history
This commit is contained in:
parent
b0c7e61ef8
commit
3af891d023
@ -53,8 +53,10 @@ func (r *SqlAnnotationRepo) Find(query *annotations.ItemQuery) ([]*annotations.I
|
||||
params = append(params, query.PanelId)
|
||||
}
|
||||
|
||||
sql.WriteString(` AND epoch BETWEEN ? AND ?`)
|
||||
params = append(params, query.From, query.To)
|
||||
if query.From > 0 && query.To > 0 {
|
||||
sql.WriteString(` AND epoch BETWEEN ? AND ?`)
|
||||
params = append(params, query.From, query.To)
|
||||
}
|
||||
|
||||
if query.Type != "" {
|
||||
sql.WriteString(` AND type = ?`)
|
||||
|
@ -86,7 +86,7 @@ export class AlertTabCtrl {
|
||||
}
|
||||
|
||||
getAlertHistory() {
|
||||
this.backendSrv.get(`/api/alert-history?dashboardId=${this.panelCtrl.dashboard.id}&panelId=${this.panel.id}&limit=50`).then(res => {
|
||||
this.backendSrv.get(`/api/annotations?dashboardId=${this.panelCtrl.dashboard.id}&panelId=${this.panel.id}&limit=50`).then(res => {
|
||||
this.alertHistory = _.map(res, ah => {
|
||||
ah.time = moment(ah.timestamp).format('MMM D, YYYY HH:mm:ss');
|
||||
ah.stateModel = alertDef.getStateDisplayModel(ah.newState);
|
||||
|
@ -27,11 +27,10 @@
|
||||
<div class="gf-form-group">
|
||||
<h5 class="section-heading">Alert Config</h5>
|
||||
<div class="gf-form">
|
||||
<span class="gf-form-label width-8">Name</span>
|
||||
<input type="text" class="gf-form-input width-25" ng-model="ctrl.alert.name">
|
||||
<span class="gf-form-label width-8">Evaluate every</span>
|
||||
<span class="gf-form-label width-6">Name</span>
|
||||
<input type="text" class="gf-form-input width-20" ng-model="ctrl.alert.name">
|
||||
<span class="gf-form-label">Evaluate every</span>
|
||||
<input class="gf-form-input max-width-5" type="text" ng-model="ctrl.alert.frequency"></input>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user