本文整理汇总了PHP中getPagingLine函数的典型用法代码示例。如果您正苦于以下问题:PHP getPagingLine函数的具体用法?PHP getPagingLine怎么用?PHP getPagingLine使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getPagingLine函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: doAction
protected function doAction()
{
$sortField = $this->getInput('sort', CProfile::get('web.proxies.php.sort', 'host'));
$sortOrder = $this->getInput('sortorder', CProfile::get('web.proxies.php.sortorder', ZBX_SORT_UP));
CProfile::update('web.proxies.php.sort', $sortField, PROFILE_TYPE_STR);
CProfile::update('web.proxies.php.sortorder', $sortOrder, PROFILE_TYPE_STR);
$config = select_config();
$data = ['uncheck' => $this->hasInput('uncheck'), 'sort' => $sortField, 'sortorder' => $sortOrder, 'config' => ['max_in_table' => $config['max_in_table']]];
$data['proxies'] = API::Proxy()->get(['output' => ['proxyid', 'host', 'status', 'lastaccess', 'tls_connect', 'tls_accept'], 'selectHosts' => ['hostid', 'name', 'status'], 'sortfield' => $sortField, 'limit' => $config['search_limit'] + 1, 'editable' => true, 'preservekeys' => true]);
// sorting & paging
order_result($data['proxies'], $sortField, $sortOrder);
$url = (new CUrl('zabbix.php'))->setArgument('action', 'proxy.list');
$data['paging'] = getPagingLine($data['proxies'], $sortOrder, $url);
foreach ($data['proxies'] as &$proxy) {
order_result($proxy['hosts'], 'name');
}
unset($proxy);
// get proxy IDs for a *selected* page
$proxyIds = array_keys($data['proxies']);
if ($proxyIds) {
// calculate performance
$dbPerformance = DBselect('SELECT h.proxy_hostid,SUM(1.0/i.delay) AS qps' . ' FROM hosts h,items i' . ' WHERE h.hostid=i.hostid' . ' AND h.status=' . HOST_STATUS_MONITORED . ' AND i.status=' . ITEM_STATUS_ACTIVE . ' AND i.delay<>0' . ' AND i.flags<>' . ZBX_FLAG_DISCOVERY_PROTOTYPE . ' AND ' . dbConditionInt('h.proxy_hostid', $proxyIds) . ' GROUP BY h.proxy_hostid');
while ($performance = DBfetch($dbPerformance)) {
$data['proxies'][$performance['proxy_hostid']]['perf'] = round($performance['qps'], 2);
}
// get items
$items = API::Item()->get(['proxyids' => $proxyIds, 'groupCount' => true, 'countOutput' => true, 'webitems' => true, 'monitored' => true]);
foreach ($items as $item) {
$data['proxies'][$item['proxy_hostid']]['item_count'] = $item['rowscount'];
}
}
$response = new CControllerResponseData($data);
$response->setTitle(_('Configuration of proxies'));
$this->setResponse($response);
}
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:35,代码来源:CControllerProxyList.php
示例2: doAction
protected function doAction()
{
$sortField = $this->getInput('sort', CProfile::get('web.media_types.php.sort', 'description'));
$sortOrder = $this->getInput('sortorder', CProfile::get('web.media_types.php.sortorder', ZBX_SORT_UP));
CProfile::update('web.media_type.php.sort', $sortField, PROFILE_TYPE_STR);
CProfile::update('web.media_types.php.sortorder', $sortOrder, PROFILE_TYPE_STR);
$config = select_config();
$data = ['uncheck' => $this->hasInput('uncheck'), 'sort' => $sortField, 'sortorder' => $sortOrder];
// get media types
$data['mediatypes'] = API::Mediatype()->get(['output' => ['mediatypeid', 'description', 'type', 'smtp_server', 'smtp_helo', 'smtp_email', 'exec_path', 'gsm_modem', 'username', 'status'], 'limit' => $config['search_limit'] + 1, 'editable' => true, 'preservekeys' => true]);
if ($data['mediatypes']) {
// get media types used in actions
$actions = API::Action()->get(['output' => ['actionid', 'name'], 'selectOperations' => ['operationtype', 'opmessage'], 'mediatypeids' => array_keys($data['mediatypes'])]);
foreach ($data['mediatypes'] as &$mediaType) {
$mediaType['typeid'] = $mediaType['type'];
$mediaType['type'] = media_type2str($mediaType['type']);
$mediaType['listOfActions'] = [];
foreach ($actions as $action) {
foreach ($action['operations'] as $operation) {
if ($operation['operationtype'] == OPERATION_TYPE_MESSAGE && $operation['opmessage']['mediatypeid'] == $mediaType['mediatypeid']) {
$mediaType['listOfActions'][$action['actionid']] = ['actionid' => $action['actionid'], 'name' => $action['name']];
}
}
}
order_result($mediaType['listOfActions'], 'name');
}
unset($mediaType);
order_result($data['mediatypes'], $sortField, $sortOrder);
}
$url = (new CUrl('zabbix.php'))->setArgument('action', 'mediatype.list');
$data['paging'] = getPagingLine($data['mediatypes'], $sortOrder, $url);
$response = new CControllerResponseData($data);
$response->setTitle(_('Configuration of media types'));
$this->setResponse($response);
}
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:35,代码来源:CControllerMediatypeList.php
示例3: doAction
protected function doAction()
{
$sortField = $this->getInput('sort', CProfile::get('web.scripts.php.sort', 'name'));
$sortOrder = $this->getInput('sortorder', CProfile::get('web.scripts.php.sortorder', ZBX_SORT_UP));
CProfile::update('web.scripts.php.sort', $sortField, PROFILE_TYPE_STR);
CProfile::update('web.scripts.php.sortorder', $sortOrder, PROFILE_TYPE_STR);
$config = select_config();
$data = ['uncheck' => $this->hasInput('uncheck'), 'sort' => $sortField, 'sortorder' => $sortOrder];
// list of scripts
$data['scripts'] = API::Script()->get(['output' => ['scriptid', 'name', 'command', 'host_access', 'usrgrpid', 'groupid', 'type', 'execute_on'], 'editable' => true, 'limit' => $config['search_limit'] + 1]);
// sorting & paging
order_result($data['scripts'], $sortField, $sortOrder);
$url = (new CUrl('zabbix.php'))->setArgument('action', 'script.list');
$data['paging'] = getPagingLine($data['scripts'], $sortOrder, $url);
// find script host group name and user group name. set to '' if all host/user groups used.
$usrgrpids = [];
$groupids = [];
foreach ($data['scripts'] as &$script) {
$script['userGroupName'] = null;
// all user groups
$script['hostGroupName'] = null;
// all host groups
if ($script['usrgrpid'] != 0) {
$usrgrpids[] = $script['usrgrpid'];
}
if ($script['groupid'] != 0) {
$groupids[] = $script['groupid'];
}
}
unset($script);
if ($usrgrpids) {
$userGroups = API::UserGroup()->get(['output' => ['name'], 'usrgrpids' => $usrgrpids, 'preservekeys' => true]);
foreach ($data['scripts'] as &$script) {
if ($script['usrgrpid'] != 0 && array_key_exists($script['usrgrpid'], $userGroups)) {
$script['userGroupName'] = $userGroups[$script['usrgrpid']]['name'];
}
unset($script['usrgrpid']);
}
unset($script);
}
if ($groupids) {
$hostGroups = API::HostGroup()->get(['output' => ['name'], 'groupids' => $groupids, 'preservekeys' => true]);
foreach ($data['scripts'] as &$script) {
if ($script['groupid'] != 0 && array_key_exists($script['groupid'], $hostGroups)) {
$script['hostGroupName'] = $hostGroups[$script['groupid']]['name'];
}
unset($script['groupid']);
}
unset($script);
}
$response = new CControllerResponseData($data);
$response->setTitle(_('Configuration of scripts'));
$this->setResponse($response);
}
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:54,代码来源:CControllerScriptList.php
示例4: CView
$maintenanceView = new CView('configuration.maintenance.edit', $data);
$maintenanceView->render();
$maintenanceView->show();
} else {
$sortfield = getPageSortField('name');
$sortorder = getPageSortOrder();
// get only maintenance IDs for paging
$options = array('output' => array('maintenanceid', $sortfield), 'editable' => true, 'sortfield' => $sortfield, 'limit' => $config['search_limit'] + 1);
if ($pageFilter->groupsSelected && $pageFilter->groupid > 0) {
$options['groupids'] = $pageFilter->groupid;
} else {
$options['groupids'] = $config['dropdown_first_entry'] ? null : array();
}
$data['maintenances'] = API::Maintenance()->get($options);
order_result($data['maintenances'], $sortfield, $sortorder);
$data['paging'] = getPagingLine($data['maintenances'], array('maintenanceid'));
// get list of maintenances
$data['maintenances'] = API::Maintenance()->get(array('maintenanceids' => zbx_objectValues($data['maintenances'], 'maintenanceid'), 'output' => API_OUTPUT_EXTEND));
foreach ($data['maintenances'] as $number => $maintenance) {
if ($maintenance['active_till'] < time()) {
$data['maintenances'][$number]['status'] = MAINTENANCE_STATUS_EXPIRED;
} elseif ($maintenance['active_since'] > time()) {
$data['maintenances'][$number]['status'] = MAINTENANCE_STATUS_APPROACH;
} else {
$data['maintenances'][$number]['status'] = MAINTENANCE_STATUS_ACTIVE;
}
}
order_result($data['maintenances'], $sortfield, $sortorder);
$data['pageFilter'] = $pageFilter;
// nodes
if ($data['displayNodes']) {
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:maintenance.php
示例5: array
$data = array('sort' => $sortField, 'sortorder' => $sortOrder);
// list of scripts
$data['scripts'] = API::Script()->get(array('output' => array('scriptid', 'name', 'command', 'host_access', 'usrgrpid', 'groupid', 'type', 'execute_on'), 'editable' => true, 'selectGroups' => API_OUTPUT_EXTEND));
// find script host group name and user group name. set to '' if all host/user groups used.
foreach ($data['scripts'] as $key => $script) {
$scriptId = $script['scriptid'];
if ($script['usrgrpid'] > 0) {
$userGroup = API::UserGroup()->get(array('usrgrpids' => $script['usrgrpid'], 'output' => API_OUTPUT_EXTEND));
$userGroup = reset($userGroup);
$data['scripts'][$key]['userGroupName'] = $userGroup['name'];
} else {
$data['scripts'][$key]['userGroupName'] = '';
// all user groups
}
if ($script['groupid'] > 0) {
$group = array_pop($script['groups']);
$data['scripts'][$key]['hostGroupName'] = $group['name'];
} else {
$data['scripts'][$key]['hostGroupName'] = '';
// all host groups
}
}
// sorting & paging
order_result($data['scripts'], $sortField, $sortOrder);
$data['paging'] = getPagingLine($data['scripts']);
// render view
$scriptView = new CView('administration.script.list', $data);
$scriptView->render();
$scriptView->show();
}
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:scripts.php
示例6: zbx_objectValues
$data['mediatypes'] = API::Mediatype()->get(array('output' => API_OUTPUT_EXTEND, 'preservekeys' => true, 'editable' => true, 'limit' => $config['search_limit'] + 1));
if ($data['mediatypes']) {
// get media types used in actions
$actions = API::Action()->get(array('mediatypeids' => zbx_objectValues($data['mediatypes'], 'mediatypeid'), 'output' => array('actionid', 'name'), 'selectOperations' => array('operationtype', 'opmessage'), 'preservekeys' => true));
foreach ($data['mediatypes'] as $key => $mediaType) {
$data['mediatypes'][$key]['typeid'] = $data['mediatypes'][$key]['type'];
$data['mediatypes'][$key]['type'] = media_type2str($data['mediatypes'][$key]['type']);
$data['mediatypes'][$key]['listOfActions'] = array();
if ($actions) {
foreach ($actions as $actionId => $action) {
foreach ($action['operations'] as $operation) {
if ($operation['operationtype'] == OPERATION_TYPE_MESSAGE && $operation['opmessage']['mediatypeid'] == $mediaType['mediatypeid']) {
$data['mediatypes'][$key]['listOfActions'][$actionId] = array('actionid' => $actionId, 'name' => $action['name']);
}
}
}
order_result($data['mediatypes'][$key]['listOfActions'], 'name');
}
}
order_result($data['mediatypes'], $sortField, $sortOrder);
$data['paging'] = getPagingLine($data['mediatypes'], $sortOrder);
} else {
$arr = array();
$data['paging'] = getPagingLine($arr, $sortOrder);
}
// render view
$mediaTypeView = new CView('administration.mediatypes.list', $data);
$mediaTypeView->render();
$mediaTypeView->show();
}
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:media_types.php
示例7: DBselect
$db_slides = DBselect('SELECT s.* FROM slides s WHERE s.slideshowid=' . zbx_dbstr($data['slideshowid']) . ' ORDER BY s.step');
while ($slide = DBfetch($db_slides)) {
$data['slides'][$slide['step']] = array('slideid' => $slide['slideid'], 'screenid' => $slide['screenid'], 'delay' => $slide['delay']);
}
}
// get slides without delay
$data['slides_without_delay'] = $data['slides'];
for ($i = 0, $size = count($data['slides_without_delay']); $i < $size; $i++) {
unset($data['slides_without_delay'][$i]['delay']);
}
// render view
$slideshowView = new CView('configuration.slideconf.edit', $data);
$slideshowView->render();
$slideshowView->show();
} else {
$data['slides'] = DBfetchArray(DBselect('SELECT s.slideshowid,s.name,s.delay,COUNT(sl.slideshowid) AS cnt' . ' FROM slideshows s' . ' LEFT JOIN slides sl ON sl.slideshowid=s.slideshowid' . whereDbNode('s.slideshowid') . ' GROUP BY s.slideshowid,s.name,s.delay'));
order_result($data['slides'], getPageSortField('name'), getPageSortOrder());
$data['paging'] = getPagingLine($data['slides'], array('slideshowid'));
// nodes
if ($data['displayNodes'] = is_array(get_current_nodeid())) {
foreach ($data['slides'] as &$slide) {
$slide['nodename'] = get_node_name_by_elid($slide['slideshowid'], true);
}
unset($slide);
}
// render view
$slideshowView = new CView('configuration.slideconf.list', $data);
$slideshowView->render();
$slideshowView->show();
}
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:slideconf.php
示例8: mb_strtolower
$haystack = mb_strtolower($data['hosts'][$num]['inventory'][$data['filterField']]);
if ($haystack !== $needle) {
unset($data['hosts'][$num]);
}
}
}
$sort_fields = ['pr_name' => 'name', 'pr_type' => 'type', 'pr_os' => 'os', 'pr_serialno_a' => 'serialno_a', 'pr_tag' => 'tag', 'pr_macaddress_a' => 'macaddress_a'];
if (array_key_exists($sortField, $sort_fields)) {
// copying an inventory field into the upper array level for sorting
foreach ($data['hosts'] as &$host) {
$host[$sortField] = $host['inventory'][$sort_fields[$sortField]];
}
unset($host);
}
$limit = $data['config']['search_limit'] + 1;
order_result($data['hosts'], $sortField, $sortOrder);
if ($sortOrder == ZBX_SORT_UP) {
$data['hosts'] = array_slice($data['hosts'], 0, $limit);
} else {
$data['hosts'] = array_slice($data['hosts'], -$limit, $limit);
}
order_result($data['hosts'], $sortField, $sortOrder);
}
}
$url = (new CUrl('hostinventories.php'))->setArgument('groupid', $data['pageFilter']->groupid);
$data['paging'] = getPagingLine($data['hosts'], $sortOrder, $url);
$hostinventoriesView = new CView('inventory.host.list', $data);
$hostinventoriesView->render();
$hostinventoriesView->show();
}
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:jbfavre,项目名称:debian-zabbix,代码行数:31,代码来源:hostinventories.php
示例9: time
if ($ack_status == ZBX_ACK_STS_WITH_UNACK) {
$options['withUnacknowledgedEvents'] = 1;
}
if ($ack_status == ZBX_ACK_STS_WITH_LAST_UNACK) {
$options['withLastEventUnacknowledged'] = 1;
}
if ($show_severity > -1) {
$options['min_severity'] = $show_severity;
}
if ($_REQUEST['status_change']) {
$options['lastChangeSince'] = time() - $_REQUEST['status_change_days'] * 86400;
}
$triggers = CTrigger::get($options);
// sorting && paging
order_result($triggers, $sortfield, $sortorder);
$paging = getPagingLine($triggers);
$options = array('nodeids' => get_current_nodeid(), 'triggerids' => zbx_objectValues($triggers, 'triggerid'), 'output' => API_OUTPUT_EXTEND, 'select_hosts' => array('hostid', 'host', 'maintenance_status', 'maintenance_type', 'maintenanceid'), 'select_items' => API_OUTPUT_EXTEND, 'select_dependencies' => API_OUTPUT_EXTEND);
$triggers = CTrigger::get($options);
$triggers = zbx_toHash($triggers, 'triggerid');
order_result($triggers, $sortfield, $sortorder);
//---------
if ($config['event_ack_enable']) {
foreach ($triggers as $tnum => $trigger) {
$options = array('countOutput' => 1, 'triggerids' => $trigger['triggerid'], 'object' => EVENT_OBJECT_TRIGGER, 'acknowledged' => 0, 'value' => TRIGGER_VALUE_TRUE, 'nopermissions' => 1);
$triggers[$tnum]['event_count'] = CEvent::get($options);
}
}
$tr_hostids = array();
foreach ($triggers as $tnum => $trigger) {
$triggers[$tnum]['events'] = array();
//getting all host ids and names
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:tr_status.php
示例10: array
// checks
$checks = array();
foreach ($drule['dchecks'] as $check) {
$checks[$check['type']] = discovery_check_type2str($check['type']);
}
order_result($checks);
$data['drules'][$druleid]['checks'] = $checks;
// description
$data['drules'][$druleid]['description'] = array();
if (!empty($drule['proxy_hostid'])) {
$proxy = get_host_by_hostid($drule['proxy_hostid']);
array_push($data['drules'][$druleid]['description'], $proxy['host'] . NAME_DELIMITER);
}
}
order_result($data['drules'], getPageSortOrder());
}
// get paging
$data['paging'] = getPagingLine($data['drules'], array('druleid'));
// nodes
if ($data['displayNodes'] = is_array(get_current_nodeid())) {
foreach ($data['drules'] as &$drule) {
$drule['nodename'] = get_node_name_by_elid($drule['druleid'], true);
}
unset($drule);
}
// render view
$discoveryView = new CView('configuration.discovery.list', $data);
$discoveryView->render();
$discoveryView->show();
}
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:31,代码来源:discoveryconf.php
示例11: array
if ($pageFilter->groupid > 0) {
$trigOpt['groupids'] = $pageFilter->groupid;
}
}
}
$triggers = CTrigger::get($trigOpt);
}
$options = array('nodeids' => get_current_nodeid(), 'object' => EVENT_OBJECT_TRIGGER, 'time_from' => $from, 'time_till' => $till, 'output' => API_OUTPUT_SHORTEN, 'sortfield' => 'clock', 'sortorder' => ZBX_SORT_DOWN, 'limit' => $config['search_limit'] + 1);
if ($_REQUEST['hide_unknown']) {
$options['hide_unknown'] = 1;
}
if (!empty($triggers)) {
$options['triggerids'] = zbx_objectValues($triggers, 'triggerid');
}
$events = CEvent::get($options);
$paging = getPagingLine($events);
$options = array('nodeids' => get_current_nodeid(), 'eventids' => zbx_objectValues($events, 'eventid'), 'output' => API_OUTPUT_EXTEND, 'sortfield' => 'eventid', 'sortorder' => ZBX_SORT_DOWN, 'nopermissions' => 1);
$events = CEvent::get($options);
order_result($events, 'clock', ZBX_SORT_DOWN);
$triggersOptions = array('triggerids' => zbx_objectValues($events, 'objectid'), 'select_hosts' => API_OUTPUT_EXTEND, 'select_triggers' => API_OUTPUT_EXTEND, 'select_items' => API_OUTPUT_EXTEND, 'output' => API_OUTPUT_EXTEND);
$triggers = CTrigger::get($triggersOptions);
$triggers = zbx_toHash($triggers, 'triggerid');
foreach ($events as $enum => $event) {
$trigger = $triggers[$event['objectid']];
$host = reset($trigger['hosts']);
$items = array();
foreach ($trigger['items'] as $inum => $item) {
$i = array();
$i['itemid'] = $item['itemid'];
$i['value_type'] = $item['value_type'];
//ZBX-3059: So it would be possible to show different caption for history for chars and numbers (KB)
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:events.php
示例12: getRequest
$usersView->render();
$usersView->show();
} else {
$sortField = getRequest('sort', CProfile::get('web.' . $page['file'] . '.sort', 'alias'));
$sortOrder = getRequest('sortorder', CProfile::get('web.' . $page['file'] . '.sortorder', ZBX_SORT_UP));
CProfile::update('web.' . $page['file'] . '.sort', $sortField, PROFILE_TYPE_STR);
CProfile::update('web.' . $page['file'] . '.sortorder', $sortOrder, PROFILE_TYPE_STR);
$data = array('config' => $config, 'sort' => $sortField, 'sortorder' => $sortOrder);
// get user groups
$data['userGroups'] = API::UserGroup()->get(array('output' => API_OUTPUT_EXTEND));
order_result($data['userGroups'], 'name');
// get users
$data['users'] = API::User()->get(array('usrgrpids' => $_REQUEST['filter_usrgrpid'] > 0 ? $_REQUEST['filter_usrgrpid'] : null, 'output' => API_OUTPUT_EXTEND, 'selectUsrgrps' => API_OUTPUT_EXTEND, 'getAccess' => 1, 'limit' => $config['search_limit'] + 1));
// sorting & paging
order_result($data['users'], $sortField, $sortOrder);
$data['paging'] = getPagingLine($data['users'], $sortOrder);
// set default lastaccess time to 0
foreach ($data['users'] as $user) {
$data['usersSessions'][$user['userid']] = array('lastaccess' => 0);
}
$dbSessions = DBselect('SELECT s.userid,MAX(s.lastaccess) AS lastaccess,s.status' . ' FROM sessions s' . ' WHERE ' . dbConditionInt('s.userid', zbx_objectValues($data['users'], 'userid')) . ' GROUP BY s.userid,s.status');
while ($session = DBfetch($dbSessions)) {
if ($data['usersSessions'][$session['userid']]['lastaccess'] < $session['lastaccess']) {
$data['usersSessions'][$session['userid']] = $session;
}
}
// render view
$usersView = new CView('administration.users.list', $data);
$usersView->render();
$usersView->show();
}
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:users.php
示例13: elseif
$triggersView->render();
$triggersView->show();
} elseif (isset($_REQUEST['form'])) {
$triggersView = new CView('configuration.triggers.edit', getTriggerFormData($exprAction));
$triggersView->render();
$triggersView->show();
} else {
$sortField = getRequest('sort', CProfile::get('web.' . $page['file'] . '.sort', 'description'));
$sortOrder = getRequest('sortorder', CProfile::get('web.' . $page['file'] . '.sortorder', ZBX_SORT_UP));
CProfile::update('web.' . $page['file'] . '.sort', $sortField, PROFILE_TYPE_STR);
CProfile::update('web.' . $page['file'] . '.sortorder', $sortOrder, PROFILE_TYPE_STR);
$data = array('parent_discoveryid' => getRequest('parent_discoveryid'), 'showInfoColumn' => false, 'discovery_rule' => $discovery_rule, 'hostid' => getRequest('hostid'), 'showdisabled' => getRequest('showdisabled', 1), 'triggers' => array(), 'sort' => $sortField, 'sortorder' => $sortOrder);
CProfile::update('web.triggers.showdisabled', $data['showdisabled'], PROFILE_TYPE_INT);
// get triggers
$options = array('editable' => true, 'output' => array('triggerid'), 'discoveryids' => $data['parent_discoveryid'], 'sortfield' => $sortField, 'limit' => $config['search_limit'] + 1);
if (empty($data['showdisabled'])) {
$options['filter']['status'] = TRIGGER_STATUS_ENABLED;
}
$data['triggers'] = API::TriggerPrototype()->get($options);
// paging
$data['paging'] = getPagingLine($data['triggers']);
$data['triggers'] = API::TriggerPrototype()->get(array('triggerids' => zbx_objectValues($data['triggers'], 'triggerid'), 'output' => API_OUTPUT_EXTEND, 'selectHosts' => API_OUTPUT_EXTEND, 'selectItems' => array('itemid', 'hostid', 'key_', 'type', 'flags', 'status'), 'selectFunctions' => API_OUTPUT_EXTEND));
order_result($data['triggers'], $sortField, $sortOrder);
// get real hosts
$data['realHosts'] = getParentHostsByTriggers($data['triggers']);
// render view
$triggersView = new CView('configuration.triggers.list', $data);
$triggersView->render();
$triggersView->show();
}
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:trigger_prototypes.php
示例14: array
$discoveryView->show();
} else {
$data = array();
// get drules
$data['drules'] = API::DRule()->get(array('output' => API_OUTPUT_EXTEND, 'sortfield' => getPageSortField('name'), 'selectDChecks' => API_OUTPUT_EXTEND, 'editable' => true));
if (!empty($data['drules'])) {
foreach ($data['drules'] as $druleid => $drule) {
// checks
$checks = array();
foreach ($drule['dchecks'] as $check) {
$checks[$check['type']] = discovery_check_type2str($check['type']);
}
order_result($checks);
$data['drules'][$druleid]['checks'] = $checks;
// description
$data['drules'][$druleid]['description'] = array();
if (!empty($drule['proxy_hostid'])) {
$proxy = get_host_by_hostid($drule['proxy_hostid']);
array_push($data['drules'][$druleid]['description'], $proxy['host'] . ':');
}
}
order_result($data['drules'], getPageSortOrder());
}
// get paging
$data['paging'] = getPagingLine($data['drules']);
// render view
$discoveryView = new CView('configuration.discovery.list', $data);
$discoveryView->render();
$discoveryView->show();
}
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:discoveryconf.php
示例15: CForm
$dscry_wdgt->addHeader(S_DISCOVERY_BIG);
$dscry_wdgt->addHeader($numrows);
/* table */
$form = new CForm();
$form->setName('frmdrules');
$tblDiscovery = new CTableInfo(S_NO_DISCOVERY_RULES_DEFINED);
$tblDiscovery->setHeader(array(new CCheckBox('all_drules', null, "checkAll('" . $form->GetName() . "','all_drules','g_druleid');"), make_sorting_header(S_NAME, 'd.name'), make_sorting_header(S_IP_RANGE, 'd.iprange'), make_sorting_header(S_DELAY, 'd.delay'), S_CHECKS, S_STATUS));
$sql = 'SELECT d.* ' . ' FROM drules d' . ' WHERE ' . DBin_node('druleid') . order_by('d.name,d.iprange,d.delay', 'd.druleid');
$db_rules = DBselect($sql);
// Discovery rules will be gathered here, so we can feed this array to pagination function
$rules_arr = array();
while ($rule_data = DBfetch($db_rules)) {
$rules_arr[] = $rule_data;
}
// getting paging element
$paging = getPagingLine($rules_arr);
foreach ($rules_arr as $rule_data) {
$checks = array();
$sql = 'SELECT type FROM dchecks WHERE druleid=' . $rule_data['druleid'] . ' ORDER BY type, ports';
$db_checks = DBselect($sql);
while ($check_data = DBfetch($db_checks)) {
if (!isset($checks[$check_data['type']])) {
$checks[$check_data['type']] = discovery_check_type2str($check_data['type']);
}
}
order_result($checks);
$status = new CCol(new CLink(discovery_status2str($rule_data["status"]), '?g_druleid%5B%5D=' . $rule_data['druleid'] . ($rule_data["status"] == DRULE_STATUS_ACTIVE ? '&go=disable' : '&go=activate'), discovery_status2style($rule_data['status'])));
$description = array();
if ($rule_data["proxy_hostid"]) {
$proxy = get_host_by_hostid($rule_data["proxy_hostid"]);
array_push($description, $proxy["host"], ":");
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:discoveryconf.php
示例16: CForm
$frmGroup = new CForm('get');
$frmGroup->addItem(array(_('Group') . SPACE, $pageFilter->getGroupsCB()));
$templateWidget->addHeader(_('Templates'), $frmGroup);
$templateWidget->addHeaderRowNumber();
$form = new CForm();
$form->setName('templates');
$table = new CTableInfo(_('No templates found.'));
$table->setHeader(array(new CCheckBox('all_templates', null, "checkAll('" . $form->getName() . "', 'all_templates', 'templates');"), make_sorting_header(_('Templates'), 'name', $sortField, $sortOrder), _('Applications'), _('Items'), _('Triggers'), _('Graphs'), _('Screens'), _('Discovery'), _('Web'), _('Linked templates'), _('Linked to')));
// get templates
$templates = array();
if ($pageFilter->groupsSelected) {
$templates = API::Template()->get(array('output' => array('templateid', 'name'), 'groupids' => $pageFilter->groupid > 0 ? $pageFilter->groupid : null, 'editable' => true, 'sortfield' => $sortField, 'limit' => $config['search_limit'] + 1));
}
// sorting && paging
order_result($templates, $sortField, $sortOrder);
$paging = getPagingLine($templates);
$templates = API::Template()->get(array('templateids' => zbx_objectValues($templates, 'templateid'), 'editable' => true, 'output' => array('name', 'proxy_hostid'), 'selectHosts' => array('hostid', 'name', 'status'), 'selectTemplates' => array('hostid', 'name', 'status'), 'selectParentTemplates' => array('hostid', 'name', 'status'), 'selectItems' => API_OUTPUT_COUNT, 'selectTriggers' => API_OUTPUT_COUNT, 'selectGraphs' => API_OUTPUT_COUNT, 'selectApplications' => API_OUTPUT_COUNT, 'selectDiscoveries' => API_OUTPUT_COUNT, 'selectScreens' => API_OUTPUT_COUNT, 'selectHttpTests' => API_OUTPUT_COUNT, 'nopermissions' => true));
order_result($templates, $sortField, $sortOrder);
foreach ($templates as $template) {
$templatesOutput = array();
if ($template['proxy_hostid']) {
$proxy = get_host_by_hostid($template['proxy_hostid']);
$templatesOutput[] = $proxy['host'] . NAME_DELIMITER;
}
$templatesOutput[] = new CLink($template['name'], 'templates.php?form=update&templateid=' . $template['templateid'] . url_param('groupid'));
$applications = array(new CLink(_('Applications'), 'applications.php?groupid=' . $_REQUEST['groupid'] . '&hostid=' . $template['templateid']), ' (' . $template['applications'] . ')');
$items = array(new CLink(_('Items'), 'items.php?filter_set=1&groupid=' . $_REQUEST['groupid'] . '&hostid=' . $template['templateid']), ' (' . $template['items'] . ')');
$triggers = array(new CLink(_('Triggers'), 'triggers.php?groupid=' . $_REQUEST['groupid'] . '&hostid=' . $template['templateid']), ' (' . $template['triggers'] . ')');
$graphs = array(new CLink(_('Graphs'), 'graphs.php?groupid=' . $_REQUEST['groupid'] . '&hostid=' . $template['templateid']), ' (' . $template['graphs'] . ')');
$screens = array(new CLink(_('Screens'), 'screenconf.php?templateid=' . $template['templateid']), ' (' . $template['screens'] . ')');
$discoveries = array(new CLink(_('Discovery'), 'host_discovery.php?&hostid=' . $template['templateid']), ' (' . $template['discoveries'] . ')');
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:templates.php
示例17: get_request
$data['vsize'] = get_request('vsize', 1);
}
// render view
$screenView = new CView('configuration.screen.edit', $data);
$screenView->render();
$screenView->show();
} else {
$data = array('templateid' => get_request('templateid', null));
$sortfield = getPageSortField('name');
$options = array('editable' => true, 'output' => API_OUTPUT_EXTEND, 'templateids' => $data['templateid'], 'sortfield' => $sortfield, 'limit' => $config['search_limit']);
if (!empty($data['templateid'])) {
$data['screens'] = API::TemplateScreen()->get($options);
} else {
$data['screens'] = API::Screen()->get($options);
}
order_result($data['screens'], $sortfield, getPageSortOrder());
// paging
$data['paging'] = getPagingLine($data['screens'], array('screenid'), array('templateid' => get_request('templateid')));
// nodes
if ($data['displayNodes'] = is_array(get_current_nodeid())) {
foreach ($data['screens'] as &$screen) {
$screen['nodename'] = get_node_name_by_elid($screen['screenid'], true);
}
unset($screen);
}
// render view
$screenView = new CView('configuration.screen.list', $data);
$screenView->render();
$screenView->show();
}
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:screenconf.php
示例18: CForm
$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
order_result($hosts, $sortfield, $sortorder);
$paging = getPagingLine($hosts, array('hostid'));
$hosts = API::Host()->get(array('hostids' => zbx_objectValues($hosts, 'hostid'), 'output' => API_OUTPUT_EXTEND, 'selectParentTemplates' => array('hostid', 'name'), 'selectInterfaces' => API_OUTPUT_EXTEND, 'selectItems' => API_OUTPUT_COUNT, 'selectDiscoveries' => API_OUTPUT_COUNT, 'selectTriggers' => API_OUTPUT_COUNT, 'selectGraphs' => API_OUTPUT_COUNT, 'selectApplications' => API_OUTPUT_COUNT, 'selectHttpTests' => API_OUTPUT_COUNT, 'selectDiscoveryRule' => array('itemid', 'name'), 'selectHostDiscovery' => array('ts_delete')));
order_result($hosts, $sortfield, $sortorder);
// selecting linked templates to templates linked to hosts
$templateIds = array();
foreach ($hosts as $host) {
$templateIds = array_merge($templateIds, zbx_objectValues($host['parentTemplates'], 'templateid'));
}
$templateIds = array_unique($templateIds);
$templates = API::Template()->get(array('templateids' => $templateIds, 'selectParentTemplates' => array('hostid', 'name')));
$templates = zbx_toHash($templates, 'templateid');
// get proxy host IDs that that are not 0
$proxyHostIds = array();
foreach ($hosts as $host) {
if ($host['proxy_hostid']) {
$proxyHostIds[$host['proxy_hostid']] = $host['proxy_hostid'];
开发者ID:micromachine,项目名称:RackTables-ZABBIX-bridge,代码行数:31,代码来源:hosts.php
示例19: zbx_strtolower
$hosts[$num]['pr_type'] = $host['inventory']['type'];
$hosts[$num]['pr_os'] = $host['inventory']['os'];
$hosts[$num]['pr_serialno_a'] = $host['inventory']['serialno_a'];
$hosts[$num]['pr_tag'] = $host['inventory']['tag'];
$hosts[$num]['pr_macaddress_a'] = $host['inventory']['macaddress_a'];
// if we are filtering by inventory field
if (!empty($_REQUEST['filter_field']) && !empty($_REQUEST['filter_field_value'])) {
// must we filter exactly or using a substring (both are case insensitive)
$match = $_REQUEST['filter_exact'] ? zbx_strtolower($hosts[$num]['inventory'][$_REQUEST['filter_field']]) === zbx_strtolower($_REQUEST['filter_field_value']) : zbx_strpos(zbx_strtolower($hosts[$num]['inventory'][$_REQUEST['filter_field']]), zbx_strtolower($_REQUEST['filter_field_value'])) !== false;
if (!$match) {
unset($hosts[$num]);
}
}
}
order_result($hosts, getPageSortField('name'), getPageSortOrder());
$paging = getPagingLine($hosts);
foreach ($hosts as $host) {
$host_groups = array();
foreach ($host['groups'] as $group) {
$host_groups[] = $group['name'];
}
natsort($host_groups);
$host_groups = implode(', ', $host_groups);
$row = array(get_node_name_by_elid($host['hostid']), new CLink($host['name'], '?hostid=' . $host['hostid'] . url_param('groupid')), $host_groups, 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($paging, $table, $paging);
$hostinvent_wdgt->addItem($table);
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:hostinventories.php
-
alicek106/start-docker-kubernetes: 시작하세요! 도커, 그리고 쿠버네티스 책에서 사
阅读:1568|2022-08-13
-
librespeed/speedtest: Self-hosted Speedtest for HTML5 and more. Easy setup, exam
阅读:1294|2022-08-30
-
avehtari/BDA_m_demos: Bayesian Data Analysis demos for Matlab/Octave
阅读:1206|2022-08-17
-
女人怀孕后,为了有一个健康聪明的宝宝,经历各种体检、筛查。其实这些体检和筛查中的
阅读:1003|2022-11-06
-
medfreeman/markdown-it-toc-and-anchor: markdown-it plugin to add a toc and ancho
阅读:1407|2022-08-18
-
On Verizon 5G Home LVSKIHP InDoorUnit (IDU) 3.4.66.162 and OutDoorUnit (ODU) 3.3
阅读:587|2022-07-29
-
sydney0zq/covid-19-detection: The implementation of A Weakly-supervised Framewor
阅读:519|2022-08-16
-
离中国最远的国家是阿根廷。从太平洋直线计算,即往东线走,北京到阿根廷的布宜诺斯艾
阅读:670|2022-11-06
-
shem8/MaterialLogin: Login view with material design
阅读:757|2022-08-17
-
Out of bounds read in compositing in Google Chrome prior to 102.0.5005.115 allow
阅读:968|2022-07-29
|
请发表评论