diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:18:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 13:18:42 +0000 |
commit | 9f39660f50004ca7c49ea171e2a6f199487cd667 (patch) | |
tree | 4a77cd3e323c37b0e5b3d7578b9718cdf1a89262 /application/views/scripts/event/index-plain.phtml | |
parent | Initial commit. (diff) | |
download | icingaweb2-module-eventdb-9f39660f50004ca7c49ea171e2a6f199487cd667.tar.xz icingaweb2-module-eventdb-9f39660f50004ca7c49ea171e2a6f199487cd667.zip |
Adding upstream version 1.3.0.upstream/1.3.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'application/views/scripts/event/index-plain.phtml')
-rw-r--r-- | application/views/scripts/event/index-plain.phtml | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/application/views/scripts/event/index-plain.phtml b/application/views/scripts/event/index-plain.phtml new file mode 100644 index 0000000..5b6ea8d --- /dev/null +++ b/application/views/scripts/event/index-plain.phtml @@ -0,0 +1,62 @@ +<?php +/** @var \Icinga\Module\Eventdb\Event $event */ +/** @var array $additionalColumns */ +/** @var \Icinga\Repository\RepositoryQuery $comments */ +/** @var \Icinga\Repository\RepositoryQuery $groupedEvents */ + +$commentTypes = array( + $this->translate('Comment'), + $this->translate('Acknowledgement'), + $this->translate('Revocation'), +); + +$displayColumns = array_merge(array('program', 'message', 'facility'), $additionalColumns); +?> +<?= $this->translate('Timestamp') ?>: <?= $event->created ?> + +<?= $this->translate('Priority') ?>: <?= strtoupper($event->getPriority()) ?> +<?= $event->ack ? sprintf(' (%s)', $this->translate('Acknowledged')) : '' ?> + +<?= $this->translate('Type') ?>: <?= $event->getType() ?> + +<?php foreach ($displayColumns as $col): ?> +<?= $this->columnHeader($col, null, true) ?>: <?= htmlspecialchars($event->offsetGet($col)) ?> + +<?php endforeach ?> + +<?php if ($comments->hasResult()): ?> +[ <?= $this->translate('Comments') ?> ] + +<?php foreach ($comments as $comment): ?> +<?= $commentTypes[$comment->type] ?>: <?= $comment->created ?> + +<?= $this->translate('User') ?>: <?= $comment->user ?> + +<?= $this->translate('Message') ?>: <?= $comment->message ?> + + +<?php endforeach ?> + +<?php endif; ?> +<?php if ($groupedEvents !== null && $groupedEvents->hasResult()): ?> +[ <?= $this->translate('Grouped Events') ?> ] + +<?php foreach ($groupedEvents as $groupedEventData): + /** @var \Icinga\Module\Eventdb\Event $groupedEvent */ + $groupedEvent = $this->event($groupedEventData); +?> +<?= $this->translate('Timestamp') ?>: <?= $event->created ?> + +<?= $this->translate('Priority') ?>: <?= strtoupper($event->getPriority()) ?> +<?= $event->ack ? sprintf(' (%s)', $this->translate('Acknowledged')) : '' ?> + +<?= $this->translate('Type') ?>: <?= $event->getType() ?> + +<?php foreach (array('host_name', 'program', 'message') as $col): ?> +<?= $this->columnHeader($col, null, true) ?>: <?= htmlspecialchars($event->offsetGet($col)) ?> + +<?php endforeach ?> + +<?php endforeach ?> +<?php endif; ?> + |