当前位置: 首页>>代码示例>>PHP>>正文


PHP getSeverityCaption函数代码示例

本文整理汇总了PHP中getSeverityCaption函数的典型用法代码示例。如果您正苦于以下问题:PHP getSeverityCaption函数的具体用法?PHP getSeverityCaption怎么用?PHP getSeverityCaption使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了getSeverityCaption函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getSeverityCell

function getSeverityCell($severity, $text = null, $force_normal = false)
{
    if ($text === null) {
        $text = CHtml::encode(getSeverityCaption($severity));
    }
    return new CCol($text, getSeverityStyle($severity, !$force_normal));
}
开发者ID:SandipSingh14,项目名称:Zabbix_,代码行数:7,代码来源:triggers.inc.php

示例2: __construct

    /**
     * @param string $options['id']
     * @param string $options['name']
     * @param int    $options['value']
     */
    public function __construct(array $options = array())
    {
        parent::__construct('div', 'yes');
        $this->attr('id', isset($options['id']) ? $options['id'] : zbx_formatDomId($options['name']));
        $this->addClass('jqueryinputset control-severity');
        if (!isset($options['value'])) {
            $options['value'] = TRIGGER_SEVERITY_NOT_CLASSIFIED;
        }
        $items = array();
        $jsIds = '';
        $jsLabels = '';
        foreach (getSeverityCaption() as $severity => $caption) {
            $items[] = new CRadioButton($options['name'], $severity, null, $options['name'] . '_' . $severity, $options['value'] == $severity);
            $css = getSeverityStyle($severity);
            $label = new CLabel($caption, $options['name'] . '_' . $severity, $options['name'] . '_label_' . $severity);
            $label->attr('data-severity', $severity);
            $label->attr('data-severity-style', $css);
            if ($options['value'] == $severity) {
                $label->attr('aria-pressed', 'true');
                $label->addClass($css);
            } else {
                $label->attr('aria-pressed', 'false');
            }
            $items[] = $label;
            $jsIds .= ', #' . $options['name'] . '_' . $severity;
            $jsLabels .= ', #' . $options['name'] . '_label_' . $severity;
        }
        if ($jsIds) {
            $jsIds = substr($jsIds, 2);
            $jsLabels = substr($jsLabels, 2);
        }
        $this->addItem($items);
        insert_js('
			jQuery("' . $jsLabels . '").mouseenter(function() {
				jQuery("' . $jsLabels . '").each(function() {
					var obj = jQuery(this);

					if (obj.attr("aria-pressed") == "false") {
						obj.removeClass("ui-state-hover " + obj.data("severityStyle"));
					}
				});

				var obj = jQuery(this);

				obj.addClass(obj.data("severityStyle"));
			})
			.mouseleave(function() {
				jQuery("#' . $this->getAttribute('id') . ' [aria-pressed=\\"true\\"]").trigger("mouseenter");
			});

			jQuery("' . $jsIds . '").change(function() {
				jQuery("#' . $this->getAttribute('id') . ' [aria-pressed=\\"true\\"]").trigger("mouseenter");
			});', true);
    }
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:59,代码来源:class.cseverity.php

示例3: makeCol

 /**
  * Returns a column object for the given row and field. Add additional service tree related formatting.
  *
  * @param $rowId
  * @param $colName
  *
  * @return CCol
  */
 protected function makeCol($rowId, $colName)
 {
     $class = null;
     if ($colName == 'status' && zbx_is_int($this->tree[$rowId][$colName]) && $this->tree[$rowId]['id'] > 0) {
         $status = $this->tree[$rowId][$colName];
         // do not show the severity for information and unclassified triggers
         if (in_array($status, array(TRIGGER_SEVERITY_INFORMATION, TRIGGER_SEVERITY_NOT_CLASSIFIED))) {
             $this->tree[$rowId][$colName] = new CSpan(_('OK'), 'green');
         } else {
             $this->tree[$rowId][$colName] = getSeverityCaption($status);
             $class = getSeverityStyle($status);
         }
     }
     $col = parent::makeCol($rowId, $colName);
     $col->addClass($class);
     return $col;
 }
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:25,代码来源:CServiceTree.php

示例4: CMultiSelect

if ($this->data['grpswitch']) {
    $dashconfFormList->addRow(_('Show selected groups'), new CMultiSelect(array('name' => 'groupids[]', 'objectName' => 'hostGroup', 'data' => $this->data['groups'], 'disabled' => !$this->data['isFilterEnable'], 'popup' => array('parameters' => 'srctbl=host_groups&dstfrm=' . $dashconfForm->getName() . '&dstfld1=groupids_' . '&srcfld1=groupid&multiselect=1', 'width' => 450, 'height' => 450))));
    $dashconfFormList->addRow(_('Hide selected groups'), new CMultiSelect(array('name' => 'hidegroupids[]', 'objectName' => 'hostGroup', 'data' => $this->data['hideGroups'], 'disabled' => !$this->data['isFilterEnable'], 'popup' => array('parameters' => 'srctbl=host_groups&dstfrm=' . $dashconfForm->getName() . '&dstfld1=hidegroupids_' . '&srcfld1=groupid&multiselect=1', 'width' => 450, 'height' => 450))));
}
// append host in maintenance checkbox to form list
$maintenanceCheckBox = new CCheckBox('maintenance', $this->data['maintenance'], null, '1');
if (!$this->data['isFilterEnable']) {
    $maintenanceCheckBox->setAttribute('disabled', 'disabled');
}
$dashconfFormList->addRow(_('Hosts'), array($maintenanceCheckBox, _('Show hosts in maintenance')));
// append trigger severities to form list
$severities = array();
foreach ($this->data['severities'] as $severity) {
    $serverityCheckBox = new CCheckBox('trgSeverity[' . $severity . ']', isset($this->data['severity'][$severity]), '', 1);
    $serverityCheckBox->setEnabled($this->data['isFilterEnable']);
    $severities[] = array($serverityCheckBox, getSeverityCaption($severity));
    $severities[] = BR();
}
array_pop($severities);
$dashconfFormList->addRow(_('Triggers with severity'), $severities);
// append problem display to form list
$extAckComboBox = new CComboBox('extAck', $this->data['extAck']);
$extAckComboBox->addItems(array(EXTACK_OPTION_ALL => _('All'), EXTACK_OPTION_BOTH => _('Separated'), EXTACK_OPTION_UNACK => _('Unacknowledged only')));
$extAckComboBox->setEnabled($this->data['isFilterEnable'] && $this->data['config']['event_ack_enable']);
if (!$this->data['config']['event_ack_enable']) {
    $extAckComboBox->setAttribute('title', _('Event acknowledging disabled'));
}
$dashconfFormList->addRow(_('Problem display'), $extAckComboBox);
// create tab
$dashconfTab = new CTabView();
$dashconfTab->addTab('dashconfTab', _('Filter'), $dashconfFormList);
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:31,代码来源:monitoring.dashconf.php

示例5: getUserForm


//.........这里部分代码省略.........
        $autologoutCheckBox->setAttribute('disabled', 'disabled');
    }
    $frmUser->addRow(S_AUTO_LOGOUT, array($autologoutCheckBox, $autologoutTextBox));
    $frmUser->addRow(S_SCREEN_REFRESH, new CNumericBox('refresh', $refresh, 4));
    $frmUser->addRow(S_ROWS_PER_PAGE, new CNumericBox('rows_per_page', $rows_per_page, 6));
    $frmUser->addRow(S_URL_AFTER_LOGIN, new CTextBox("url", $url, 50));
    //view Media Settings for users above "User" +++
    if (uint_in_array($USER_DETAILS['type'], array(USER_TYPE_ZABBIX_ADMIN, USER_TYPE_SUPER_ADMIN))) {
        $frmUser->addVar('user_medias', $user_medias);
        $media_table = new CTableInfo(S_NO_MEDIA_DEFINED);
        foreach ($user_medias as $id => $one_media) {
            if (!isset($one_media['active']) || $one_media['active'] == 0) {
                $status = new CLink(S_ENABLED, '#', 'enabled');
                $status->onClick('return create_var("' . $frmUser->getName() . '","disable_media",' . $id . ', true);');
            } else {
                $status = new CLink(S_DISABLED, '#', 'disabled');
                $status->onClick('return create_var("' . $frmUser->getName() . '","enable_media",' . $id . ', true);');
            }
            $media_url = '?dstfrm=' . $frmUser->getName() . '&media=' . $id . '&mediatypeid=' . $one_media['mediatypeid'] . '&sendto=' . urlencode($one_media['sendto']) . '&period=' . $one_media['period'] . '&severity=' . $one_media['severity'] . '&active=' . $one_media['active'];
            $media_table->addRow(array(new CCheckBox('user_medias_to_del[' . $id . ']', null, null, $id), new CSpan($media_types[$one_media['mediatypeid']], 'nowrap'), new CSpan($one_media['sendto'], 'nowrap'), new CSpan($one_media['period'], 'nowrap'), media_severity2str($one_media['severity']), $status, new CButton('edit_media', S_EDIT, 'javascript: return PopUp("popup_media.php' . $media_url . '",550,400);')));
        }
        $frmUser->addRow(S_MEDIA, array($media_table, new CButton('add_media', S_ADD, 'javascript: return PopUp("popup_media.php?dstfrm=' . $frmUser->getName() . '",550,400);'), SPACE, count($user_medias) > 0 ? new CButton('del_user_media', S_DELETE_SELECTED) : null));
    }
    if (0 == $profile) {
        $frmUser->addVar('perm_details', $perm_details);
        $link = new CSpan($perm_details ? S_HIDE : S_SHOW, 'link');
        $link->onClick("return create_var('" . $frmUser->getName() . "','perm_details'," . ($perm_details ? 0 : 1) . ", true);");
        $resources_list = array(S_RIGHTS_OF_RESOURCES, SPACE . '(', $link, ')');
        $frmUser->addSpanRow($resources_list, 'right_header');
        if ($perm_details) {
            $group_ids = array_values($user_groups);
            if (count($group_ids) == 0) {
                $group_ids = array(-1);
            }
            $db_rights = DBselect('SELECT * FROM rights r WHERE ' . DBcondition('r.groupid', $group_ids));
            $tmp_perm = array();
            while ($db_right = DBfetch($db_rights)) {
                if (isset($tmp_perm[$db_right['id']])) {
                    $tmp_perm[$db_right['id']] = min($tmp_perm[$db_right['id']], $db_right['permission']);
                } else {
                    $tmp_perm[$db_right['id']] = $db_right['permission'];
                }
            }
            $user_rights = array();
            foreach ($tmp_perm as $id => $perm) {
                array_push($user_rights, array('id' => $id, 'permission' => $perm));
            }
            //SDI($user_rights);
            //SDI($user_type);
            $frmUser->addSpanRow(get_rights_of_elements_table($user_rights, $user_type));
        }
    }
    if ($profile) {
        $msgVisibility = array('1' => array('messages[timeout]', 'messages[sounds.repeat]', 'messages[sounds.recovery]', 'messages[triggers.recovery]', 'timeout_row', 'repeat_row', 'triggers_row'));
        $frmUser->addRow(S_GUI_MESSAGING, new CCheckBox('messages[enabled]', $messages['enabled'], null, 1));
        $newRow = $frmUser->addRow(S_MESSAGE_TIMEOUT . SPACE . '(' . S_SECONDS_SMALL . ')', new CNumericBox("messages[timeout]", $messages['timeout'], 5));
        $newRow->setAttribute('id', 'timeout_row');
        $repeatSound = new CComboBox('messages[sounds.repeat]', $messages['sounds.repeat'], 'javascript: if(IE) submit();');
        $repeatSound->setAttribute('id', 'messages[sounds.repeat]');
        $repeatSound->addItem(1, S_ONCE);
        $repeatSound->addItem(10, '10 ' . S_SECONDS);
        $repeatSound->addItem(-1, S_MESSAGE_TIMEOUT);
        $newRow = $frmUser->addRow(S_PLAY_SOUND, $repeatSound);
        $newRow->setAttribute('id', 'repeat_row');
        // trigger sounds
        $severities = array(TRIGGER_SEVERITY_NOT_CLASSIFIED, TRIGGER_SEVERITY_INFORMATION, TRIGGER_SEVERITY_WARNING, TRIGGER_SEVERITY_AVERAGE, TRIGGER_SEVERITY_HIGH, TRIGGER_SEVERITY_DISASTER);
        $zbxSounds = getSounds();
        $triggers = new CTable('', 'invisible');
        $soundList = new CComboBox('messages[sounds.recovery]', $messages['sounds.recovery']);
        foreach ($zbxSounds as $filename => $file) {
            $soundList->addItem($file, $filename);
        }
        $resolved = array(new CCheckBox('messages[triggers.recovery]', $messages['triggers.recovery'], null, 1), S_RECOVERY, $soundList, new CButton('start', S_PLAY, "javascript: testUserSound('messages[sounds.recovery]');", false), new CButton('stop', S_STOP, 'javascript: AudioList.stopAll();', false));
        $triggers->addRow($resolved);
        foreach ($severities as $snum => $severity) {
            $soundList = new CComboBox('messages[sounds.' . $severity . ']', $messages['sounds.' . $severity]);
            foreach ($zbxSounds as $filename => $file) {
                $soundList->addItem($file, $filename);
            }
            $triggers->addRow(array(new CCheckBox('messages[triggers.severities][' . $severity . ']', isset($messages['triggers.severities'][$severity]), null, 1), getSeverityCaption($severity), $soundList, new CButton('start', S_PLAY, "javascript: testUserSound('messages[sounds." . $severity . "]');", false), new CButton('stop', S_STOP, 'javascript: AudioList.stopAll();', false)));
            zbx_subarray_push($msgVisibility, 1, 'messages[triggers.severities][' . $severity . ']');
            zbx_subarray_push($msgVisibility, 1, 'messages[sounds.' . $severity . ']');
        }
        $newRow = $frmUser->addRow(S_TRIGGER_SEVERITY, $triggers);
        $newRow->setAttribute('id', 'triggers_row');
        zbx_add_post_js("var userMessageSwitcher = new CViewSwitcher('messages[enabled]', 'click', " . zbx_jsvalue($msgVisibility, true) . ");");
    }
    $frmUser->addItemToBottomRow(new CButton('save', S_SAVE));
    if (isset($userid) && $profile == 0) {
        $frmUser->addItemToBottomRow(SPACE);
        $delete_b = new CButtonDelete(S_DELETE_SELECTED_USER_Q, url_param("form") . url_param("config") . url_param("userid"));
        if (bccomp($USER_DETAILS['userid'], $userid) == 0) {
            $delete_b->setAttribute('disabled', 'disabled');
        }
        $frmUser->addItemToBottomRow($delete_b);
    }
    $frmUser->addItemToBottomRow(SPACE);
    $frmUser->addItemToBottomRow(new CButtonCancel(url_param("config")));
    return $frmUser;
}
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:101,代码来源:forms.inc.php

