Source
xxxxxxxxxx
<?php
/*
** 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>
const view = new class {
/**
* Current host ID.
* @type {string}
*/
#hostid;
/**
* Selected dashboard ID.
* @type {string}
*/
#dashboardid;
/**
* @tape {Object}
*/
#host_dashboards;
/**
* @type {Map}
*/
#host_dashboard_tabs = new Map();
/**
* @type {CSortable}
*/
#dashboard_tabs;
/**
* @type {HTMLElement|null}
*/
#selected_dashboard_tab = null;
/**
* @type {HTMLElement}
*/
#host_dashboard_navigation_tabs
/**
* @type {HTMLElement}
*/
#previous_dashboard;
/**
* @type {HTMLElement}
*/
#next_dashboard;
/**
* @type {boolean}
*/
#skip_time_selector_range_update = false;
init({
host_dashboards,
dashboard,
widget_defaults,
configuration_hash,
broadcast_requirements,
dashboard_host,
dashboard_time_period,
web_layout_mode
}) {
this.#hostid = dashboard_host.hostid;
this.#dashboardid = dashboard.dashboardid;
if (dashboard.pages.length > 1 || (dashboard.pages.length === 1 && dashboard.pages[0].widgets.length > 0)) {
timeControl.refreshPage = false;