Source
<?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 $form
* @var array $data
*/
$form = (new CForm())
->setName('host_view');
$view_url = $data['view_curl']->getUrl();
$table = (new CTableInfo())
->setHeader([
make_sorting_header(_('Name'), 'name', $data['sort'], $data['sortorder'], $view_url),
(new CColHeader(_('Interface'))),
(new CColHeader(_('Availability'))),
(new CColHeader(_('Tags'))),
make_sorting_header(_('Status'), 'status', $data['sort'], $data['sortorder'], $view_url),
(new CColHeader(_('Latest data'))),
(new CColHeader(_('Problems'))),
(new CColHeader(_('Graphs'))),
(new CColHeader(_('Dashboards'))),
(new CColHeader(_('Web')))
])
->setPageNavigation($data['paging']);
foreach ($data['hosts'] as $hostid => $host) {
$host_name = (new CLinkAction($host['name']))
->setMenuPopup(CMenuPopupHelper::getHost($hostid))
->addClass(ZBX_STYLE_WORDBREAK);
$interface = null;
if ($host['interfaces']) {
foreach (CItem::INTERFACE_TYPES_BY_PRIORITY as $interface_type) {
$host_interfaces = array_filter($host['interfaces'], function(array $host_interface) use ($interface_type) {
return ($host_interface['type'] == $interface_type);
});
if ($host_interfaces) {
$interface = reset($host_interfaces);
break;
}
}
}
$problems_link = new CLink('',
(new CUrl('zabbix.php'))
->setArgument('action', 'problem.view')
->setArgument('severities', $data['filter']['severities'])