示例6: CCheckBox

}
//HOSTS
// SPACE added to extend CB width in Chrome
$cbMain = new CCheckBox('maintenance', $maintenance, null, '1');
if (!$filterEnable) {
    $cbMain->setAttribute('disabled', 'disabled');
}
$dashForm->addRow(S_HOSTS, array($cbMain, S_SHOW_HOSTS_IN_MAINTENANCE));
// Trigger
$severity = zbx_toHash($severity);
$trgSeverities = array();
$severities = array(TRIGGER_SEVERITY_NOT_CLASSIFIED, TRIGGER_SEVERITY_INFORMATION, TRIGGER_SEVERITY_WARNING, TRIGGER_SEVERITY_AVERAGE, TRIGGER_SEVERITY_HIGH, TRIGGER_SEVERITY_DISASTER);
foreach ($severities as $snum => $sever) {
    $cb = new CCheckBox('trgSeverity[' . $sever . ']', isset($severity[$sever]), '', 1);
    $cb->setEnabled($filterEnable);
    $trgSeverities[] = array($cb, getSeverityCaption($sever));
    $trgSeverities[] = BR();
}
array_pop($trgSeverities);
$dashForm->addRow(S_TRIGGERS_WITH_SEVERITY, $trgSeverities);
$config = select_config();
$cb = new CComboBox('extAck', $extAck);
$cb->addItems(array(EXTACK_OPTION_ALL => S_O_ALL, EXTACK_OPTION_BOTH => S_O_SEPARATED, EXTACK_OPTION_UNACK => S_O_UNACKNOWLEDGED_ONLY));
$cb->setEnabled($filterEnable && $config['event_ack_enable']);
if (!$config['event_ack_enable']) {
    $cb->setAttribute('title', S_EVENT_ACKNOWLEDGING_DISABLED);
}
$dashForm->addRow(S_PROBLEM_DISPLAY, $cb);
//-----
$dashForm->addItemToBottomRow(new CButton('save', S_SAVE));
$dashboard_wdgt->addItem($dashForm);
开发者ID:songyuanjie,项目名称:zabbix-stats,代码行数:31,代码来源:dashconf.php

