*/ $dashboardWidget = new CWidget('dashboard_wdgt'); $dashboardWidget->setClass('header'); $dashboardWidget->addHeader(_('PERSONAL DASHBOARD'), array(new CIcon(_s('Configure (Filter %s)', $dashconf['filterEnable'] ? _('Enabled') : _('Disabled')), $dashconf['filterEnable'] ? 'iconconfig_hl' : 'iconconfig', "document.location = 'dashconf.php';"), SPACE, get_icon('fullscreen', array('fullscreen' => $_REQUEST['fullscreen'])))); // js menu arrays $menu = array(); $submenu = array(); make_graph_menu($menu, $submenu); make_sysmap_menu($menu, $submenu); make_screen_menu($menu, $submenu); make_refresh_menu('mainpage', 'hat_syssum', CProfile::get('web.dashboard.rf_rate.hat_syssum', 60), null, $menu, $submenu); make_refresh_menu('mainpage', 'hat_hoststat', CProfile::get('web.dashboard.rf_rate.hat_hoststat', 60), null, $menu, $submenu); make_refresh_menu('mainpage', 'hat_stszbx', CProfile::get('web.dashboard.rf_rate.hat_stszbx', 60), null, $menu, $submenu); make_refresh_menu('mainpage', 'hat_lastiss', CProfile::get('web.dashboard.rf_rate.hat_lastiss', 60), null, $menu, $submenu); make_refresh_menu('mainpage', 'hat_webovr', CProfile::get('web.dashboard.rf_rate.hat_webovr', 60), null, $menu, $submenu); make_refresh_menu('mainpage', 'hat_dscvry', CProfile::get('web.dashboard.rf_rate.hat_dscvry', 60), null, $menu, $submenu); insert_js('var page_menu=' . zbx_jsvalue($menu) . ";\n" . 'var page_submenu=' . zbx_jsvalue($submenu) . ";\n"); /* * Left column */ $leftColumn = array(); // favorite graphs $graph_menu = get_icon('menu', array('menu' => 'graphs')); $fav_grph = new CUIWidget('hat_favgrph', make_favorite_graphs(), CProfile::get('web.dashboard.hats.hat_favgrph.state', 1)); $fav_grph->setHeader(_('Favourite graphs'), array($graph_menu)); $fav_grph->setFooter(new CLink(_('Graphs') . ' »', 'charts.php', 'highlight'), true); $leftColumn[] = $fav_grph; // favorite screens $screen_menu = get_icon('menu', array('menu' => 'screens')); $fav_scr = new CUIWidget('hat_favscr', make_favorite_screens(), CProfile::get('web.dashboard.hats.hat_favscr.state', 1)); $fav_scr->setHeader(_('Favourite screens'), array($screen_menu));
} else { $icon = new CDiv(SPACE, 'iconplus'); $icon->setAttribute('title', S_ADD_TO . ' ' . S_FAVOURITES); $icon->addAction('onclick', new CScript("javascript: add2favorites('slideshowid','" . $elementid . "');")); } $icon->setAttribute('id', 'addrm_fav'); $url = '?elementid=' . $elementid . ($_REQUEST['fullscreen'] ? '' : '&fullscreen=1'); $url .= url_param('groupid') . url_param('hostid'); $fs_icon = new CDiv(SPACE, 'fullscreen'); $fs_icon->setAttribute('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN); $fs_icon->addAction('onclick', new CScript("javascript: document.location = '" . $url . "';")); } $menu = array(); $submenu = array(); // js menu arrays make_refresh_menu('mainpage', 'hat_slides', get_profile('web.slides.rf_rate.hat_slides', $element['delay'], null, $elementid), array('elementid' => $elementid), $menu, $submenu); insert_js('var page_menu=' . zbx_jsvalue($menu) . ";\n" . 'var page_submenu=' . zbx_jsvalue($submenu) . ";\n"); // -------------- $tab = new CTable(); $tab->setCellPadding(0); $tab->setCellSpacing(0); $tab->setAttribute('border', 0); $tab->setAttribute('width', '100%'); // Refresh tab $refresh_tab = array(array('id' => 'hat_slides', 'frequency' => get_profile('web.slides.rf_rate.hat_slides', $element['delay'], null, $elementid), 'url' => 'slides.php?elementid=' . $elementid . url_param('stime') . url_param('period') . url_param('groupid') . url_param('hostid'), 'params' => array('lastupdate' => time()))); add_doll_objects($refresh_tab); $refresh_icon = new CDiv(SPACE, 'iconmenu'); $refresh_icon->addAction('onclick', 'javascript: create_page_menu(event,"hat_slides");'); $refresh_icon->setAttribute('title', S_MENU); if (isset($elementid)) { $effectiveperiod = navigation_bar_calc();
$data['elementid'] = $slideshow['slideshowid']; } // get screen $data['screen'] = empty($data['elementid']) ? array() : get_slideshow($data['elementid'], 0); if (!empty($data['screen'])) { // get groups and hosts if (check_dynamic_items($data['elementid'], 1)) { $data['isDynamicItems'] = true; $data['pageFilter'] = new CPageFilter(array('groups' => array('monitored_hosts' => true, 'with_items' => true), 'hosts' => array('monitored_hosts' => true, 'with_items' => true, 'DDFirstLabel' => _('Default')), 'hostid' => get_request('hostid', null), 'groupid' => get_request('groupid', null))); } // get element $data['element'] = get_slideshow_by_slideshowid($data['elementid']); if ($data['screen']['delay'] > 0) { $data['element']['delay'] = $data['screen']['delay']; } show_messages(); // js menu $data['menu'] = array(); $data['submenu'] = array(); $data['refresh_multiplier'] = CProfile::get('web.slides.rf_rate.hat_slides', 1, $data['elementid']); if (empty($data['refresh_multiplier'])) { $data['refresh_multiplier'] = 1; CProfile::update('web.slides.rf_rate.hat_slides', $data['refresh_multiplier'], PROFILE_TYPE_STR, $data['elementid']); } make_refresh_menu('mainpage', 'hat_slides', $data['refresh_multiplier'], array('elementid' => $data['elementid']), $data['menu'], $data['submenu'], 2); } // render view $slidesView = new CView('monitoring.slides', $data); $slidesView->render(); $slidesView->show(); require_once dirname(__FILE__) . '/include/page_footer.php';
$dashboardWidget->addHeader(_('PERSONAL DASHBOARD'), array(new CIcon(_s('Configure (Filter %s)', $dashconf['filterEnable'] ? _('Enabled') : _('Disabled')), $dashconf['filterEnable'] ? 'iconconfig_hl' : 'iconconfig', "document.location = 'dashconf.php';"), SPACE, get_icon('fullscreen', array('fullscreen' => $_REQUEST['fullscreen'])))); // js menu arrays $menu = array(); $submenu = array(); make_graph_menu($menu, $submenu); make_sysmap_menu($menu, $submenu); make_screen_menu($menu, $submenu); make_refresh_menu('mainpage', 'hat_syssum', CProfile::get('web.dashboard.widget.syssum.rf_rate', 60), null, $menu, $submenu); make_refresh_menu('mainpage', 'hat_hoststat', CProfile::get('web.dashboard.widget.hoststat.rf_rate', 60), null, $menu, $submenu); make_refresh_menu('mainpage', 'hat_stszbx', CProfile::get('web.dashboard.widget.stszbx.rf_rate', 60), null, $menu, $submenu); make_refresh_menu('mainpage', 'hat_lastiss', CProfile::get('web.dashboard.widget.lastiss.rf_rate', 60), null, $menu, $submenu); make_refresh_menu('mainpage', 'hat_webovr', CProfile::get('web.dashboard.widget.webovr.rf_rate', 60), null, $menu, $submenu); make_refresh_menu('mainpage', 'hat_dscvry', CProfile::get('web.dashboard.widget.dscvry.rf_rate', 60), null, $menu, $submenu); make_refresh_menu('mainpage', 'hat_ipmi', CProfile::get('web.dashboard.widget.ipmi.rf_rate', 60), null, $menu, $submenu); make_refresh_menu('mainpage', 'hat_vsphere', CProfile::get('web.dashboard.widget.vsphere.rf_rate', 60), null, $menu, $submenu); make_refresh_menu('mainpage', 'hat_aws', CProfile::get('web.dashboard.widget.aws.rf_rate', 60), null, $menu, $submenu); insert_js('var page_menu=' . zbx_jsvalue($menu) . ";\n" . 'var page_submenu=' . zbx_jsvalue($submenu) . ";\n"); /* * Columns */ $columns = array_fill(0, 3, array()); // refresh tab $refresh_tab = array(array('id' => 'hat_syssum', 'frequency' => CProfile::get('web.dashboard.widget.syssum.rf_rate', 120)), array('id' => 'hat_stszbx', 'frequency' => CProfile::get('web.dashboard.widget.stszbx.rf_rate', 120)), array('id' => 'hat_lastiss', 'frequency' => CProfile::get('web.dashboard.widget.lastiss.rf_rate', 60)), array('id' => 'hat_webovr', 'frequency' => CProfile::get('web.dashboard.widget.webovr.rf_rate', 60)), array('id' => 'hat_hoststat', 'frequency' => CProfile::get('web.dashboard.widget.hoststat.rf_rate', 60)), array('id' => 'hat_ipmi', 'frequency' => CProfile::get('web.dashboard.widget.ipmi.rf_rate', 60)), array('id' => 'hat_vsphere', 'frequency' => CProfile::get('web.dashboard.widget.vsphere.rf_rate', 60)), array('id' => 'hat_aws', 'frequency' => CProfile::get('web.dashboard.widget.aws.rf_rate', 60))); // favorite graphs $graph_menu = get_icon('menu', array('menu' => 'graphs')); $fav_grph = new CUIWidget('hat_favgrph', make_favorite_graphs(), CProfile::get('web.dashboard.widget.favgrph.state', 1)); $fav_grph->setHeader(_('Favourite graphs'), array($graph_menu)); $fav_grph->setFooter(new CLink(_('Graphs') . ' »', 'charts.php', 'highlight'), true); $col = CProfile::get('web.dashboard.widget.favgrph.col', '0'); $row = CProfile::get('web.dashboard.widget.favgrph.row', '0'); if (!isset($columns[$col][$row])) {
//------------- $left_tab = new CTable(); $left_tab->setCellPadding(3); $left_tab->setCellSpacing(3); $left_tab->addOption('border', 0); $menu = array(); $submenu = array(); // js menu arrays make_graph_menu($menu, $submenu); make_sysmap_menu($menu, $submenu); make_screen_menu($menu, $submenu); make_refresh_menu('mainpage', 'hat_syssum', get_profile('web.dahsboard.rf_rate.hat_syssum', 60), null, $menu, $submenu); make_refresh_menu('mainpage', 'hat_stszbx', get_profile('web.dahsboard.rf_rate.hat_stszbx', 60), null, $menu, $submenu); make_refresh_menu('mainpage', 'hat_lastiss', get_profile('web.dahsboard.rf_rate.hat_lastiss', 60), null, $menu, $submenu); make_refresh_menu('mainpage', 'hat_webovr', get_profile('web.dahsboard.rf_rate.hat_webovr', 60), null, $menu, $submenu); make_refresh_menu('mainpage', 'hat_dscvry', get_profile('web.dahsboard.rf_rate.hat_dscvry', 60), null, $menu, $submenu); insert_js('var page_menu=' . zbx_jsvalue($menu) . ";\n" . 'var page_submenu=' . zbx_jsvalue($submenu) . ";\n"); // -------------- $graph_menu = new CDiv(SPACE, 'iconmenu'); $graph_menu->addAction('onclick', 'javascript: create_page_menu(event,"graphs");'); $graph_menu->addOption('title', S_MENU); $left_tab->addRow(create_hat(S_FAVORITE . SPACE . S_GRAPHS, make_favorite_graphs(), array($graph_menu), 'hat_favgrph', get_profile('web.dashboard.hats.hat_favgrph.state', 1))); $screen_menu = new CDiv(SPACE, 'iconmenu'); $screen_menu->addAction('onclick', 'javascript: create_page_menu(event,"screens");'); $screen_menu->addOption('title', S_MENU); $left_tab->addRow(create_hat(S_FAVORITE . SPACE . S_SCREENS, make_favorite_screens(), array($screen_menu), 'hat_favscr', get_profile('web.dashboard.hats.hat_favscr.state', 1))); $sysmap_menu = new CDiv(SPACE, 'iconmenu'); $sysmap_menu->addAction('onclick', 'javascript: create_page_menu(event,"sysmaps");'); $sysmap_menu->addOption('title', S_MENU); $left_tab->addRow(create_hat(S_FAVORITE . SPACE . S_MAPS, make_favorite_maps(), array($sysmap_menu), 'hat_favmap', get_profile('web.dashboard.hats.hat_favmap.state', 1))); $left_tab->addRow(SPACE);
} $element = get_slideshow_by_slideshowid($elementid); if ($screen['delay'] > 0) { $element['delay'] = $screen['delay']; } show_messages(); // js menu arrays $menu = array(); $submenu = array(); $refresh_multipl = CProfile::get('web.slides.rf_rate.hat_slides', 1, $elementid); // workaround for 1.8.2 upgrade, earlier value was integer type, now str if (empty($refresh_multipl)) { $refresh_multipl = 1; CProfile::update('web.slides.rf_rate.hat_slides', $refresh_multipl, PROFILE_TYPE_STR, $elementid); } make_refresh_menu('mainpage', 'hat_slides', $refresh_multipl, array('elementid' => $elementid), $menu, $submenu, 2); insert_js('var page_menu=' . zbx_jsvalue($menu) . ";\n" . 'var page_submenu=' . zbx_jsvalue($submenu) . ";\n"); // -------------- $refresh_tab = array(array('id' => 'hat_slides', 'frequency' => $element['delay'] * $refresh_multipl, 'url' => 'slides.php?elementid=' . $elementid . (is_null($tmpstime) ? '' : '&stime=' . $tmpstime) . url_param('period') . url_param('groupid') . url_param('hostid'), 'params' => array('lastupdate' => time()))); add_doll_objects($refresh_tab); $effectiveperiod = navigation_bar_calc(); if (2 != $_REQUEST['fullscreen']) { // NAV BAR $timeline = array(); $timeline['period'] = $effectiveperiod; $timeline['starttime'] = date('YmdHis', time() - ZBX_MAX_PERIOD); if (isset($_REQUEST['stime'])) { $timeline['usertime'] = date('YmdHis', zbxDateToTime($_REQUEST['stime']) + $timeline['period']); } $scroll_div = new CDiv(); $scroll_div->setAttribute('id', 'scrollbar_cntr');