mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Merge branch 'v3.1.x'
This commit is contained in:
@@ -16,7 +16,7 @@ export class AlertSrv {
|
||||
|
||||
init() {
|
||||
this.$rootScope.onAppEvent('alert-error', (e, alert) => {
|
||||
this.set(alert[0], alert[1], 'error', 0);
|
||||
this.set(alert[0], alert[1], 'error', 7000);
|
||||
}, this.$rootScope);
|
||||
|
||||
this.$rootScope.onAppEvent('alert-warning', (e, alert) => {
|
||||
@@ -27,10 +27,21 @@ export class AlertSrv {
|
||||
this.set(alert[0], alert[1], 'success', 3000);
|
||||
}, this.$rootScope);
|
||||
|
||||
appEvents.on('alert-error', options => {
|
||||
this.set(options[0], options[1], 'error', 7000);
|
||||
});
|
||||
|
||||
appEvents.on('confirm-modal', this.showConfirmModal.bind(this));
|
||||
}
|
||||
|
||||
set(title, text, severity, timeout) {
|
||||
if (_.isObject(text)) {
|
||||
console.log('alert error', text);
|
||||
if (text.statusText) {
|
||||
text = `HTTP Error (${text.status}) ${text.statusText}`;
|
||||
}
|
||||
}
|
||||
|
||||
var newAlert = {
|
||||
title: title || '',
|
||||
text: text || '',
|
||||
|
||||
Reference in New Issue
Block a user