mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Make alerts unique, wip
This commit is contained in:
parent
78dbf58536
commit
43f1374661
@ -11,16 +11,27 @@ angular.module('kibana.services', [])
|
|||||||
this.list = [];
|
this.list = [];
|
||||||
|
|
||||||
this.set = function(title,text,severity,timeout) {
|
this.set = function(title,text,severity,timeout) {
|
||||||
var _a = {
|
var
|
||||||
title: title || '',
|
_a = {
|
||||||
text: text || '',
|
title: title || '',
|
||||||
severity: severity || 'info',
|
text: text || '',
|
||||||
};
|
severity: severity || 'info',
|
||||||
self.list.push(_a);
|
},
|
||||||
if (timeout > 0) {
|
_ca = angular.copy(_a),
|
||||||
$timeout(function() {
|
_clist = angular.copy(self.list);
|
||||||
self.list = _.without(self.list,_a);
|
|
||||||
}, timeout);
|
console.log(_.contains(_clist,_ca))
|
||||||
|
|
||||||
|
// If there isn't already a message with the same text
|
||||||
|
if(!_.contains(_clist,_ca)) {
|
||||||
|
console.log(_clist);
|
||||||
|
console.log([_ca]);
|
||||||
|
self.list.push(_a);
|
||||||
|
if (timeout > 0) {
|
||||||
|
$timeout(function() {
|
||||||
|
self.list = _.without(self.list,_a);
|
||||||
|
}, timeout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user