Source
* Update app state according with configuration. Either update individual chart item schedulers or re-fetch
<?php
/*
** Zabbix
** 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 General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** 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 General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
?>
<script>
const view = {
_app: null,
_filter_form: null,
_data: null,
_resize_observer: null,
_container: null,
_filter_tags: new Map(),
_filter_tagnames: new Set(),
init({filter_form_name, data}) {
this._filter_form = document.querySelector(`[name="${filter_form_name}"]`);
this._container = document.querySelector('main');
this._data = data;
this.initSubfilter();
this.initCharts();
},
initSubfilter() {
for (const element of this._filter_form.querySelectorAll('.js-subfilter-unset')) {
this.setSubfilter(element.dataset.tag, element.dataset.value || null);
}
this._filter_form.addEventListener('click', (e) => {
const link = e.target;
if (link.classList.contains('js-subfilter-set')) {
this.setSubfilter(link.getAttribute('data-tag'), link.getAttribute('data-value'));
this.submitSubfilter();
}
else if (link.classList.contains('js-subfilter-unset')) {
this.unsetSubfilter(link.getAttribute('data-tag'), link.getAttribute('data-value'));
this.submitSubfilter();
}
});
},
initCharts() {
this._$tmpl_row = $('<tr>').append(
$('<div>', {class: 'flickerfreescreen'}).append(