示例7: CTextBox

     break;
 case CONDITION_TYPE_TRIGGER_NAME:
     $condition = new CTextBox('new_condition[value]', '', ZBX_TEXTBOX_STANDARD_SIZE);
     break;
 case CONDITION_TYPE_TRIGGER_VALUE:
     $condition = new CComboBox('new_condition[value]');
     foreach (array(TRIGGER_VALUE_FALSE, TRIGGER_VALUE_TRUE) as $trigerValue) {
         $condition->addItem($trigerValue, trigger_value2str($trigerValue));
     }
     break;
 case CONDITION_TYPE_TIME_PERIOD:
     $condition = new CTextBox('new_condition[value]', ZBX_DEFAULT_INTERVAL, ZBX_TEXTBOX_STANDARD_SIZE);
     break;
 case CONDITION_TYPE_TRIGGER_SEVERITY:
     $condition = new CComboBox('new_condition[value]');
     $condition->addItems(getSeverityCaption());
     break;
 case CONDITION_TYPE_MAINTENANCE:
     $condition = new CCol(_('maintenance'));
     break;
 case CONDITION_TYPE_NODE:
     $conditionFormList->addItem(new CVar('new_condition[value]', '0'));
     $condition = array(new CTextBox('node', '', ZBX_TEXTBOX_STANDARD_SIZE, 'yes'), SPACE, new CButton('btn1', _('Select'), 'return PopUp("popup.php?srctbl=nodes&srcfld1=nodeid&srcfld2=name' . '&dstfrm=' . $actionForm->getName() . '&dstfld1=new_condition_value&dstfld2=node' . '&writeonly=1", 450, 450);', 'link_menu'));
     break;
 case CONDITION_TYPE_DRULE:
     $conditionFormList->addItem(new CVar('new_condition[value]', '0'));
     $condition = array(new CTextBox('drule', '', ZBX_TEXTBOX_STANDARD_SIZE, 'yes'), SPACE, new CButton('btn1', _('Select'), 'return PopUp("popup.php?srctbl=drules&srcfld1=druleid&srcfld2=name' . '&dstfrm=' . $actionForm->getName() . '&dstfld1=new_condition_value&dstfld2=drule", 450, 450);', 'link_menu'));
     break;
 case CONDITION_TYPE_DCHECK:
     $conditionFormList->addItem(new CVar('new_condition[value]', '0'));
     $condition = array(new CTextBox('dcheck', '', ZBX_TEXTBOX_STANDARD_SIZE, 'yes'), SPACE, new CButton('btn1', _('Select'), 'return PopUp("popup.php?srctbl=dchecks&srcfld1=dcheckid&srcfld2=name' . '&dstfrm=' . $actionForm->getName() . '&dstfld1=new_condition_value&dstfld2=dcheck&writeonly=1", 450, 450);', 'link_menu'));
