mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
fix(alerting): added confirm modal in UI, when deleting alert
This commit is contained in:
parent
24a25453f6
commit
fe4a0a98c1
@ -144,7 +144,6 @@ func (e *Engine) handleResponse(result *EvalContext) {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
e.log.Info("rule", "nil", result.Rule == nil)
|
|
||||||
e.log.Debug("Alert Rule Result", "ruleId", result.Rule.Id, "firing", result.Firing)
|
e.log.Debug("Alert Rule Result", "ruleId", result.Rule.Id, "firing", result.Firing)
|
||||||
e.resultHandler.Handle(result)
|
e.resultHandler.Handle(result)
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,7 @@ import {QueryPart} from 'app/core/components/query_part/query_part';
|
|||||||
import alertDef from './alert_def';
|
import alertDef from './alert_def';
|
||||||
import config from 'app/core/config';
|
import config from 'app/core/config';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
import appEvents from 'app/core/app_events';
|
||||||
|
|
||||||
export class AlertTabCtrl {
|
export class AlertTabCtrl {
|
||||||
panel: any;
|
panel: any;
|
||||||
@ -302,11 +303,21 @@ export class AlertTabCtrl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
delete() {
|
delete() {
|
||||||
|
appEvents.emit('confirm-modal', {
|
||||||
|
title: 'Delete Alert',
|
||||||
|
text: 'Are you sure you want to delete this alert rule?',
|
||||||
|
text2: 'You need to save dashboard for the delete to take effect',
|
||||||
|
icon: 'fa-trash',
|
||||||
|
yesText: 'Delete',
|
||||||
|
onConfirm: () => {
|
||||||
this.alert = this.panel.alert = {enabled: false};
|
this.alert = this.panel.alert = {enabled: false};
|
||||||
this.panel.thresholds = [];
|
this.panel.thresholds = [];
|
||||||
this.conditionModels = [];
|
this.conditionModels = [];
|
||||||
this.panelCtrl.render();
|
this.panelCtrl.render();
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
enable() {
|
enable() {
|
||||||
this.alert.enabled = true;
|
this.alert.enabled = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user