Source
* Recoverable notification is just partial of raw with one mandatory field - `eventid`. New iterator sequence reflects
/*
** Copyright (C) 2001-2025 Zabbix SIA
**
** This program is free software: you can redistribute it and/or modify it under the terms of
** the GNU Affero General Public License as published by the Free Software Foundation, version 3.
**
** This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
** without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
** See the GNU Affero General Public License for more details.
**
** You should have received a copy of the GNU Affero General Public License along with this program.
** If not, see <https://www.gnu.org/licenses/>.
**/
/**
* Represents DOM node for notification list. Stores the collection of ZBX_Notification objects.
*/
function ZBX_NotificationCollection() {
this._dangling_nodes = [];
this._list_sequence = [];
this._list_obj = {};
this.makeNodes();
this.node.style.right = '10px';
this.node.style.top = '0px';
}
/**
* @return {array}
*/
ZBX_NotificationCollection.prototype.getIds = function() {
return this._list_sequence;
};
/**
* @param {callable} callback
*/
ZBX_NotificationCollection.prototype.map = function(callback) {
var len = this._list_sequence.length;
while (--len > -1) {
callback(this.getById(this._list_sequence[len]), len);
}
};
/**
* @param {callable} callback
*
* @return {array}
*/
ZBX_NotificationCollection.prototype.filterList = function(callback) {
var list = [],
len = this._list_sequence.length;
while (--len > -1) {
var ret = callback(this.getById(this._list_sequence[len]));
(ret !== false) && list.push(ret);
}
return list;