开发者ID:itnihao,项目名称:Zabbix_,代码行数:31,代码来源:configuration.action.edit.php

示例8: getSeverityControl

/**
 * Create control for trigger severities.
 * It's mostly the same as usual button set, but background color is changed based on selected severiity.
 * Js file "/include/views/js/configuration.triggers.edit.js.php" is needed to make it work correcty.
 *
 * @param $selectedSeverity
 *
 * @return CDiv
 */
function getSeverityControl($selectedSeverity = TRIGGER_SEVERITY_NOT_CLASSIFIED)
{
    $controls = array();
    foreach (getSeverityCaption() as $severity => $caption) {
        $controls[] = new CRadioButton('priority', $severity, null, 'severity_' . $severity, $selectedSeverity == $severity);
        $label = new CLabel($caption, 'severity_' . $severity, 'severity_label_' . $severity);
        $label->attr('data-severity', $severity);
        $label->attr('data-severity-style', getSeverityStyle($severity));
        $controls[] = $label;
    }
    return new CDiv($controls, 'jqueryinputset control-severity');
}
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:21,代码来源:html.inc.php

示例9: zbx_add_post_js

        $frmTRLog->addVar('expressions[' . $id . '][view]', $expr['view']);
        $maxid = $maxid < $id ? $id : $maxid;
    }
    zbx_add_post_js('logexpr_count=' . ($maxid + 1));
    $maxid = 0;
    foreach ($keys as $id => $val) {
        $del_url = new CLink(_('Delete'), '#', 'action', 'javascript: if(confirm("' . _('Delete keyword?') . '")) remove_keyword("keytr' . $id . '"); return false;');
        $row = new CRow(array(htmlspecialchars($val['value']), $val['type'], $del_url));
        $row->setAttribute('id', 'keytr' . $id);
        $keyTable->addRow($row);
        $frmTRLog->addVar('keys[' . $id . '][value]', $val['value']);
        $frmTRLog->addVar('keys[' . $id . '][type]', $val['type']);
        $maxid = $maxid < $id ? $id : $maxid;
    }
    zbx_add_post_js('key_count=' . ($maxid + 1));
    $frmTRLog->addRow(SPACE, $keyTable);
    $frmTRLog->addRow(SPACE, $table);
    $sev_select = new CComboBox('priority', $priority);
    $sev_select->addItems(getSeverityCaption());
    $frmTRLog->addRow(_('Severity'), $sev_select);
    $frmTRLog->addRow(_('Comments'), new CTextArea('comments', $comments));
    $frmTRLog->addRow(_('URL'), new CTextBox('url', $url, 80));
    $frmTRLog->addRow(_('Disabled'), new CCheckBox('status', $status == TRIGGER_STATUS_DISABLED ? 'yes' : 'no', null, 1));
    $frmTRLog->addItemToBottomRow(new CSubmit('save_trigger', _('Save'), 'javascript: document.forms[0].action += \'?saction=1\';'));
    $frmTRLog->addItemToBottomRow(SPACE);
    $frmTRLog->addItemToBottomRow(new CButton('cancel', _('Cancel'), 'javascript: self.close();'));
    if ($bExprResult) {
        $frmTRLog->show();
    }
}
require_once dirname(__FILE__) . '/include/page_footer.php';
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:31,代码来源:tr_logform.php

