Source
button.dataset.hintboxClass = 'dashboard-widget-itemhistory-hintbox' + (content === '' ? ' nowrap' : '');
/*
** 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/>.
**/
class CWidgetItemHistory extends CWidget {
static VALUE_TYPE_IMAGE = 'image';
static VALUE_TYPE_RAW = 'raw';
#binary_data_cache = new Map();
#binary_buttons = new Map();
#abort_controller = null;
#thumbnail_loader = null;
#values_table;
#selected_itemid = null;
#selected_clock = null;
#selected_key_ = null;
setContents(response) {
super.setContents(response);
if (this.#abort_controller !== null) {
this.#abort_controller.abort();
this.#abort_controller = null;
}
this.#values_table = this._body.querySelector(`.${ZBX_STYLE_LIST_TABLE}`);
if (this.#values_table === null) {
return;
}
const items_data = new Map();
this.#values_table.querySelectorAll('.has-broadcast-data').forEach(element => {
const itemid = element.dataset.itemid;
const clock = element.dataset.clock;
const key_ = element.dataset.key_;
if (!items_data.has(itemid)) {
items_data.set(itemid, { itemid: itemid, clock: clock, key_: key_ });
}
});
this.#loadThumbnails(this.#makeUrls());
this.#values_table.addEventListener('click', e => {
const element = e.target.closest('.has-broadcast-data');