Source
<?php declare(strict_types = 0);
/*
** 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/>.
**/
/**
* @var CView $this
*/
?>
<script type="text/x-jquery-tmpl" id="filter-tag-row-tmpl">
<?= CTagFilterFieldHelper::getTemplate() ?>
</script>
<script>
const view = new class {
constructor() {
this.is_refresh_paused = false;
this.is_refresh_pending = false;
}
init({serviceid, path = null, is_filtered = null, mode_switch_url, parent_url = null, refresh_url,
refresh_interval, back_url = null}) {
this.serviceid = serviceid;
this.path = path;
this.is_filtered = is_filtered;
this.mode_switch_url = mode_switch_url;
this.parent_url = parent_url;
this.refresh_url = refresh_url;
this.refresh_interval = refresh_interval;
this.back_url = back_url;
this._initViewModeSwitcher();
this._initTagFilter();
this._initActions();
this._initRefresh();
}
_initViewModeSwitcher() {
for (const element of document.getElementsByName('list_mode')) {
if (!element.checked) {
element.addEventListener('click', () => {
location.href = this.mode_switch_url;
});
}
}
}
_initTagFilter() {
$('#filter-tags')
.dynamicRows({template: '#filter-tag-row-tmpl'})