示例10: CSpan

                }
                $statusSpan = new CSpan(trigger_value2str($event['value']));
                // add colors and blinking to span depending on configuration and trigger parameters
                addTriggerValueStyle($statusSpan, $event['value'], $event['clock'], $event['acknowledged']);
                // host JS menu link
                $hostSpan = null;
                if ($_REQUEST['hostid'] == 0) {
                    $hostSpan = new CSpan($host['name'], 'link_menu menu-host');
                    $scripts = $hostScripts[$host['hostid']];
                    $hostSpan->setAttribute('data-menu', hostMenuData($host, $scripts));
                }
                // action
                $action = isset($actions[$event['eventid']]) ? $actions[$event['eventid']] : ' - ';
                $table->addRow(array(new CLink(zbx_date2str(EVENTS_ACTION_TIME_FORMAT, $event['clock']), 'tr_events.php?triggerid=' . $event['objectid'] . '&eventid=' . $event['eventid'], 'action'), is_show_all_nodes() ? get_node_name_by_elid($event['objectid']) : null, $hostSpan, new CSpan($tr_desc, 'link_menu'), $statusSpan, getSeverityCell($trigger['priority'], null, !$event['value']), $event['duration'], $config['event_ack_enable'] ? $ack : null, $action));
                if ($CSV_EXPORT) {
                    $csvRows[] = array(zbx_date2str(EVENTS_ACTION_TIME_FORMAT, $event['clock']), is_show_all_nodes() ? get_node_name_by_elid($event['objectid']) : null, $_REQUEST['hostid'] == 0 ? $host['name'] : null, $description, trigger_value2str($event['value']), getSeverityCaption($trigger['priority']), $event['duration'], $config['event_ack_enable'] ? $event['acknowledges'] ? _('Yes') : _('No') : null, strip_tags((string) $action));
                }
            }
        } else {
            $events = array();
            $paging = getPagingLine($events);
        }
    }
    if ($CSV_EXPORT) {
        print zbx_toCSV($csvRows);
        exit;
    }
    $table = array($paging, $table, $paging);
}
$events_wdgt->addItem($table);
// NAV BAR
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:events.php

