예제 #1
0
            $discoveryLink = array(new CLink(_('Discovery'), 'host_discovery.php?' . $link), ' (' . $template['discoveries'] . ')');
            $httpTestsLink = array(new CLink(_('Web'), 'httpconf.php?' . $link), ' (' . $template['httpTests'] . ')');
        } else {
            // host
            $templateCell = array(new CSpan($templateVisibleName));
            $applications_link = _('Applications') . ' (' . $template['applications'] . ')';
            $items_link = _('Items') . ' (' . $template['items'] . ')';
            $triggers_link = _('Triggers') . ' (' . $template['triggers'] . ')';
            $graphs_link = _('Graphs') . ' (' . $template['graphs'] . ')';
            $screensLink = _('Screens') . ' (' . $template['screens'] . ')';
            $discoveryLink = _('Discovery') . ' (' . $template['discoveries'] . ')';
            $httpTestsLink = _('Web') . ' (' . $template['httpTests'] . ')';
        }
        // display the template host name only if it matches the search string and is different from the visible name
        if ($template['host'] !== $template['name'] && stripos($template['host'], $search) !== false) {
            $templateCell[] = BR();
            $templateCell[] = '(';
            $templateCell[] = make_decoration($template['host'], $search);
            $templateCell[] = ')';
        }
        $table->addRow(array($templateCell, $applications_link, $items_link, $triggers_link, $graphs_link, $screensLink, $discoveryLink, $httpTestsLink));
    }
    $searchTemplateWidget = new CCollapsibleUiWidget('search_templates', $table);
    $searchTemplateWidget->open = (bool) CProfile::get('web.search.hats.search_templates.state', true);
    $searchTemplateWidget->setHeader(_('Templates'));
    $searchTemplateWidget->setFooter(_s('Displaying %1$s of %2$s found', $viewCount, $overalCount));
    $searchWidget->addItem(new CDiv($searchTemplateWidget));
}
//----------------
$searchWidget->show();
require_once dirname(__FILE__) . '/include/page_footer.php';
예제 #2
0
$webMonitoring->setHeader(_('Web monitoring'), $icon);
$webMonitoring->setFooter(new CDiv(SPACE, 'textwhite', WIDGET_WEB_OVERVIEW . '_footer'));
$col = CProfile::get('web.dashboard.widget.' . WIDGET_WEB_OVERVIEW . '.col', 1);
$row = CProfile::get('web.dashboard.widget.' . WIDGET_WEB_OVERVIEW . '.row', 4);
$dashboardGrid[$col][$row] = $webMonitoring;
$widgetRefreshParams[WIDGET_WEB_OVERVIEW] = array('frequency' => $rate, 'url' => '?output=html', 'counter' => 0, 'darken' => 0, 'params' => array('widgetRefresh' => WIDGET_WEB_OVERVIEW));
// discovery rules
$dbDiscoveryRules = DBfetch(DBselect('SELECT COUNT(d.druleid) AS cnt' . ' FROM drules d' . ' WHERE d.status=' . DRULE_STATUS_ACTIVE));
if ($dbDiscoveryRules['cnt'] > 0 && check_right_on_discovery()) {
    $rate = CProfile::get('web.dashboard.widget.' . WIDGET_DISCOVERY_STATUS . '.rf_rate', 60);
    $icon = new CIcon(_('Menu'), 'iconmenu');
    $icon->setMenuPopup(CMenuPopupHelper::getRefresh(WIDGET_DISCOVERY_STATUS, $rate));
    $discoveryStatus = new CCollapsibleUiWidget(WIDGET_DISCOVERY_STATUS, new CSpan(_('Loading...'), 'textcolorstyles'));
    $discoveryStatus->open = (bool) CProfile::get('web.dashboard.widget.' . WIDGET_DISCOVERY_STATUS . '.state', true);
    $discoveryStatus->setHeader(_('Discovery status'), $icon);
    $discoveryStatus->setFooter(new CDiv(SPACE, 'textwhite', WIDGET_DISCOVERY_STATUS . '_footer'));
    $col = CProfile::get('web.dashboard.widget.' . WIDGET_DISCOVERY_STATUS . '.col', 1);
    $row = CProfile::get('web.dashboard.widget.' . WIDGET_DISCOVERY_STATUS . '.row', 5);
    $dashboardGrid[$col][$row] = $discoveryStatus;
    $widgetRefreshParams[WIDGET_DISCOVERY_STATUS] = array('frequency' => $rate, 'url' => '?output=html', 'counter' => 0, 'darken' => 0, 'params' => array('widgetRefresh' => WIDGET_DISCOVERY_STATUS));
}
// sort dashboard grid
foreach ($dashboardGrid as $key => $val) {
    ksort($dashboardGrid[$key]);
}
$dashboardTable = new CTable();
$dashboardTable->addRow(array(new CDiv($dashboardGrid[0], 'column'), new CDiv($dashboardGrid[1], 'column'), new CDiv($dashboardGrid[2], 'column')), 'top');
$dashboardWidget->addItem($dashboardTable);
$dashboardWidget->show();
/*
 * Javascript