$show_host = $PAGE_HOSTS['selected'] == 0; if (!$filter_enabled) { $show_applications = 1; } if ($showdisabled == 0) { $where_case[] = 'i.status <> 1'; } $row_count = 0; $numrows = new CSpan(null, 'info'); $numrows->setAttribute('name', 'numrows'); $header = array(S_ITEMS_BIG, new CSpan(SPACE . SPACE . '|' . SPACE . SPACE, 'divider'), S_FOUND . ': ', $numrows); $items_wdgt->addHeader($header, $form); // show_table_header($header, $form); // ---------------- // Items Filter $items_wdgt->addFlicker(get_item_filter_form(), get_profile('web.items.filter.state', 0)); //----- // <<<--- SELECTED HOST HEADER INFORMATION --->>> if ($PAGE_HOSTS['selected'] > 0) { $header_host = CHost::get(array('hostids' => $PAGE_HOSTS['selected'], 'nopermissions' => 1, 'extendoutput' => 1, 'select_triggers' => 1, 'select_graphs' => 1)); $header_host = array_pop($header_host); $description = array(); if ($header_host['proxy_hostid']) { $proxy = get_host_by_hostid($header_host['proxy_hostid']); $description[] = $proxy['host'] . ':'; } $description[] = $header_host['host']; $triggers = array(new CLink(S_TRIGGERS, 'triggers.php?groupid=' . $PAGE_GROUPS['selected'] . '&hostid=' . $header_host['hostid']), ' (' . count($header_host['triggerids']) . ')'); $graphs = array(new CLink(S_GRAPHS, 'graphs.php?groupid=' . $PAGE_GROUPS['selected'] . '&hostid=' . $header_host['hostid']), ' (' . count($header_host['graphids']) . ')'); $dns = empty($header_host['dns']) ? '-' : $header_host['dns']; $ip = empty($header_host['ip']) ? '-' : $header_host['ip'];
$exactComboBox->addItem('0', _('like')); $exactComboBox->addItem('1', _('exactly')); $filter_table->addRow(array(array(array(bold(_('Field:')), $inventoryFieldsComboBox), array($exactComboBox, new CTextBox('filter_field_value', $_REQUEST['filter_field_value'], 20))))); $filter = new CButton('filter', _('Filter'), "javascript: create_var('zbx_filter', 'filter_set', '1', true);"); $filter->useJQueryStyle('main'); $reset = new CButton('reset', _('Reset'), "javascript: clearAllForm('zbx_filter');"); $reset->useJQueryStyle(); $div_buttons = new CDiv(array($filter, SPACE, $reset)); $div_buttons->setAttribute('style', 'padding: 4px 0px;'); $footer_col = new CCol($div_buttons, 'controls'); $filter_table->addRow($footer_col); $filter_form = new CForm('get'); $filter_form->setAttribute('name', 'zbx_filter'); $filter_form->setAttribute('id', 'zbx_filter'); $filter_form->addItem($filter_table); $hostinvent_wdgt->addFlicker($filter_form, CProfile::get('web.hostinventories.filter.state', 0)); $hostinvent_wdgt->addHeaderRowNumber(); $table = new CTableInfo(_('No hosts defined.')); $table->setHeader(array(is_show_all_nodes() ? make_sorting_header(_('Node'), 'hostid') : null, make_sorting_header(_('Host'), 'name'), _('Group'), make_sorting_header(_('Name'), 'pr_name'), make_sorting_header(_('Type'), 'pr_type'), make_sorting_header(_('OS'), 'pr_os'), make_sorting_header(_('Serial number A'), 'pr_serialno_a'), make_sorting_header(_('Tag'), 'pr_tag'), make_sorting_header(_('MAC address A'), 'pr_macaddress_a'))); $hosts = array(); $paging = getPagingLine($hosts); if ($pageFilter->groupsSelected) { // which inventory fields we will need for displaying $requiredInventoryFields = array('name', 'type', 'os', 'serialno_a', 'tag', 'macaddress_a'); // checking if correct inventory field is specified for filter $possibleInventoryFields = getHostInventories(); $possibleInventoryFields = zbx_toHash($possibleInventoryFields, 'db_field'); if (!empty($_REQUEST['filter_field']) && !empty($_REQUEST['filter_field_value']) && !isset($possibleInventoryFields[$_REQUEST['filter_field']])) { error(_s('Impossible to filter by inventory field "%s", which does not exist.', $_REQUEST['filter_field'])); } else { // if we are filtering by field, this field is also required
$action = 'javascrip: this.checked ? $("status_change_days").enable() : $("status_change_days").disable()'; $sts_change_days_cb = new CNumericBox('status_change_days', $_REQUEST['status_change_days'], 4); if (!$_REQUEST['status_change']) { $sts_change_days_cb->setAttribute('disabled', 'disabled'); } $sts_change_days_cb->addStyle('vertical-align: middle;'); $cbd = new CCheckBox('status_change', $_REQUEST['status_change'], $action, 1); $cbd->addStyle('vertical-align: middle;'); $spand = new CSpan(S_DAYS_SMALL); $spand->addStyle('vertical-align: middle;'); $filterForm->addRow(S_AGE_LESS_THAN, array($cbd, $sts_change_days_cb, $spand)); $filterForm->addRow(S_SHOW_DETAILS, new CCheckBox('show_details', $_REQUEST['show_details'], null, 1)); $filterForm->addRow(S_FILTER_BY_NAME, new CTextBox('txt_select', $_REQUEST['txt_select'], 40)); $filterForm->addItemToBottomRow(new CButton('filter_set', S_FILTER)); $filterForm->addItemToBottomRow(new CButton('filter_rst', S_RESET)); $trigg_wdgt->addFlicker($filterForm, CProfile::get('web.tr_status.filter.state', 0)); /*************** FILTER END ******************/ if ($_REQUEST['fullscreen']) { $triggerInfo = new CTriggersInfo($_REQUEST['groupid'], $_REQUEST['hostid']); $triggerInfo->HideHeader(); $triggerInfo->show(); } $m_form = new CForm('acknow.php'); $m_form->setName('tr_status'); $m_form->addVar('backurl', $page['file']); $admin_links = $USER_DETAILS['type'] == USER_TYPE_ZABBIX_ADMIN || $USER_DETAILS['type'] == USER_TYPE_SUPER_ADMIN; $show_event_col = $config['event_ack_enable'] && $_REQUEST['show_events'] != EVENTS_OPTION_NOEVENT; $table = new CTableInfo(); $switcherName = 'trigger_switchers'; $header_cb = $show_event_col ? new CCheckBox('all_events', false, "checkAll('" . $m_form->GetName() . "','all_events','events');") : new CCheckBox('all_triggers', false, "checkAll('" . $m_form->GetName() . "','all_triggers', 'triggers');"); if ($show_events != EVENTS_OPTION_NOEVENT) {
} $r_form->addItem(array(SPACE . _('Server') . SPACE, new CComboBox('server', $selected_server, 'javascript: submit();', $servers), SPACE . _('Server') . SPACE, new CComboBox('priority', $selectedPriority, 'javascript: submit();', $level))); // add host and group filters to the form //if ($source == EVENT_SOURCE_TRIGGERS) { // $r_form->addItem(array( // SPACE . _('Host') . SPACE, // $pageFilter->getHostsCB(true) // )); //} $eventsWidget->addHeader(_('Events'), $r_form); $eventsWidget->addHeaderRowNumber(); $filterForm = null; // //if ($source == EVENT_SOURCE_TRIGGERS) { $filterForm = new CFormTable(null, null, 'get'); $eventsWidget->addFlicker(null, CProfile::get('web.events.filter.state', 0)); $scroll = new CDiv(); $scroll->setAttribute('id', 'scrollbar_cntr'); $eventsWidget->addFlicker($scroll, CProfile::get('web.events.filter.state', 1)); /* * Display */ $table = new CTableInfo(_('No events found.'), 'tableinfo Eventlog'); if (isset($_REQUEST['period'])) { $_REQUEST['period'] = getRequest('period', ZBX_PERIOD_DEFAULT); CProfile::update('web.eventlog.period', $_REQUEST['period'], PROFILE_TYPE_INT); } else { $_REQUEST['period'] = CProfile::get('web.eventlog.period'); } $config = select_config(); // source not discovery i.e. trigger
$hostsWidget->setRootClass('host-list'); // filter $filterTable = new CTable('', 'filter'); $filterTable->addRow(array(array(array(bold(_('Name')), SPACE . _('like') . NAME_DELIMITER), new CTextBox('filter_host', $_REQUEST['filter_host'], 20)), array(array(bold(_('DNS')), SPACE . _('like') . NAME_DELIMITER), new CTextBox('filter_dns', $_REQUEST['filter_dns'], 20)), array(array(bold(_('IP')), SPACE . _('like') . NAME_DELIMITER), new CTextBox('filter_ip', $_REQUEST['filter_ip'], 20)), array(bold(_('Port') . NAME_DELIMITER), new CTextBox('filter_port', $_REQUEST['filter_port'], 20)))); $filter = new CButton('filter', _('Filter'), "javascript: create_var('zbx_filter', 'filter_set', '1', true); chkbxRange.clearSelectedOnFilterChange();"); $filter->useJQueryStyle('main'); $reset = new CButton('reset', _('Reset'), "javascript: clearAllForm('zbx_filter');"); $reset->useJQueryStyle(); $divButtons = new CDiv(array($filter, SPACE, $reset)); $divButtons->setAttribute('style', 'padding: 4px 0;'); $filterTable->addRow(new CCol($divButtons, 'center', 4)); $filterForm = new CForm('get'); $filterForm->setAttribute('name', 'zbx_filter'); $filterForm->setAttribute('id', 'zbx_filter'); $filterForm->addItem($filterTable); $hostsWidget->addFlicker($filterForm, CProfile::get('web.hosts.filter.state', 0)); // table hosts $form = new CForm(); $form->setName('hosts'); $table = new CTableInfo(_('No hosts found.')); $table->setHeader(array(new CCheckBox('all_hosts', null, "checkAll('" . $form->getName() . "', 'all_hosts', 'hosts');"), $displayNodes ? _('Node') : null, make_sorting_header(_('Name'), 'name'), _('Applications'), _('Items'), _('Triggers'), _('Graphs'), _('Discovery'), _('Web'), _('Interface'), _('Templates'), make_sorting_header(_('Status'), 'status'), _('Availability'))); // get Hosts $hosts = array(); $sortfield = getPageSortField('name'); $sortorder = getPageSortOrder(); if ($pageFilter->groupsSelected) { $hosts = API::Host()->get(array('groupids' => $pageFilter->groupid > 0 ? $pageFilter->groupid : null, 'editable' => true, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'limit' => $config['search_limit'] + 1, 'search' => array('name' => empty($_REQUEST['filter_host']) ? null : $_REQUEST['filter_host'], 'ip' => empty($_REQUEST['filter_ip']) ? null : $_REQUEST['filter_ip'], 'dns' => empty($_REQUEST['filter_dns']) ? null : $_REQUEST['filter_dns']), 'filter' => array('port' => empty($_REQUEST['filter_port']) ? null : $_REQUEST['filter_port']))); } else { $hosts = array(); } // sorting && paging
$rep_tab->setCellPadding(3); $rep_tab->setCellSpacing(3); $rep_tab->setAttribute('border', 0); switch ($config) { default: case 1: $rep_form = valueDistributionFormForMultiplePeriods($validItems); break; case 2: $rep_form = valueDistributionFormForMultipleItems($validItems, $validPeriods); break; case 3: $rep_form = valueComparisonFormForMultiplePeriods(); break; } $rep6_wdgt->addFlicker($rep_form, CProfile::get('web.report6.filter.state', 1)); if (isset($_REQUEST['report_show'])) { $items = $config == 3 ? array(array('itemid' => get_request('itemid'))) : get_request('items'); if ($isValid && ($config != 3 ? $validItems : true) && ($config == 2 ? $validPeriods : true)) { $src = 'chart_bar.php?' . 'config=' . $config . url_param('title') . url_param('xlabel') . url_param('ylabel') . url_param('scaletype') . url_param('avgperiod') . url_param('showlegend') . url_param('sorttype') . url_param('report_timesince') . url_param('report_timetill') . url_param('periods') . url_param($items, false, 'items') . url_param('hostids') . url_param('groupids') . url_param('palette') . url_param('palettetype'); $rep_tab->addRow(new CImg($src, 'report')); } } $outer_table = new CTable(); $outer_table->setAttribute('border', 0); $outer_table->setAttribute('width', '100%'); $outer_table->setCellPadding(1); $outer_table->setCellSpacing(1); $tmp_row = new CRow($rep_tab); $tmp_row->setAttribute('align', 'center'); $outer_table->addRow($tmp_row);
** 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. **/ $screenWidget = new CWidget(); $screenWidget->addFlicker(new CDiv(null, null, 'scrollbar_cntr'), CProfile::get('web.screens.filter.state', 1)); // header form $configComboBox = new CComboBox('config', 'screens.php', 'javascript: redirect(this.options[this.selectedIndex].value);'); $configComboBox->addItem('screens.php', _('Screens')); $configComboBox->addItem('slides.php', _('Slide shows')); $headerForm = new CForm(); $headerForm->addItem($configComboBox); if (empty($this->data['screens'])) { $screenWidget->addPageHeader(_('SCREENS'), $headerForm); $screenWidget->addItem(BR()); $screenWidget->addItem(new CTableInfo(_('No screens found.'))); $screenBuilder = new CScreenBuilder(); CScreenBuilder::insertScreenStandardJs(array('timeline' => $screenBuilder->timeline)); } else { if (!isset($this->data['screens'][$this->data['elementIdentifier']])) { // this means id was fetched from profile and this screen does not exist
$filter_form = new CForm(); $filter_form->setMethod('get'); $filter_form->setAttribute('name', 'zbx_filter'); $filter_form->setAttribute('id', 'zbx_filter'); // Botões do formulario de filtro ---------------------------------------------- $reset = new CButton('reset', _('Reset')); $reset->onClick("javascript: clearAllForm('zbx_filter');"); $filter = new CButton('filter', _zeT("Update Filter")); $filter->onClick("javascript: submit();"); $footer_col = new CCol(array($filter, SPACE, $reset), 'center'); $footer_col->setColSpan(4); $filter_table->addRow($footer_col); $filter_form->addItem($filter_table); // $filter_form->addVar('report_timesince', date('YmdHis', $report_timesince)); // $filter_form->addVar('report_timetill', date('YmdHis', $report_timetill)); $hostprof_wdgt->addFlicker($filter_form, true); // FIM Formulario de Filtro ========================================================= insert_js($script); $numrows = new CDiv(); $numrows->setAttribute('name', 'numrows'); $report = array(); $hostprof_wdgt->addHeader($numrows); $r_form = new CForm(); // Combo com os formatos de exibição --------------------------------------- $cmbFormato = new CComboBox('formato', $formato, 'javascript: submit();'); $cmbFormato->additem('html', 'HTML'); $cmbFormato->additem('csv', 'CSV'); // Combo com as opções de relatorios possiveis ----------------------------- $cmbMenus = new CComboBox('submenu', $subMenu, 'javascript: submit();'); // var_dump (zbxeSubMenus ('submenu_05')); foreach (zbxeSubMenus('sub_report') as $row) {
$rep2_wdgt = new CWidget(); $rep2_wdgt->addPageHeader(_zeT('Not Supported Items Report')); $filter_form = new CForm(); $filter_form->setMethod('get'); $filter_form->setAttribute('name', 'zbx_filter'); $filter_form->setAttribute('id', 'zbx_filter'); $filter = new CButton('filter', _("Filter")); $filter->onClick("javascript: submit();"); $reset = new CButton('reset', _('Reset')); $reset->onClick("javascript: clearAllForm('zbx_filter');"); $footer_col = new CCol(array($filter, SPACE, $reset), 'center'); $footer_col->setColSpan(4); $filter_table->addRow($footer_col); $filter_form->addItem($filter_table); // $filterForm = get_report2_filter($config, $PAGE_GROUPS, $PAGE_HOSTS); $rep2_wdgt->addFlicker($filter_form, true); if (isset($hostid)) { $sql_from = ''; $sql_where = ''; if (0 == $config) { if ($_REQUEST['groupid'] > 0) { $sql_from .= ',hosts_groups hg '; $sql_where .= ' AND hg.hostid=h.hostid AND hg.groupid=' . $_REQUEST['groupid']; } if ($_REQUEST['hostid'] > 0) { $sql_where .= ' AND h.hostid=' . $hostid; } } else { if ($hostid > 0) { $sql_from .= ',hosts_templates ht '; $sql_where .= ' AND ht.hostid=h.hostid AND ht.templateid=' . $hostid;
$clndr_icon->setAttribute('style', 'vertical-align: middle;'); $nav_clndr = array(new CNumericBox('nav_day', $_REQUEST['nav_time'] > 0 ? date('d', $_REQUEST['nav_time']) : '', 2), new CNumericBox('nav_month', $_REQUEST['nav_time'] > 0 ? date('m', $_REQUEST['nav_time']) : '', 2), new CNumericBox('nav_year', $_REQUEST['nav_time'] > 0 ? date('Y', $_REQUEST['nav_time']) : '', 4), SPACE, new CNumericBox('nav_hour', $_REQUEST['nav_time'] > 0 ? date('H', $_REQUEST['nav_time']) : '', 2), ':', new CNumericBox('nav_minute', $_REQUEST['nav_time'] > 0 ? date('i', $_REQUEST['nav_time']) : '', 2), $clndr_icon); zbx_add_post_js('create_calendar(null,["nav_day","nav_month","nav_year","nav_hour","nav_minute"],"nav_time");'); $filterForm->addRow(S_EVENTS_BEFORE, $nav_clndr); if (EVENT_SOURCE_TRIGGERS == $source) { $filterForm->addVar('triggerid', $_REQUEST['triggerid']); if (isset($_REQUEST['triggerid']) && $_REQUEST['triggerid'] > 0) { $trigger = expand_trigger_description($_REQUEST['triggerid']); } else { $trigger = ""; } $row = new CRow(array(new CCol(S_TRIGGER, 'form_row_l'), new CCol(array(new CTextBox("trigger", $trigger, 96, 'yes'), new CButton("btn1", S_SELECT, "return PopUp('popup.php?" . "dstfrm=" . $filterForm->GetName() . "&dstfld1=triggerid&dstfld2=trigger" . "&srctbl=triggers&srcfld1=triggerid&srcfld2=description&real_hosts=1');", 'T')), 'form_row_r'))); $filterForm->addRow($row); $filterForm->addVar('show_unknown', $show_unknown); $unkcbx = new CCheckBox('show_unk', $show_unknown, null, '1'); $unkcbx->setAction('javascript: create_var("' . $filterForm->GetName() . '", "show_unknown", (this.checked?1:0), 0); '); $filterForm->addRow(S_SHOW_UNKNOWN, $unkcbx); } $reset = new CButton("filter_rst", S_RESET); $reset->setType('button'); $reset->setAction('javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst",1); location.href = uri.getUrl();'); $filterForm->addItemToBottomRow(new CButton("filter_set", S_FILTER)); $filterForm->addItemToBottomRow($reset); //------- $nav = get_thin_table_header($navigation); $events_wdgt->addFlicker($filterForm, get_profile('web.events.filter.state', 0)); $events_wdgt->addItem(array($nav, $table, $nav)); $events_wdgt->show(); $jsmenu = new CPUMenu(null, 170); $jsmenu->InsertJavaScript(); include_once "include/page_footer.php";
$alerts_wdgt->addHeader(S_ACTIONS_BIG); $alerts_wdgt->addHeader($numrows); //-------- /************************* FILTER **************************/ /***********************************************************/ $filterForm = new CFormTable(); $filterForm->setAttribute('name', 'zbx_filter'); $filterForm->setAttribute('id', 'zbx_filter'); $row = new CRow(array(new CCol(S_RECIPIENT, 'form_row_l'), new CCol(array(new CTextBox('alias', $_REQUEST['alias'], 32), new CButton('btn1', S_SELECT, "return PopUp('popup.php?" . "dstfrm=" . $filterForm->getName() . "&dstfld1=alias&srctbl=users&srcfld1=alias&real_hosts=1');", 'T')), 'form_row_r'))); $filterForm->addRow($row); $reset = new CButton('filter_rst', S_RESET); $reset->setType('button'); $reset->setAction('javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst",1); location.href = uri.getUrl();'); $filterForm->addItemToBottomRow(new CButton("filter_set", S_FILTER)); $filterForm->addItemToBottomRow($reset); $alerts_wdgt->addFlicker($filterForm, CProfile::get('web.auditacts.filter.state', 1)); $scroll_div = new CDiv(); $scroll_div->setAttribute('id', 'scrollbar_cntr'); $alerts_wdgt->addFlicker($scroll_div, CProfile::get('web.auditacts.filter.state', 1)); //------- $table = new CTableInfo(S_NO_ACTIONS_FOUND); $table->setHeader(array(is_show_all_nodes() ? S_NODES : null, S_TIME, S_TYPE, S_STATUS, S_RETRIES_LEFT, S_RECIPIENTS, S_MESSAGE, S_ERROR)); $effectiveperiod = navigation_bar_calc('web.auditacts.timeline', 0, true); $bstime = $_REQUEST['stime']; $from = zbxDateToTime($_REQUEST['stime']); $till = $from + $effectiveperiod; $options = array('time_from' => $from, 'time_till' => $till, 'output' => API_OUTPUT_EXTEND, 'select_mediatypes' => API_OUTPUT_EXTEND, 'sortfield' => 'alertid', 'sortorder' => ZBX_SORT_DOWN, 'limit' => $config['search_limit'] + 1); if ($_REQUEST['alias']) { $users = CUser::get(array('filter' => array('alias' => $_REQUEST['alias']))); $options['userids'] = zbx_objectValues($users, 'userid'); }
$r_form->addItem(array(SPACE . S_HOST . SPACE, $cmbHosts)); $latest_wdgt->addHeader(SPACE, $r_form); // show_table_header(S_LATEST_DATA_BIG,$r_form); //------------- /************************* FILTER **************************/ /***********************************************************/ $filterForm = new CFormTable(); $filterForm->setAttribute('name', 'zbx_filter'); $filterForm->setAttribute('id', 'zbx_filter'); $filterForm->addRow(S_SHOW_ITEMS_WITH_DESCRIPTION_LIKE, new CTextBox('select', $_REQUEST['select'], 20)); $reset = new CButton("filter_rst", S_RESET); $reset->setType('button'); $reset->setAction('javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst",1); location.href = uri.getUrl();'); $filterForm->addItemToBottomRow(new CButton("filter_set", S_FILTER)); $filterForm->addItemToBottomRow($reset); $latest_wdgt->addFlicker($filterForm, get_profile('web.latest.filter.state', 1)); //------- validate_sort_and_sortorder('i.description', ZBX_SORT_UP); $_REQUEST['groupbyapp'] = get_request('groupbyapp', get_profile('web.latest.groupbyapp', 1)); update_profile('web.latest.groupbyapp', $_REQUEST['groupbyapp'], PROFILE_TYPE_INT); $_REQUEST['applications'] = get_request('applications', get_profile('web.latest.applications', array(), PROFILE_TYPE_ARRAY_ID)); if (isset($_REQUEST['open'])) { if (!isset($_REQUEST['applicationid'])) { $_REQUEST['applications'] = array(); $show_all_apps = 1; } else { if (!uint_in_array($_REQUEST['applicationid'], $_REQUEST['applications'])) { array_push($_REQUEST['applications'], $_REQUEST['applicationid']); } } } else {
$objData['id'] = $_REQUEST['itemid']; $objData['domid'] = $dom_graph_id; $objData['loadSBox'] = 0; $objData['loadImage'] = 0; $objData['loadScroll'] = 1; $objData['dynamic'] = 0; $objData['mainObject'] = 1; } //------------- } if (!isset($_REQUEST['plaintext'])) { $right = new CTable(); $right->addRow($header['right']); $historyWidget->addPageHeader($header['left'], $right); if (isset($iv_string[$item['value_type']])) { $historyWidget->addFlicker($filterForm, CProfile::get('web.history.filter.state', 1)); } $historyWidget->addItem($table); if (str_in_array($_REQUEST['action'], array('showvalues', 'showgraph'))) { zbx_add_post_js('timeControl.addObject("' . $dom_graph_id . '",' . zbx_jsvalue($timeline) . ',' . zbx_jsvalue($objData) . ');'); zbx_add_post_js('timeControl.processObjects();'); $scroll_div = new CDiv(); $scroll_div->setAttribute('id', 'scrollbar_cntr'); $historyWidget->addFlicker($scroll_div, CProfile::get('web.history.filter.state', 1)); } $historyWidget->show(); } else { $span = new CSpan(null, 'textblackwhite'); foreach ($ptData['header'] as $bnum => $text) { $span->addItem(array(new CJSscript($text), BR())); }
$hosts_wdgt->setRootClass('host-list'); // filter $filter_table = new CTable('', 'filter'); $filter_table->addRow(array(array(array(bold(_('Name')), SPACE . _('like') . ': '), new CTextBox('filter_host', $_REQUEST['filter_host'], 20)), array(array(bold(_('DNS')), SPACE . _('like') . ': '), new CTextBox('filter_dns', $_REQUEST['filter_dns'], 20)), array(array(bold(_('IP')), SPACE . _('like') . ': '), new CTextBox('filter_ip', $_REQUEST['filter_ip'], 20)), array(bold(_('Port') . ': '), new CTextBox('filter_port', $_REQUEST['filter_port'], 20)))); $filter = new CButton('filter', _('Filter'), "javascript: create_var('zbx_filter', 'filter_set', '1', true);"); $filter->useJQueryStyle('main'); $reset = new CButton('reset', _('Reset'), "javascript: clearAllForm('zbx_filter');"); $reset->useJQueryStyle(); $div_buttons = new CDiv(array($filter, SPACE, $reset)); $div_buttons->setAttribute('style', 'padding: 4px 0;'); $filter_table->addRow(new CCol($div_buttons, 'center', 4)); $filter_form = new CForm('get'); $filter_form->setAttribute('name', 'zbx_filter'); $filter_form->setAttribute('id', 'zbx_filter'); $filter_form->addItem($filter_table); $hosts_wdgt->addFlicker($filter_form, CProfile::get('web.hosts.filter.state', 0)); // table hosts $form = new CForm(); $form->setName('hosts'); $table = new CTableInfo(_('No hosts defined.')); $table->setHeader(array(new CCheckBox('all_hosts', null, "checkAll('" . $form->getName() . "', 'all_hosts', 'hosts');"), make_sorting_header(_('Name'), 'name'), _('Applications'), _('Items'), _('Triggers'), _('Graphs'), _('Discovery'), _('Interface'), _('Templates'), make_sorting_header(_('Status'), 'status'), _('Availability'))); // get Hosts $hosts = array(); $sortfield = getPageSortField('name'); $sortorder = getPageSortOrder(); if ($pageFilter->groupsSelected) { $options = array('editable' => true, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'limit' => $config['search_limit'] + 1, 'search' => array('name' => empty($_REQUEST['filter_host']) ? null : $_REQUEST['filter_host'], 'ip' => empty($_REQUEST['filter_ip']) ? null : $_REQUEST['filter_ip'], 'dns' => empty($_REQUEST['filter_dns']) ? null : $_REQUEST['filter_dns']), 'filter' => array('port' => empty($_REQUEST['filter_port']) ? null : $_REQUEST['filter_port'])); if ($pageFilter->groupid > 0) { $options['groupids'] = $pageFilter->groupid; } $hosts = API::Host()->get($options);
$auditWidget->addHeaderRowNumber(); // create filter $filterForm = new CForm('get'); $filterForm->setAttribute('name', 'zbx_filter'); $filterForm->setAttribute('id', 'zbx_filter'); $filterTable = new CTable('', 'filter'); $filterTable->addRow(array(array(bold(_('Recipient')), SPACE, new CTextBox('alias', $this->data['alias'], 20), new CButton('btn1', _('Select'), 'return PopUp(\'popup.php?dstfrm=' . $filterForm->getName() . '&dstfld1=alias&srctbl=users&srcfld1=alias&real_hosts=1\');', 'T')))); $filterButton = new CButton('filter', _('Filter'), "javascript: create_var('zbx_filter', 'filter_set', '1', true);"); $filterButton->useJQueryStyle('main'); $resetButton = new CButton('filter_rst', _('Reset'), 'javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst", 1); location.href = uri.getUrl();'); $resetButton->useJQueryStyle(); $buttonsDiv = new CDiv(array($filterButton, SPACE, $resetButton)); $buttonsDiv->setAttribute('style', 'padding: 4px 0px;'); $filterTable->addRow(new CCol($buttonsDiv, 'controls')); $filterForm->addItem($filterTable); $auditWidget->addFlicker($filterForm, CProfile::get('web.auditacts.filter.state', 1)); $auditWidget->addFlicker(new CDiv(null, null, 'scrollbar_cntr'), CProfile::get('web.auditacts.filter.state', 1)); // create form $auditForm = new CForm('get'); $auditForm->setName('auditForm'); // create table $auditTable = new CTableInfo(_('No actions defined.')); $auditTable->setHeader(array(is_show_all_nodes() ? _('Nodes') : null, _('Time'), _('Type'), _('Status'), _('Retries left'), _('Recipient(s)'), _('Message'), _('Error'))); foreach ($this->data['alerts'] as $alert) { $mediatype = array_pop($alert['mediatypes']); if ($mediatype['mediatypeid'] == 0) { $mediatype = array('description' => ''); } if ($alert['status'] == ALERT_STATUS_SENT) { if ($alert['alerttype'] == ALERT_TYPE_MESSAGE) { $status = new CSpan(_('sent'), 'green');
$cmbResource->addItem(AUDIT_RESOURCE_SCREEN, S_SCREEN); $cmbResource->addItem(AUDIT_RESOURCE_NODE, S_NODE); $cmbResource->addItem(AUDIT_RESOURCE_SCENARIO, S_SCENARIO); $cmbResource->addItem(AUDIT_RESOURCE_DISCOVERY_RULE, S_DISCOVERY_RULE); $cmbResource->addItem(AUDIT_RESOURCE_SLIDESHOW, S_SLIDESHOW); $cmbResource->addItem(AUDIT_RESOURCE_SCRIPT, S_SCRIPT); $cmbResource->addItem(AUDIT_RESOURCE_PROXY, S_PROXY); $cmbResource->addItem(AUDIT_RESOURCE_MAINTENANCE, S_MAINTENANCE); $cmbResource->addItem(AUDIT_RESOURCE_REGEXP, S_REGULAR_EXPRESSION); $filterForm->addRow(S_RESOURCE, $cmbResource); } //* $clndr_icon = new CImg('images/general/bar/cal.gif', 'calendar', 16, 12, 'pointer'); $clndr_icon->addAction('onclick', "javascript: var pos = getPosition(this); pos.top+=10; pos.left+=16; CLNDR['audit_since'].clndr.clndrshow(pos.top,pos.left);"); $clndr_icon->setAttribute('style', 'vertical-align: middle;'); $nav_clndr = array(new CNumericBox('nav_day', $_REQUEST['nav_time'] > 0 ? date('d', $_REQUEST['nav_time']) : '', 2), new CNumericBox('nav_month', $_REQUEST['nav_time'] > 0 ? date('m', $_REQUEST['nav_time']) : '', 2), new CNumericBox('nav_year', $_REQUEST['nav_time'] > 0 ? date('Y', $_REQUEST['nav_time']) : '', 4), new CNumericBox('nav_hour', $_REQUEST['nav_time'] > 0 ? date('H', $_REQUEST['nav_time']) : '', 2), ':', new CNumericBox('nav_minute', $_REQUEST['nav_time'] > 0 ? date('i', $_REQUEST['nav_time']) : '', 2), $clndr_icon); $filterForm->addRow(S_ACTIONS_BEFORE, $nav_clndr); zbx_add_post_js('create_calendar(null,' . '["nav_day","nav_month","nav_year","nav_hour","nav_minute"],' . '"audit_since");'); zbx_add_post_js('addListener($("filter_icon"),' . '"click",CLNDR[\'audit_since\'].clndr.clndrhide.bindAsEventListener(CLNDR[\'audit_since\'].clndr));'); //*/ $reset = new CButton('filter_rst', S_RESET); $reset->setType('button'); $reset->setAction('javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst",1); location.href = uri.getUrl();'); $filterForm->addItemToBottomRow(new CButton("filter_set", S_FILTER)); $filterForm->addItemToBottomRow($reset); $audit_wdgt->addFlicker($filterForm, get_profile('web.audit.filter.state', 1)); //------- $nav = get_thin_table_header($navigation); $audit_wdgt->addItem(array($nav, $table, $nav)); $audit_wdgt->show(); include_once "include/page_footer.php";
$cmbAction->addItem(AUDIT_ACTION_ADD, S_ADD); $cmbAction->addItem(AUDIT_ACTION_UPDATE, S_UPDATE); $cmbAction->addItem(AUDIT_ACTION_DELETE, S_DELETE); $cmbAction->addItem(AUDIT_ACTION_ENABLE, S_ENABLE); $cmbAction->addItem(AUDIT_ACTION_DISABLE, S_DISABLE); $filterForm->addRow(S_ACTION, $cmbAction); $cmbResource = new CComboBox('resourcetype', $_REQUEST['resourcetype']); $resources = array(-1 => S_ALL_S) + audit_resource2str(); $cmbResource->addItems($resources); $filterForm->addRow(S_RESOURCE, $cmbResource); $reset = new CButton('filter_rst', S_RESET); $reset->setType('button'); $reset->setAction('javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst",1); location.href = uri.getUrl();'); $filterForm->addItemToBottomRow(new CButton('filter_set', S_FILTER)); $filterForm->addItemToBottomRow($reset); $audit_wdgt->addFlicker($filterForm, CProfile::get('web.auditlogs.filter.state', 1)); $scroll_div = new CDiv(); $scroll_div->setAttribute('id', 'scrollbar_cntr'); $audit_wdgt->addFlicker($scroll_div, CProfile::get('web.auditlogs.filter.state', 1)); //------- $effectiveperiod = navigation_bar_calc('web.auditlogs.timeline', 0, true); $bstime = $_REQUEST['stime']; $from = zbxDateToTime($_REQUEST['stime']); $till = $from + $effectiveperiod; $sql_cond = array(); if ($_REQUEST['alias']) { $sql_cond['alias'] = ' AND u.alias=' . zbx_dbstr($_REQUEST['alias']); } if ($_REQUEST['action'] > -1) { $sql_cond['action'] = ' AND a.action=' . $_REQUEST['action'] . ' '; }
//-- $effectiveperiod = navigation_bar_calc('web.graph', $_REQUEST['graphid']); $r_form = new CForm(null, 'get'); $r_form->addVar('fullscreen', $_REQUEST['fullscreen']); $r_form->addItem(array(S_GROUP . SPACE, $pageFilter->getGroupsCB(true))); $r_form->addItem(array(SPACE . S_HOST . SPACE, $pageFilter->getHostsCB(true))); $r_form->addItem(array(SPACE . S_GRAPH . SPACE, $pageFilter->getGraphsCB(true))); $icons = array(); $charts_wdgt = new CWidget('hat_charts'); $table = new CTableInfo('...', 'chart'); $header = null; if ($pageFilter->graphsSelected) { $header = $pageFilter->graphs[$pageFilter->graphid]; $scroll_div = new CDiv(); $scroll_div->setAttribute('id', 'scrollbar_cntr'); $charts_wdgt->addFlicker($scroll_div, CProfile::get('web.charts.filter.state', 1)); $graphDims = getGraphDims($_REQUEST['graphid']); if ($graphDims['graphtype'] == GRAPH_TYPE_PIE || $graphDims['graphtype'] == GRAPH_TYPE_EXPLODED) { $loadSBox = 0; $scrollWidthByImage = 0; $containerid = 'graph_cont1'; $src = 'chart6.php?graphid=' . $_REQUEST['graphid']; } else { $loadSBox = 1; $scrollWidthByImage = 1; $containerid = 'graph_cont1'; $src = 'chart2.php?graphid=' . $_REQUEST['graphid']; } $graph_cont = new CCol(); $graph_cont->setAttribute('id', $containerid); $table->addRow($graph_cont);
$status['msg'] = _('Never executed'); $status['style'] = 'unknown'; } elseif ($httpTestData['lastfailedstep'] != 0) { $status['msg'] = $httpTestData['error'] === null ? _('Unknown error') : _s('Error: %1$s', $httpTestData['error']); $status['style'] = 'disabled'; } else { $status['msg'] = _('OK'); $status['style'] = 'enabled'; } $httpdetailsTable->addRow(array(bold(_('TOTAL')), SPACE, bold($totalTime['value'] ? formatHistoryValue($totalTime['value'], $totalTime) : UNKNOWN_VALUE), SPACE, new CSpan($status['msg'], $status['style'] . ' bold'))); $httpdetailsWidget->addItem($httpdetailsTable); $httpdetailsWidget->show(); echo SBR; // create graphs widget $graphsWidget = new CWidget(); $graphsWidget->addFlicker(new CDiv(null, null, 'scrollbar_cntr'), CProfile::get('web.httpdetails.filter.state', 0)); $graphsWidget->addItem(SPACE); $graphTable = new CTableInfo(); $graphTable->setAttribute('id', 'graph'); // dims $graphDims = getGraphDims(); $graphDims['shiftYtop'] += 1; $graphDims['width'] = -120; $graphDims['graphHeight'] = 150; /* * Graph in */ $graphInScreen = new CScreenBase(array('resourcetype' => SCREEN_RESOURCE_GRAPH, 'mode' => SCREEN_MODE_PREVIEW, 'dataId' => 'graph_in', 'profileIdx' => 'web.httptest', 'profileIdx2' => get_request('httptestid'), 'period' => get_request('period'), 'stime' => get_request('stime'))); $graphInScreen->timeline['starttime'] = date(TIMESTAMP_FORMAT, get_min_itemclock_by_itemid($itemIds)); $src = 'chart3.php?height=150' . '&name=' . $httpTest['name'] . '&http_item_type=' . HTTPSTEP_ITEM_TYPE_IN . '&httptestid=' . $httpTest['httptestid'] . '&graphtype=' . GRAPH_TYPE_STACKED . '&period=' . $graphInScreen->timeline['period'] . '&stime=' . $graphInScreen->timeline['stime'] . '&profileIdx=' . $graphInScreen->profileIdx . '&profileIdx2=' . $graphInScreen->profileIdx2; $graphInContainer = new CDiv(new CLink(null, $src), 'flickerfreescreen', 'flickerfreescreen_graph_in');
$screen = CScreenBuilder::getScreen(array('resourcetype' => SCREEN_RESOURCE_HISTORY, 'action' => $this->data['action'], 'items' => $this->data['items'], 'item' => $this->data['item'], 'itemids' => $this->data['itemids'], 'profileIdx' => 'web.item.graph', 'profileIdx2' => reset($this->data['itemids']), 'period' => $this->data['period'], 'stime' => $this->data['stime'], 'filter' => get_request('filter'), 'filter_task' => get_request('filter_task'), 'mark_color' => get_request('mark_color'), 'plaintext' => $this->data['plaintext'])); // append plaintext to widget if ($this->data['plaintext']) { $plaintextSpan = new CSpan(null, 'textblackwhite'); foreach ($headerPlaintext as $text) { $plaintextSpan->addItem(array(new CJSscript($text), BR())); } $screen = $screen->get(); $pre = new CTag('pre', true); foreach ($screen as $text) { $pre->addItem(new CJSscript($text)); } $plaintextSpan->addItem($pre); $historyWidget->addItem($plaintextSpan); } else { $right = new CTable(); $right->addRow($header['right']); $historyWidget->addPageHeader($header['left'], $right); $historyWidget->addItem(SPACE); if (isset($this->data['iv_string'][$this->data['item']['value_type']])) { $historyWidget->addFlicker($filterForm, CProfile::get('web.history.filter.state', 1)); } $historyTable = new CTable(null, 'maxwidth'); $historyTable->addRow($screen->get()); $historyWidget->addItem($historyTable); if ($this->data['action'] == 'showvalues' || $this->data['action'] == 'showgraph') { $historyWidget->addFlicker(new CDiv(null, null, 'scrollbar_cntr'), CProfile::get('web.history.filter.state', 1)); CScreenBuilder::insertScreenStandardJs(array('timeline' => $screen->timeline, 'profileIdx' => $screen->profileIdx)); } } return $historyWidget;
$slideshowForm = new CForm('get'); $slideshowForm->setName('slideForm'); $slideshowForm->addVar('fullscreen', $this->data['fullscreen']); $slideshowsComboBox = new CComboBox('elementid', $this->data['elementId'], 'submit()'); foreach ($this->data['slideshows'] as $slideshow) { $slideshowsComboBox->addItem($slideshow['slideshowid'], $slideshow['name']); } $slideshowForm->addItem(array(_('Slide show') . SPACE, $slideshowsComboBox)); $slideshowWidget->addHeader($this->data['slideshows'][$this->data['elementId']]['name'], $slideshowForm); if ($this->data['screen']) { if (isset($this->data['isDynamicItems'])) { $slideshowForm->addItem(array(SPACE, _('Group'), SPACE, $this->data['pageFilter']->getGroupsCB())); $slideshowForm->addItem(array(SPACE, _('Host'), SPACE, $this->data['pageFilter']->getHostsCB())); } $scrollDiv = new CDiv(); $scrollDiv->setAttribute('id', 'scrollbar_cntr'); $slideshowWidget->addFlicker($scrollDiv, CProfile::get('web.slides.filter.state', 1)); $slideshowWidget->addFlicker(BR(), CProfile::get('web.slides.filter.state', 1)); $slideshowWidget->addItem(new CSpan(_('Loading...'), 'textcolorstyles')); } else { $slideshowWidget->addItem(new CTableInfo(_('No slides found.'))); } } else { $slideshowWidget->addPageHeader(_('SLIDE SHOWS'), array($slideHeaderForm, SPACE, get_icon('fullscreen', array('fullscreen' => $this->data['fullscreen'])))); $slideshowWidget->addItem(BR()); $slideshowWidget->addItem(new CTableInfo(_('No slide shows found.'))); } if ($this->data['elementId'] && isset($this->data['element'])) { require_once dirname(__FILE__) . '/js/monitoring.slides.js.php'; } return $slideshowWidget;
$severity_select->addItem(TRIGGER_SEVERITY_INFORMATION, S_INFORMATION); $severity_select->addItem(TRIGGER_SEVERITY_WARNING, S_WARNING); $severity_select->addItem(TRIGGER_SEVERITY_AVERAGE, S_AVERAGE); $severity_select->addItem(TRIGGER_SEVERITY_HIGH, S_HIGH); $severity_select->addItem(TRIGGER_SEVERITY_DISASTER, S_DISASTER); $filterForm->addRow(S_MIN_SEVERITY, $severity_select); $filterForm->addRow(S_SHOW_ACTIONS, new CCheckBox('show_actions', $_REQUEST['show_actions'], null, 1)); $filterForm->addRow(S_SHOW_DETAILS, new CCheckBox('show_details', $_REQUEST['show_details'], null, 1)); $filterForm->addRow(S_SELECT, new CTextBox('txt_select', $_REQUEST['txt_select'], 40)); $filterForm->addRow(S_INVERSE_SELECT, new CCheckBox('inverse_select', $_REQUEST['inverse_select'], null, 1)); $reset = new CButton('filter_rst', S_RESET); $reset->setType('button'); $reset->setAction('javascript: var url = new Curl(location.href); url.setArgument("filter_rst",1); location.href = url.getUrl();'); $filterForm->addItemToBottomRow(new CButton('filter_set', S_FILTER)); $filterForm->addItemToBottomRow($reset); $trigg_wdgt->addFlicker($filterForm, get_profile('web.tr_status.filter.state', 0)); /*************** FILTER END ******************/ if ($_REQUEST['fullscreen']) { $triggerInfo = new CTriggersInfo(); $triggerInfo->HideHeader(); $triggerInfo->show(); } $m_form = new CForm('acknow.php'); $m_form->setName('tr_status'); $admin_links = $USER_DETAILS['type'] == USER_TYPE_ZABBIX_ADMIN || $USER_DETAILS['type'] == USER_TYPE_SUPER_ADMIN; $table = new CTableInfo(); $table->showStart(); $header = array(); $show_event_col = $config['event_ack_enable'] && $show_events != EVENTS_OPTION_NOEVENT; $table->setHeader(array($show_event_col ? new CCheckBox('all_events', false, "checkAll('" . $m_form->GetName() . "','all_events','events');") : NULL, make_sorting_link(S_SEVERITY, 't.priority'), S_STATUS, make_sorting_link(S_LAST_CHANGE, 't.lastchange'), is_show_all_nodes() ? make_sorting_link(S_NODE, 'h.hostid') : null, $_REQUEST['hostid'] > 0 ? null : make_sorting_link(S_HOST, 'h.host'), make_sorting_link(S_NAME, 't.description'), $_REQUEST['show_actions'] ? S_ACTIONS : NULL, $show_event_col ? S_ACKNOWLEDGED : NULL, S_COMMENTS)); $cond = $_REQUEST['hostid'] > 0 ? ' AND h.hostid=' . $_REQUEST['hostid'] . ' ' : '';
$table = new CTableInfo(null, 'graph'); $table->addRow(new CImg('chart4.php?triggerid=' . $_REQUEST['triggerid'])); $rep2_wdgt->addItem($table); $rep2_wdgt->show(); } else { if (isset($_REQUEST['hostid'])) { $r_form = new CForm(); $r_form->setMethod('get'); $cmbConf = new CComboBox('config', $config, 'submit()'); $cmbConf->addItem(0, S_BY_HOST); $cmbConf->addItem(1, S_BY_TRIGGER_TEMPLATE); $r_form->addItem($cmbConf); $rep2_wdgt->addHeader(S_REPORT_BIG, array(S_MODE . SPACE, $r_form)); // FILTER $filterForm = get_report2_filter($config, $PAGE_GROUPS, $PAGE_HOSTS); $rep2_wdgt->addFlicker($filterForm, CProfile::get('web.avail_report.filter.state', 0)); //------- $options = array('output' => array('triggerid', 'description', 'expression', 'value'), 'expandDescription' => true, 'expandData' => true, 'monitored' => true, 'filter' => array()); if (0 == $config) { if ($_REQUEST['groupid'] > 0) { $options['groupids'] = $_REQUEST['groupid']; } if ($_REQUEST['hostid'] > 0) { $options['hostids'] = $_REQUEST['hostid']; } } else { if ($_REQUEST['hostid'] > 0) { $hosts = CHost::get(array('templateids' => $_REQUEST['hostid'])); $options['hostids'] = zbx_objectValues($hosts, 'hostid'); } if (isset($_REQUEST['tpl_triggerid']) && $_REQUEST['tpl_triggerid'] > 0) {
// double div necassary for FireFox $col = new CCol(new CDiv(new CDiv($col), 'overview-mon-severities-container')); $hintTable->addRow(array($col, _s('Age less than %s', convertUnitsS($config['blink_period'])))); } $hintTable->addRow(array(new CCol(SPACE), _('No trigger'))); $help = new CHelp(); $help->setHint($hintTable); // header right $overviewWidget->addPageHeader(_('OVERVIEW'), array(get_icon('fullscreen', array('fullscreen' => $this->data['fullscreen'])), SPACE, $help)); // header left $styleComboBox = new CComboBox('view_style', $this->data['view_style'], 'submit()'); $styleComboBox->addItem(STYLE_TOP, _('Top')); $styleComboBox->addItem(STYLE_LEFT, _('Left')); $hostLocationForm = new CForm('get'); $hostLocationForm->addVar('groupid', $this->data['groupid']); $hostLocationForm->additem(array(_('Hosts location'), SPACE, $styleComboBox)); $overviewWidget->addHeader($hostLocationForm); // filter $filter = $this->data['filter']; $filterFormView = new CView('common.filter.trigger', array('overview' => true, 'filter' => array('showTriggers' => $filter['showTriggers'], 'ackStatus' => $filter['ackStatus'], 'showSeverity' => $filter['showSeverity'], 'statusChange' => $filter['statusChange'], 'statusChangeDays' => $filter['statusChangeDays'], 'txtSelect' => $filter['txtSelect'], 'application' => $filter['application'], 'inventory' => $filter['inventory'], 'showMaintenance' => $filter['showMaintenance'], 'hostId' => $this->data['hostid'], 'groupId' => $this->data['groupid'], 'fullScreen' => $this->data['fullscreen']))); $filterForm = $filterFormView->render(); $overviewWidget->addFlicker($filterForm, CProfile::get('web.overview.filter.state', 0)); // data table if ($data['pageFilter']->groupsSelected) { global $page; $dataTable = getTriggersOverview($this->data['hosts'], $this->data['triggers'], $page['file'], $this->data['view_style']); } else { $dataTable = new CTableInfo(_('No triggers found.')); } $overviewWidget->addItem($dataTable); return $overviewWidget;
$available_hosts = $pageFilter->hostsSelected ? array_keys($pageFilter->hosts) : array(); $r_form->addItem(array(_('Group') . SPACE, $pageFilter->getGroupsCB(true))); $r_form->addItem(array(SPACE . _('Host') . SPACE, $pageFilter->getHostsCB(true))); $latest_wdgt->addHeader(_('Items'), $r_form); //------------- /************************* FILTER **************************/ /***********************************************************/ $filterForm = new CFormTable(null, null, 'get'); $filterForm->setAttribute('name', 'zbx_filter'); $filterForm->setAttribute('id', 'zbx_filter'); $filterForm->addRow(_('Show items with name like'), new CTextBox('select', $_REQUEST['select'], 20)); $filterForm->addRow(_('Show items without data'), new CCheckBox('show_without_data', $_REQUEST['show_without_data'], null, 1)); $reset = new CButton("filter_rst", _('Reset'), 'javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst",1); location.href = uri.getUrl();'); $filterForm->addItemToBottomRow(new CSubmit("filter_set", _('Filter'))); $filterForm->addItemToBottomRow($reset); $latest_wdgt->addFlicker($filterForm, CProfile::get('web.latest.filter.state', 1)); //------- validate_sort_and_sortorder('i.name', ZBX_SORT_UP); $_REQUEST['apps'] = get_request('apps', array()); $apps = zbx_toHash($_REQUEST['apps']); if (isset($_REQUEST['open'])) { $showAll = 1; if (isset($_REQUEST['applicationid'])) { $apps[$_REQUEST['applicationid']] = $_REQUEST['applicationid']; } } else { $hideAll = 1; if (isset($_REQUEST['applicationid'])) { $apps[$_REQUEST['applicationid']] = $_REQUEST['applicationid']; } }
if (empty($this->data['hostid'])) { $createButton = new CSubmit('form', _('Create item (select host first)')); $createButton->setEnabled(false); $createForm->addItem($createButton); } else { $createForm->addVar('hostid', $this->data['hostid']); $createForm->addItem(new CSubmit('form', _('Create item'))); } $itemsWidget->addPageHeader(_('CONFIGURATION OF ITEMS'), $createForm); // header $itemsWidget->addHeader(_('Items')); $itemsWidget->addHeaderRowNumber(); if (!empty($this->data['hostid'])) { $itemsWidget->addItem(get_header_host_table('items', $this->data['hostid'])); } $itemsWidget->addFlicker($this->data['flicker'], CProfile::get('web.items.filter.state', 0)); // create form $itemForm = new CForm(); $itemForm->setName('items'); if (!empty($this->data['hostid'])) { $itemForm->addVar('hostid', $this->data['hostid']); } // create table $itemTable = new CTableInfo($this->data['filterSet'] ? _('No items found.') : _('Specify some filter condition to see the items.')); $itemTable->setHeader(array(new CCheckBox('all_items', null, "checkAll('" . $itemForm->getName() . "', 'all_items', 'group_itemid');"), _('Wizard'), empty($this->data['filter_hostid']) ? _('Host') : null, make_sorting_header(_('Name'), 'name', $this->data['sort'], $this->data['sortorder']), _('Triggers'), make_sorting_header(_('Key'), 'key_', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Interval'), 'delay', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('History'), 'history', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Trends'), 'trends', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Type'), 'type', $this->data['sort'], $this->data['sortorder']), _('Applications'), make_sorting_header(_('Status'), 'status', $this->data['sort'], $this->data['sortorder']), $data['showInfoColumn'] ? _('Info') : null)); $currentTime = time(); foreach ($this->data['items'] as $item) { // description $description = array(); if (!empty($item['template_host'])) { $description[] = new CLink(CHtml::encode($item['template_host']['name']), '?hostid=' . $item['template_host']['hostid'] . '&filter_set=1', 'unknown');
} else { $trigger = ''; } $row = new CRow(array(new CCol(S_TRIGGER, 'form_row_l'), new CCol(array(new CTextBox('trigger', $trigger, 96, 'yes'), new CButton("btn1", S_SELECT, "return PopUp('popup.php?" . "dstfrm=" . $filterForm->getName() . "&dstfld1=triggerid&dstfld2=trigger" . "&srctbl=triggers&srcfld1=triggerid&srcfld2=description&real_hosts=1');", 'T')), 'form_row_r'))); $filterForm->addRow($row); $filterForm->addVar('hide_unknown', $_REQUEST['hide_unknown']); $unkcbx = new CCheckBox('hide_unk', $_REQUEST['hide_unknown'], null, '1'); $unkcbx->setAction('javascript: create_var("' . $filterForm->GetName() . '", "hide_unknown", (this.checked?1:0), 0); '); $filterForm->addRow(S_HIDE_UNKNOWN, $unkcbx); $reset = new CButton('filter_rst', S_RESET); $reset->setType('button'); $reset->setAction('javascript: var uri = new Curl(location.href); uri.setArgument("filter_rst",1); location.href = uri.getUrl();'); $filterForm->addItemToBottomRow(new CButton('filter_set', S_FILTER)); $filterForm->addItemToBottomRow($reset); } $events_wdgt->addFlicker($filterForm, CProfile::get('web.events.filter.state', 0)); $scroll_div = new CDiv(); $scroll_div->setAttribute('id', 'scrollbar_cntr'); $events_wdgt->addFlicker($scroll_div, CProfile::get('web.events.filter.state', 0)); // }}} FILTER $table = new CTableInfo(S_NO_EVENTS_FOUND); // CHECK IF EVENTS EXISTS {{{ $options = array('output' => API_OUTPUT_EXTEND, 'sortfield' => 'eventid', 'sortorder' => ZBX_SORT_UP, 'nopermissions' => 1, 'limit' => 1); if ($source == EVENT_SOURCE_DISCOVERY) { $options['source'] = EVENT_SOURCE_DISCOVERY; } else { if (isset($_REQUEST['triggerid']) && $_REQUEST['triggerid'] > 0) { $options['object'] = EVENT_OBJECT_TRIGGER; $options['triggerids'] = $_REQUEST['triggerid']; } }
$filterForm->setAttribute('id', 'zbx_filter'); $filterTable = new CTable(null, 'filter'); $filterTable->setCellPadding(0); $filterTable->setCellSpacing(0); $filterTable->addRow(array(new CCol(bold(_('Host groups') . ':'), 'label'), new CCol(new CMultiSelect(array('name' => 'groupids[]', 'objectName' => 'hostGroup', 'data' => $multiSelectHostGroupData, 'popup' => array('parameters' => 'srctbl=host_groups&dstfrm=' . $filterForm->getName() . '&dstfld1=groupids_' . '&srcfld1=groupid&multiselect=1', 'width' => 450, 'height' => 450, 'buttonClass' => 'input filter-multiselect-select-button'))), 'inputcol'), new CCol(bold(_('Name') . ':'), 'label'), new CCol(new CTextBox('select', $filter['select'], 40), 'inputcol'))); $filterTable->addRow(array(new CCol(bold(_('Hosts') . ':'), 'label'), new CCol(new CMultiSelect(array('name' => 'hostids[]', 'objectName' => 'hosts', 'data' => $multiSelectHostData, 'popup' => array('parameters' => 'srctbl=hosts&dstfrm=' . $filterForm->getName() . '&dstfld1=hostids_&srcfld1=hostid' . '&real_hosts=1&multiselect=1', 'width' => 450, 'height' => 450, 'buttonClass' => 'input filter-multiselect-select-button'))), 'inputcol'), new CCol(bold(_('Show items without data') . ':'), 'label'), new CCol(new CCheckBox('show_without_data', $filter['showWithoutData'], null, 1), 'inputcol'))); $filterTable->addRow(array(new CCol(bold(_('Application') . ':'), 'label'), new CCol(array(new CTextBox('application', $filter['application']), new CButton('application_name', _('Select'), 'return PopUp("popup.php?srctbl=applications&srcfld1=name&real_hosts=1&dstfld1=application' . '&with_applications=1&dstfrm=' . $filterForm->getName() . '");', 'filter-select-button')), 'inputcol'), new CCol(bold(_('Show details') . ':'), 'label'), new CCol(new CCheckBox('show_details', $filter['showDetails'], null, 1), 'inputcol'))); $filterButton = new CSubmit('filter_set', _('Filter'), 'chkbxRange.clearSelectedOnFilterChange();'); $filterButton->useJQueryStyle(); $resetButton = new CSubmit('filter_rst', _('Reset'), 'chkbxRange.clearSelectedOnFilterChange();'); $resetButton->useJQueryStyle(); $divButtons = new CDiv(array($filterButton, SPACE, $resetButton)); $divButtons->setAttribute('style', 'padding: 4px 0px;'); $filterTable->addRow(new CCol($divButtons, 'controls', 4)); $filterForm->addItem($filterTable); $latestWidget->addFlicker($filterForm, CProfile::get('web.latest.filter.state', 0)); $latestWidget->addPageHeader(_('LATEST DATA'), get_icon('fullscreen', array('fullscreen' => $_REQUEST['fullscreen']))); $form = new CForm('GET', 'history.php'); $form->setName('items'); // set an ID for the hidden input so that it wouldn't conflict with the ID of the "Go" button list $form->addItem(new CVar('action', HISTORY_BATCH_GRAPH, 'action-hidden')); // table $table = new CTableInfo($filterSet ? _('No values found.') : _('Specify some filter condition to see the values.')); if ($singleHostSelected) { $hostHeader = null; $hostColumn = null; } else { $hostHeader = make_sorting_header(_('Host'), 'host', $sortField, $sortOrder); $hostHeader->addClass('latest-host'); $hostHeader->setAttribute('title', _('Host')); $hostColumn = '';
$exactComboBox->addItem('0', _('like')); $exactComboBox->addItem('1', _('exactly')); $filterTable->addRow(array(array(array(bold(_('Field')), SPACE, $inventoryFieldsComboBox), array($exactComboBox, new CTextBox('filter_field_value', $this->data['filterFieldValue'], 20)))), 'host-inventories'); $filter = new CSubmit('filter_set', _('Filter')); $filter->useJQueryStyle('main'); $reset = new CSubmit('filter_rst', _('Reset')); $reset->useJQueryStyle(); $divButtons = new CDiv(array($filter, SPACE, $reset)); $divButtons->setAttribute('style', 'padding: 4px 0px;'); $footerCol = new CCol($divButtons, 'controls'); $filterTable->addRow($footerCol); $filterForm = new CForm('get'); $filterForm->setAttribute('name', 'zbx_filter'); $filterForm->setAttribute('id', 'zbx_filter'); $filterForm->addItem($filterTable); $hostInventoryWidget->addFlicker($filterForm, CProfile::get('web.hostinventories.filter.state', 0)); $hostInventoryWidget->addHeaderRowNumber(); $table = new CTableInfo(_('No hosts found.')); $table->setHeader(array(make_sorting_header(_('Host'), 'name', $this->data['sort'], $this->data['sortorder']), _('Group'), make_sorting_header(_('Name'), 'pr_name', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Type'), 'pr_type', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('OS'), 'pr_os', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Serial number A'), 'pr_serialno_a', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('Tag'), 'pr_tag', $this->data['sort'], $this->data['sortorder']), make_sorting_header(_('MAC address A'), 'pr_macaddress_a', $this->data['sort'], $this->data['sortorder']))); foreach ($this->data['hosts'] as $host) { $hostGroups = array(); foreach ($host['groups'] as $group) { $hostGroups[] = $group['name']; } natsort($hostGroups); $hostGroups = implode(', ', $hostGroups); $row = array(new CLink($host['name'], '?hostid=' . $host['hostid'] . url_param('groupid'), $host['status'] == HOST_STATUS_NOT_MONITORED ? 'not-monitored' : ''), $hostGroups, zbx_str2links($host['inventory']['name']), zbx_str2links($host['inventory']['type']), zbx_str2links($host['inventory']['os']), zbx_str2links($host['inventory']['serialno_a']), zbx_str2links($host['inventory']['tag']), zbx_str2links($host['inventory']['macaddress_a'])); $table->addRow($row); } $table = array($this->data['paging'], $table, $this->data['paging']); $hostInventoryWidget->addItem($table);
SELECT email_schedule.*,COUNT(email_match.schedule) as `email_count` FROM email_tracker.email_schedule LEFT JOIN email_tracker.email_match ON email_match.schedule = email_schedule.id GROUP BY email_schedule.id ')); foreach ($result as $row) { $schedules[$row['id']] = $row['name']; } $r_form->addItem(array(SPACE . _('Mail Filter Rule') . SPACE, new CComboBox('schedule', $selected_schedule, 'javascript: submit();', $schedules))); $eventsWidget->addHeader(_('Emails'), $r_form); $eventsWidget->addHeaderRowNumber(); $filterForm = null; // //if ($source == EVENT_SOURCE_TRIGGERS) { $filterForm = new CFormTable(null, null, 'get'); //$eventsWidget->addFlicker(null, CProfile::get('web.events.filter.state', 0)); $scroll = new CDiv(); $scroll->setAttribute('id', 'scrollbar_cntr'); $eventsWidget->addFlicker($scroll, CProfile::get('web.maillog.filter.state', 0)); /* * Display */ $table = new CTableInfo(_('No emails found.'), 'tableinfo email-log'); $config = select_config(); // source not discovery i.e. trigger $table->setHeader(array(new CCol(_('Recieved'), "el_time"), new CCol(_('From/To'), "el_from_to"))); $result = DbFetchArray(DBselect(' SELECT count(*) as `total` FROM email_tracker.email_match JOIN email_tracker.email ON email_match.email = email.id WHERE ' . $timeFilter . ' ' . $scheduleFilter)); $total = 0; if (isset($result[0])) { $total = $result[0]['total']; } $pager_page = 1; if (isset($_REQUEST['page'])) {