示例11: bodyToString

 public function bodyToString()
 {
     $this->cleanItems();
     $okCount = 0;
     $notClassifiedCount = 0;
     $informationCount = 0;
     $warningCount = 0;
     $averageCount = 0;
     $highCount = 0;
     $disasterCount = 0;
     $options = array('output' => array('triggerid', 'priority', 'value'), 'monitored' => true, 'skipDependent' => true);
     if ($this->hostid > 0) {
         $options['hostids'] = $this->hostid;
     } elseif ($this->groupid > 0) {
         $options['groupids'] = $this->groupid;
     }
     $triggers = API::Trigger()->get($options);
     foreach ($triggers as $trigger) {
         if ($trigger['value'] == TRIGGER_VALUE_TRUE) {
             switch ($trigger['priority']) {
                 case TRIGGER_SEVERITY_NOT_CLASSIFIED:
                     $notClassifiedCount++;
                     break;
                 case TRIGGER_SEVERITY_INFORMATION:
                     $informationCount++;
                     break;
                 case TRIGGER_SEVERITY_WARNING:
                     $warningCount++;
                     break;
                 case TRIGGER_SEVERITY_AVERAGE:
                     $averageCount++;
                     break;
                 case TRIGGER_SEVERITY_HIGH:
                     $highCount++;
                     break;
                 case TRIGGER_SEVERITY_DISASTER:
                     $disasterCount++;
                     break;
             }
         } elseif ($trigger['value'] == TRIGGER_VALUE_FALSE) {
             $okCount++;
         }
     }
     if ($this->show_header) {
         $header_str = _('Triggers info') . SPACE;
         if ($this->groupid != 0) {
             $group = get_hostgroup_by_groupid($this->groupid);
             $header_str .= _('Group') . SPACE . '&quot;' . $group['name'] . '&quot;';
         } else {
             $header_str .= _('All groups');
         }
         $header = new CCol($header_str, 'header');
         if ($this->style == STYLE_HORIZONTAL) {
             $header->setColspan(8);
         }
         $this->addRow($header);
     }
     $okCount = getSeverityCell(null, $okCount . SPACE . _('Ok'), true);
     $notClassifiedCount = getSeverityCell(TRIGGER_SEVERITY_NOT_CLASSIFIED, $notClassifiedCount . SPACE . getSeverityCaption(TRIGGER_SEVERITY_NOT_CLASSIFIED), !$notClassifiedCount);
     $informationCount = getSeverityCell(TRIGGER_SEVERITY_INFORMATION, $informationCount . SPACE . getSeverityCaption(TRIGGER_SEVERITY_INFORMATION), !$informationCount);
     $warningCount = getSeverityCell(TRIGGER_SEVERITY_WARNING, $warningCount . SPACE . getSeverityCaption(TRIGGER_SEVERITY_WARNING), !$warningCount);
     $averageCount = getSeverityCell(TRIGGER_SEVERITY_AVERAGE, $averageCount . SPACE . getSeverityCaption(TRIGGER_SEVERITY_AVERAGE), !$averageCount);
     $highCount = getSeverityCell(TRIGGER_SEVERITY_HIGH, $highCount . SPACE . getSeverityCaption(TRIGGER_SEVERITY_HIGH), !$highCount);
     $disasterCount = getSeverityCell(TRIGGER_SEVERITY_DISASTER, $disasterCount . SPACE . getSeverityCaption(TRIGGER_SEVERITY_DISASTER), !$disasterCount);
     if (STYLE_HORIZONTAL == $this->style) {
         $this->addRow(array($okCount, $notClassifiedCount, $informationCount, $warningCount, $averageCount, $highCount, $disasterCount));
     } else {
         $this->addRow($okCount);
         $this->addRow($notClassifiedCount);
         $this->addRow($informationCount);
         $this->addRow($warningCount);
         $this->addRow($averageCount);
         $this->addRow($highCount);
         $this->addRow($disasterCount);
     }
     return parent::bodyToString();
 }
开发者ID:omidmt,项目名称:zabbix-greenplum,代码行数:77,代码来源:CTriggersInfo.php

