Esempio n. 1
0
        if (isset($services[$row['serviceid']])) {
            $services[$row['serviceid']] = array_merge($services[$row['serviceid']], $row);
        } else {
            $services[$row['serviceid']] = $row;
        }
        if (isset($row['serviceupid'])) {
            $services[$row['serviceupid']]['childs'][] = array('id' => $row['serviceid'], 'soft' => 0, 'linkid' => 0);
        }
        if (isset($row['servicedownid'])) {
            $services[$row['serviceid']]['childs'][] = array('id' => $row['servicedownid'], 'soft' => 1, 'linkid' => $row['linkid']);
        }
    }
    $treeServ = array();
    createShowServiceTree($services, $treeServ);
    //return into $treeServ parametr
    //permission issue
    $treeServ = del_empty_nodes($treeServ);
    $tree = new CTree($treeServ, array('caption' => bold(S_SERVICE), 'status' => bold(S_STATUS), 'reason' => bold(S_REASON), 'sla' => bold(S_SLA_LAST_7_DAYS), 'sla2' => bold(nbsp(S_SLA)), 'graph' => bold(S_GRAPH)));
    if ($tree) {
        $url = '?fullscreen=' . ($_REQUEST['fullscreen'] ? '0' : '1');
        $fs_icon = new CDiv(SPACE, 'fullscreen');
        $fs_icon->AddOption('title', $_REQUEST['fullscreen'] ? S_NORMAL . ' ' . S_VIEW : S_FULLSCREEN);
        $fs_icon->AddAction('onclick', new CScript("javascript: document.location = '" . $url . "';"));
        $tab = create_hat(S_IT_SERVICES_BIG, $tree->getHTML(), null, 'hat_services', get_profile('web.srv_status.hats.hat_services.state', 1));
        $tab->Show();
        unset($tab);
    } else {
        error('Can not format Tree. Check logik structure in service links');
    }
}
include_once "include/page_footer.php";
Esempio n. 2
0
        echo $main_header . SBR;
    }
    $_REQUEST['period'] = get_request('period', get_profile('web.item.graph.period', ZBX_PERIOD_DEFAULT, PROFILE_TYPE_INT, $_REQUEST['itemid']));
    if ($_REQUEST['period'] >= ZBX_MIN_PERIOD) {
        update_profile('web.item.graph.period', $_REQUEST['period'], PROFILE_TYPE_INT, $_REQUEST['itemid']);
    }
    $l_header = array(new CLink($item_data['host'], 'latest.php?hostid=' . $item_data['hostid']), ': ', item_description($item_data));
    if ('showgraph' == $_REQUEST['action']) {
        if (infavorites('web.favorite.graphids', $_REQUEST['itemid'], 'itemid')) {
            $icon = new CDiv(SPACE, 'iconminus');
            $icon->AddOption('title', S_REMOVE_FROM . ' ' . S_FAVORITES);
            $icon->AddAction('onclick', new CScript("javascript: rm4favorites('itemid','" . $_REQUEST['itemid'] . "',0);"));
        } else {
            $icon = new CDiv(SPACE, 'iconplus');
            $icon->AddOption('title', S_ADD_TO . ' ' . S_FAVORITES);
            $icon->AddAction('onclick', new CScript("javascript: add2favorites('itemid','" . $_REQUEST['itemid'] . "');"));
        }
        $icon->AddOption('id', 'addrm_fav');
        $icon_tab = new CTable();
        $icon_tab->AddRow(array($icon, SPACE, $l_header));
        $l_header = $icon_tab;
    }
}
$effectiveperiod = navigation_bar_calc();
unset($item_data);
$to_save_request = null;
if (!isset($_REQUEST['plaintext']) && $_REQUEST['fullscreen'] == 0) {
    if ($item_type == ITEM_VALUE_TYPE_LOG) {
        $l_header = new CForm();
        $l_header->SetName('loglist');
        $l_header->AddVar('action', $_REQUEST['action']);