diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:43:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 12:43:29 +0000 |
commit | a9b77c01caef9ae7a2c84e2333d28ceb028cf4d3 (patch) | |
tree | 4a77cd3e323c37b0e5b3d7578b9718cdf1a89262 /application/views/scripts/events/index.phtml | |
parent | Initial commit. (diff) | |
download | icingaweb2-module-eventdb-a9b77c01caef9ae7a2c84e2333d28ceb028cf4d3.tar.xz icingaweb2-module-eventdb-a9b77c01caef9ae7a2c84e2333d28ceb028cf4d3.zip |
Adding upstream version 1.3.0.upstream/1.3.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | application/views/scripts/events/index.phtml | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/application/views/scripts/events/index.phtml b/application/views/scripts/events/index.phtml new file mode 100644 index 0000000..f1e4da7 --- /dev/null +++ b/application/views/scripts/events/index.phtml @@ -0,0 +1,93 @@ +<?php if (! $this->compact): ?> +<div class="controls"> + <?= $this->tabs ?> + <?php + $helpMessage = $this->translate( + 'Press and hold the Ctrl key while clicking on rows to select multiple rows or press and hold the Shift key to' + . ' select a range of rows', + 'Multi-selection help' + ); + ?> + <div class="selection-info" title="<?= $this->escape($helpMessage) ?>"> + <?= sprintf( + /// TRANSLATORS: Please leave %s as it is because the selection counter is wrapped in a span tag for updating + /// the counter via JavaScript + $this->translate('%s row(s) selected', 'Multi-selection count'), + '<span class="selection-info-count">0</span>' + ) ?> + </div> + <?= $this->paginator ?> + <div class="sort-controls-container"> + <?= $this->limiter ?> + <?= $this->sortBox ?> + </div> + <?= $this->filterEditor ?> + <div class="quick-filter-controls"> + <?= $this->severityFilterForm ?> + <?= $this->ackFilterForm ?> + </div> +</div> +<?php endif ?> +<div class="content"> +<?php /** @var \Icinga\Repository\RepositoryQuery $events */if (! $events->hasResult()): ?> + <p><?= $this->translate('No events recorded yet.') ?></p> +</div> +<?php return; endif; $displayColumns = array_merge(array('host_name', 'program', 'message', 'facility'), $additionalColumns); ?> + <table class="common-table table-row-selectable multiselect table-responsive events-table" + data-base-target="_next" + data-icinga-multiselect-url="<?= $this->href('eventdb/events/details') ?>" + data-icinga-multiselect-controllers="<?= $this->href('eventdb/events') ?>" + data-icinga-multiselect-data="id"> + <?php if (! $this->compact): ?> + <thead> + <tr> + <th></th> + <th></th> + <?php foreach ($displayColumns as $displayColumn): ?> + <?= $this->columnHeader($displayColumn) ?> + <?php endforeach ?> + </tr> + </thead> + <?php endif; ?> + <tbody> + <?php + foreach ($events as $eventData): + /** @var \Icinga\Module\Eventdb\Event $event */ + $event = $this->event($eventData); + $created = $event->created; + $createdTs = strtotime($created); + $url = $this->url('eventdb/event', array('id' => $event->id)); + $classes = array('priority-col', $event->getPriority()); + if ($event->ack) { + $classes[] = 'ack'; + } + ?> + <tr href="<?= $url ?>"> + <td class="<?= implode(' ', $classes) ?>"> + <div class="priority-label"><?= strtoupper($event->getPriority()) ?></div> + <div class="event-meta"><a href="<?= $url ?>" class="timeago" title="<?= $created ?>"><?= $this->timeAgo($createdTs) ?></a></div> + </td> + <td class="icon-col"> + <?= $this->icon($event->getTypeIcon(), $event->getType()) ?> + <?php if ($event->ack) { echo $this->icon('ok', $this->translate('Acknowledged')); } ?> + <?php if ($event->group_autoclear) { echo $this->icon('reschedule', $this->translate('Auto-Clear')); } ?> + </td> + <?php foreach ($displayColumns as $displayColumn): ?> + <?= $this->column($displayColumn, $event) ?> + <?php endforeach ?> + </tr> + <?php endforeach ?> + </tbody> + </table> +<?php if ($this->compact && $events->hasMore()): ?> + <?= $this->qlink( + $this->translate('Show More'), + $this->url()->without(array('view', 'limit')), + null, + array( + 'data-base-target' => '_next', + 'class' => 'action-link' + ) + ) ?> +<?php endif; ?> +</div> |