mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Change the state indicator of the eventhistory view to match the other views
This commit is contained in:
parent
dc5182d4bf
commit
51909ce60c
@ -24,9 +24,68 @@
|
|||||||
<?php
|
<?php
|
||||||
$class = null;
|
$class = null;
|
||||||
$isService = false;
|
$isService = false;
|
||||||
?>
|
switch ($event->type) {
|
||||||
|
case 'notify':
|
||||||
|
$icon = 'notification';
|
||||||
|
$title = 'Notification';
|
||||||
|
$msg = $event->output;
|
||||||
|
break;
|
||||||
|
case 'comment':
|
||||||
|
$icon = 'comment';
|
||||||
|
$title = 'Comment';
|
||||||
|
$msg = $event->output;
|
||||||
|
break;
|
||||||
|
case 'ack':
|
||||||
|
$icon = 'acknowledgement';
|
||||||
|
$title = 'Acknowledgement';
|
||||||
|
$msg = $event->output;
|
||||||
|
break;
|
||||||
|
case 'dt_comment':
|
||||||
|
$icon = 'in-downtime';
|
||||||
|
$title = 'In Downtime';
|
||||||
|
$msg = $event->output;
|
||||||
|
break;
|
||||||
|
case 'flapping':
|
||||||
|
$icon = 'flapping';
|
||||||
|
$title = 'Flapping';
|
||||||
|
$msg = $event->output;
|
||||||
|
break;
|
||||||
|
case 'hard_state':
|
||||||
|
$icon = '{{HARDSTATE_ICON}}';
|
||||||
|
$title = 'Hard State';
|
||||||
|
$msg = $event->output . '<br /><small>Attempt ' . $event->attempt . '/' . $event->max_attempts . ' (Hard)</small>';
|
||||||
|
$class = 'border-status-' . (
|
||||||
|
$isService ?
|
||||||
|
strtolower($this->util()->getServiceStateName($event->state)) :
|
||||||
|
strtolower($this->util()->getHostStateName($event->state))
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case 'soft_state':
|
||||||
|
$icon = '{{SOFTSTATE_ICON}}';
|
||||||
|
$title = 'Soft State';
|
||||||
|
$msg = $event->output . '<br /><small>Attempt ' . $event->attempt . '/' . $event->max_attempts . ' (Soft)</small>';
|
||||||
|
$class = 'border-status-' . (
|
||||||
|
$isService ?
|
||||||
|
strtolower($this->util()->getServiceStateName($event->state)) :
|
||||||
|
strtolower($this->util()->getHostStateName($event->state))
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case 'dt_start':
|
||||||
|
$icon = 'downtime-start';
|
||||||
|
$title = 'Downtime Start';
|
||||||
|
$msg = $event->output;
|
||||||
|
break;
|
||||||
|
case 'dt_end':
|
||||||
|
$icon = 'downtime-end';
|
||||||
|
$title = 'Downtime End';
|
||||||
|
$msg = $event->output;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?= date('d.m. H:i', $event->timestamp); ?></td>
|
<td <?= !empty($class) ? 'class="' . $class . '"' : '' ?>">
|
||||||
|
<?= date('d.m. H:i', $event->timestamp); ?>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<?php if (isset($event->service)): ?>
|
<?php if (isset($event->service)): ?>
|
||||||
<a href="<?= $this->href('monitoring/show/service', array(
|
<a href="<?= $this->href('monitoring/show/service', array(
|
||||||
@ -47,66 +106,7 @@
|
|||||||
</a>
|
</a>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<br />
|
<br />
|
||||||
<?php
|
<div>
|
||||||
switch ($event->type) {
|
|
||||||
case 'notify':
|
|
||||||
$icon = 'notification';
|
|
||||||
$title = 'Notification';
|
|
||||||
$msg = $event->output;
|
|
||||||
break;
|
|
||||||
case 'comment':
|
|
||||||
$icon = 'comment';
|
|
||||||
$title = 'Comment';
|
|
||||||
$msg = $event->output;
|
|
||||||
break;
|
|
||||||
case 'ack':
|
|
||||||
$icon = 'acknowledgement';
|
|
||||||
$title = 'Acknowledgement';
|
|
||||||
$msg = $event->output;
|
|
||||||
break;
|
|
||||||
case 'dt_comment':
|
|
||||||
$icon = 'in-downtime';
|
|
||||||
$title = 'In Downtime';
|
|
||||||
$msg = $event->output;
|
|
||||||
break;
|
|
||||||
case 'flapping':
|
|
||||||
$icon = 'flapping';
|
|
||||||
$title = 'Flapping';
|
|
||||||
$msg = $event->output;
|
|
||||||
break;
|
|
||||||
case 'hard_state':
|
|
||||||
$icon = '{{HARDSTATE_ICON}}';
|
|
||||||
$title = 'Hard State';
|
|
||||||
$msg = $event->output . '<br /><small>Attempt ' . $event->attempt . '/' . $event->max_attempts . ' (Hard)</small>';
|
|
||||||
$class = 'border-status-' . (
|
|
||||||
$isService ?
|
|
||||||
strtolower($this->util()->getServiceStateName($event->state)) :
|
|
||||||
strtolower($this->util()->getHostStateName($event->state))
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case 'soft_state':
|
|
||||||
$icon = '{{SOFTSTATE_ICON}}';
|
|
||||||
$title = 'Soft State';
|
|
||||||
$msg = $event->output . '<br /><small>Attempt ' . $event->attempt . '/' . $event->max_attempts . ' (Soft)</small>';
|
|
||||||
$class = 'border-status-' . (
|
|
||||||
$isService ?
|
|
||||||
strtolower($this->util()->getServiceStateName($event->state)) :
|
|
||||||
strtolower($this->util()->getHostStateName($event->state))
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case 'dt_start':
|
|
||||||
$icon = 'downtime-start';
|
|
||||||
$title = 'Downtime Start';
|
|
||||||
$msg = $event->output;
|
|
||||||
break;
|
|
||||||
case 'dt_end':
|
|
||||||
$icon = 'downtime-end';
|
|
||||||
$title = 'Downtime End';
|
|
||||||
$msg = $event->output;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<div<?php if (!empty($class)): ?> class="<?= $class ?>"<?php endif; ?>>
|
|
||||||
<i title="<?= $title ?>" class="icinga-icon-<?= $icon ?>"></i>
|
<i title="<?= $title ?>" class="icinga-icon-<?= $icon ?>"></i>
|
||||||
<?php if (!empty($msg)) { echo $msg; } ?>
|
<?php if (!empty($msg)) { echo $msg; } ?>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user