示例12: bodyToString

 public function bodyToString()
 {
     $this->cleanItems();
     $ok = $uncl = $info = $warn = $avg = $high = $dis = 0;
     $options = array('monitored' => true, 'skipDependent' => true, 'output' => API_OUTPUT_SHORTEN);
     if ($this->hostid > 0) {
         $options['hostids'] = $this->hostid;
     } elseif ($this->groupid > 0) {
         $options['groupids'] = $this->groupid;
     }
     $triggers = API::Trigger()->get($options);
     $triggers = zbx_objectValues($triggers, 'triggerid');
     $db_priority = DBselect('SELECT t.priority,t.value,count(DISTINCT t.triggerid) AS cnt' . ' FROM triggers t' . ' WHERE ' . dbConditionInt('t.triggerid', $triggers) . ' GROUP BY t.priority,t.value');
     while ($row = DBfetch($db_priority)) {
         switch ($row['value']) {
             case TRIGGER_VALUE_TRUE:
                 switch ($row['priority']) {
                     case TRIGGER_SEVERITY_NOT_CLASSIFIED:
                         $uncl += $row['cnt'];
                         break;
                     case TRIGGER_SEVERITY_INFORMATION:
                         $info += $row['cnt'];
                         break;
                     case TRIGGER_SEVERITY_WARNING:
                         $warn += $row['cnt'];
                         break;
                     case TRIGGER_SEVERITY_AVERAGE:
                         $avg += $row['cnt'];
                         break;
                     case TRIGGER_SEVERITY_HIGH:
                         $high += $row['cnt'];
                         break;
                     case TRIGGER_SEVERITY_DISASTER:
                         $dis += $row['cnt'];
                         break;
                 }
                 break;
             case TRIGGER_VALUE_FALSE:
                 $ok += $row['cnt'];
                 break;
         }
     }
     if ($this->show_header) {
         $header_str = _('Triggers info') . SPACE;
         if (!is_null($this->nodeid)) {
             $node = get_node_by_nodeid($this->nodeid);
             if ($node > 0) {
                 $header_str .= '(' . $node['name'] . ')' . SPACE;
             }
         }
         if (remove_nodes_from_id($this->groupid) > 0) {
             $group = get_hostgroup_by_groupid($this->groupid);
             $header_str .= _('Group') . SPACE . '&quot;' . $group['name'] . '&quot;';
         } else {
             $header_str .= _('All groups');
         }
         $header = new CCol($header_str, 'header');
         if ($this->style == STYLE_HORISONTAL) {
             $header->setColspan(8);
         }
         $this->addRow($header);
     }
     $trok = getSeverityCell(null, $ok . SPACE . _('Ok'), true);
     $uncl = getSeverityCell(TRIGGER_SEVERITY_NOT_CLASSIFIED, $uncl . SPACE . getSeverityCaption(TRIGGER_SEVERITY_NOT_CLASSIFIED), !$uncl);
     $info = getSeverityCell(TRIGGER_SEVERITY_INFORMATION, $info . SPACE . getSeverityCaption(TRIGGER_SEVERITY_INFORMATION), !$info);
     $warn = getSeverityCell(TRIGGER_SEVERITY_WARNING, $warn . SPACE . getSeverityCaption(TRIGGER_SEVERITY_WARNING), !$warn);
     $avg = getSeverityCell(TRIGGER_SEVERITY_AVERAGE, $avg . SPACE . getSeverityCaption(TRIGGER_SEVERITY_AVERAGE), !$avg);
     $high = getSeverityCell(TRIGGER_SEVERITY_HIGH, $high . SPACE . getSeverityCaption(TRIGGER_SEVERITY_HIGH), !$high);
     $dis = getSeverityCell(TRIGGER_SEVERITY_DISASTER, $dis . SPACE . getSeverityCaption(TRIGGER_SEVERITY_DISASTER), !$dis);
     if (STYLE_HORISONTAL == $this->style) {
         $this->addRow(array($trok, $uncl, $info, $warn, $avg, $high, $dis));
     } else {
         $this->addRow($trok);
         $this->addRow($uncl);
         $this->addRow($info);
         $this->addRow($warn);
         $this->addRow($avg);
         $this->addRow($high);
         $this->addRow($dis);
     }
     return parent::bodyToString();
 }
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:82,代码来源:class.ctriggersinfo.php

示例13: _initSeveritiesMin

 /**
  * Initialize minimum trigger severities.
  *
  * @param string $severityMin
  * @param array  $options
  * @param int    $options['default']
  * @param string $options['mapId']
  */
 private function _initSeveritiesMin($severityMin, array $options = array())
 {
     $default = isset($options['default']) ? $options['default'] : TRIGGER_SEVERITY_NOT_CLASSIFIED;
     $mapId = isset($options['mapId']) ? $options['mapId'] : 0;
     $severityMinProfile = isset($this->_profileIds['severityMin']) ? $this->_profileIds['severityMin'] : null;
     if ($severityMin === null && $severityMinProfile !== null) {
         $severityMin = $severityMinProfile;
     }
     if ($severityMin !== null) {
         if ($severityMin == $default) {
             CProfile::delete($this->_profileIdx['severityMin'], $mapId);
         } else {
             CProfile::update($this->_profileIdx['severityMin'], $severityMin, PROFILE_TYPE_INT, $mapId);
         }
     }
     $this->data['severitiesMin'] = getSeverityCaption();
     $this->data['severitiesMin'][$default] = $this->data['severitiesMin'][$default] . SPACE . '(' . _('default') . ')';
     $this->ids['severityMin'] = $severityMin === null ? $default : $severityMin;
 }
开发者ID:itnihao,项目名称:zatree-2.2,代码行数:27,代码来源:class.cpagefilter.php

示例14: CComboBox

if ($config['event_ack_enable']) {
    $cb_ack_status = new CComboBox('ack_status', $ack_status);
    $cb_ack_status->addItem(ZBX_ACK_STS_ANY, _('Any'));
    $cb_ack_status->additem(ZBX_ACK_STS_WITH_UNACK, _('With unacknowledged events'));
    $cb_ack_status->additem(ZBX_ACK_STS_WITH_LAST_UNACK, _('With last event unacknowledged'));
    $filterForm->addRow(_('Acknowledge status'), $cb_ack_status);
}
$ev_select = new CComboBox('show_events', $_REQUEST['show_events']);
$ev_select->addItem(EVENTS_OPTION_NOEVENT, _('Hide all'));
$ev_select->addItem(EVENTS_OPTION_ALL, _('Show all') . ' (' . $config['event_expire'] . ' ' . ($config['event_expire'] > 1 ? _('Days') : _('Day')) . ')');
if ($config['event_ack_enable']) {
    $ev_select->addItem(EVENTS_OPTION_NOT_ACK, _('Show unacknowledged') . ' (' . $config['event_expire'] . ' ' . ($config['event_expire'] > 1 ? _('Days') : _('Day')) . ')');
}
$filterForm->addRow(_('Events'), $ev_select);
$severity_select = new CComboBox('show_severity', $show_severity);
$cb_items = array(-1 => _('All'), TRIGGER_SEVERITY_NOT_CLASSIFIED => getSeverityCaption(TRIGGER_SEVERITY_NOT_CLASSIFIED), TRIGGER_SEVERITY_INFORMATION => getSeverityCaption(TRIGGER_SEVERITY_INFORMATION), TRIGGER_SEVERITY_WARNING => getSeverityCaption(TRIGGER_SEVERITY_WARNING), TRIGGER_SEVERITY_AVERAGE => getSeverityCaption(TRIGGER_SEVERITY_AVERAGE), TRIGGER_SEVERITY_HIGH => getSeverityCaption(TRIGGER_SEVERITY_HIGH), TRIGGER_SEVERITY_DISASTER => getSeverityCaption(TRIGGER_SEVERITY_DISASTER));
$severity_select->addItems($cb_items);
$filterForm->addRow(_('Min severity'), $severity_select);
$action = 'javascript: 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(_('days'));
$spand->addStyle('vertical-align: middle;');
$filterForm->addRow(_('Age less than'), array($cbd, $sts_change_days_cb, $spand));
$filterForm->addRow(_('Show details'), new CCheckBox('show_details', $_REQUEST['show_details'], null, 1));
$filterForm->addRow(_('Filter by name'), new CTextBox('txt_select', $_REQUEST['txt_select'], 40));
开发者ID:quanta-computing,项目名称:debian-packages,代码行数:31,代码来源:tr_status.php

示例15: foreach

 foreach ($events as $event) {
     $trigger = $triggers[$event['objectid']];
     $host = reset($trigger['hosts']);
     $host = $hosts[$host['hostid']];
     $triggerItems = array();
     $trigger['items'] = CMacrosResolverHelper::resolveItemNames($trigger['items']);
     foreach ($trigger['items'] as $item) {
         $triggerItems[] = array('name' => $item['name_expanded'], 'params' => array('itemid' => $item['itemid'], 'action' => in_array($item['value_type'], array(ITEM_VALUE_TYPE_FLOAT, ITEM_VALUE_TYPE_UINT64)) ? HISTORY_GRAPH : HISTORY_VALUES));
     }
     $description = CMacrosResolverHelper::resolveEventDescription(zbx_array_merge($trigger, array('clock' => $event['clock'], 'ns' => $event['ns'])));
     // duration
     $event['duration'] = ($nextEvent = get_next_event($event, $events)) ? zbx_date2age($event['clock'], $nextEvent['clock']) : zbx_date2age($event['clock']);
     // action
     $action = isset($actions[$event['eventid']]) ? $actions[$event['eventid']] : ' - ';
     if ($csvExport) {
         $csvRows[] = array(zbx_date2str(DATE_TIME_FORMAT_SECONDS, $event['clock']), getRequest('hostid', 0) == 0 ? $host['name'] : null, $description, trigger_value2str($event['value']), getSeverityCaption($trigger['priority']), $event['duration'], $config['event_ack_enable'] ? $event['acknowledges'] ? _('Yes') : _('No') : null, strip_tags((string) $action));
     } else {
         $triggerDescription = new CSpan($description, 'pointer link_menu');
         $triggerDescription->setMenuPopup(CMenuPopupHelper::getTrigger($trigger, $triggerItems, null, $event['clock']));
         // acknowledge
         $ack = getEventAckState($event, true);
         // add colors and blinking to span depending on configuration and trigger parameters
         $statusSpan = new CSpan(trigger_value2str($event['value']));
         addTriggerValueStyle($statusSpan, $event['value'], $event['clock'], $event['acknowledged']);
         // host JS menu link
         $hostName = null;
         if (getRequest('hostid', 0) == 0) {
             $hostName = new CSpan($host['name'], 'link_menu');
             $hostName->setMenuPopup(CMenuPopupHelper::getHost($host, $scripts[$host['hostid']]));
         }
         $table->addRow(array(new CLink(zbx_date2str(DATE_TIME_FORMAT_SECONDS, $event['clock']), 'tr_events.php?triggerid=' . $event['objectid'] . '&eventid=' . $event['eventid'], 'action'), $hostName, $triggerDescription, $statusSpan, getSeverityCell($trigger['priority'], null, !$event['value']), $event['duration'], $config['event_ack_enable'] ? $ack : null, $action));
开发者ID:TonywalkerCN,项目名称:Zabbix,代码行数:31,代码来源:events.php


注:本文中的getSeverityCaption函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。