monitoring: Indent the event history overview w/ 4 spaces
This commit is contained in:
parent
fee77af5e8
commit
6b0e5be05d
|
@ -12,129 +12,127 @@ $history->limit($limit * $page);
|
||||||
|
|
||||||
if (! $this->compact): ?>
|
if (! $this->compact): ?>
|
||||||
<div class="controls dont-print separated">
|
<div class="controls dont-print separated">
|
||||||
<?= $this->tabs; ?>
|
<?= $this->tabs; ?>
|
||||||
<div class="grid">
|
<div class="grid">
|
||||||
<div class="col-1-3 text-left">
|
<div class="col-1-3 text-left">
|
||||||
<?= $this->limiter ?>
|
<?= $this->limiter ?>
|
||||||
|
</div>
|
||||||
|
<div class="col-1-3">
|
||||||
|
<a class="action-link" href="#load-more">
|
||||||
|
<?= $this->translate('Scroll to the bottom of this page to load additional events'); ?>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
<div class="col-1-3 text-right">
|
||||||
|
<?= $this->sortBox ?>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-1-3">
|
<?= $this->filterEditor; ?>
|
||||||
<a class="action-link" href="#load-more">
|
|
||||||
<?= $this->translate('Scroll to the bottom of this page to load additional events'); ?>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
<div class="col-1-3 text-right">
|
|
||||||
<?= $this->sortBox ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?= $this->filterEditor; ?>
|
|
||||||
</div>
|
</div>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<table data-base-target="_next" class="action action-table">
|
<table data-base-target="_next" class="action action-table">
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php foreach ($history->peekAhead() as $event): ?>
|
<?php foreach ($history->peekAhead() as $event):
|
||||||
<?php
|
$icon = 'help';
|
||||||
$icon = 'help';
|
$msg = $event->output;
|
||||||
$msg = $event->output;
|
$title = $event->type;
|
||||||
$title = $event->type;
|
$stateName = 'invalid';
|
||||||
$stateName = 'invalid';
|
$isService = isset($event->service_description);
|
||||||
$isService = isset($event->service_description);
|
switch ($event->type) {
|
||||||
switch ($event->type) {
|
case 'notify':
|
||||||
case 'notify':
|
$icon = 'bell';
|
||||||
$icon = 'bell';
|
$title = $this->translate('Notification');
|
||||||
$title = $this->translate('Notification');
|
$msg = $msg ?: $this->translate('This notification was not sent out to any contact.');
|
||||||
$msg = $msg ?: $this->translate('This notification was not sent out to any contact.');
|
break;
|
||||||
break;
|
case 'comment':
|
||||||
case 'comment':
|
$icon = 'comment';
|
||||||
$icon = 'comment';
|
$title = $this->translate('Comment');
|
||||||
$title = $this->translate('Comment');
|
break;
|
||||||
break;
|
case 'ack':
|
||||||
case 'ack':
|
$icon = 'ok';
|
||||||
$icon = 'ok';
|
$title = $this->translate('Acknowledgement');
|
||||||
$title = $this->translate('Acknowledgement');
|
break;
|
||||||
break;
|
case 'dt_comment':
|
||||||
case 'dt_comment':
|
$icon = 'plug';
|
||||||
$icon = 'plug';
|
$title = $this->translate('In Downtime');
|
||||||
$title = $this->translate('In Downtime');
|
break;
|
||||||
break;
|
case 'flapping':
|
||||||
case 'flapping':
|
$icon = 'flapping';
|
||||||
$icon = 'flapping';
|
$title = $this->translate('Flapping');
|
||||||
$title = $this->translate('Flapping');
|
break;
|
||||||
break;
|
case 'flapping_deleted':
|
||||||
case 'flapping_deleted':
|
$icon = 'ok';
|
||||||
$icon = 'ok';
|
$title = $this->translate('Flapping Stopped');
|
||||||
$title = $this->translate('Flapping Stopped');
|
break;
|
||||||
break;
|
case 'hard_state':
|
||||||
case 'hard_state':
|
$icon = $isService ? 'service' : 'host';
|
||||||
$icon = $isService ? 'service' : 'host';
|
$stateName = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state);
|
||||||
$stateName = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state);
|
$title = $isService ? Service::getStateText($event->state, true) : Host::getStateText($event->state, true);
|
||||||
$title = $isService ? Service::getStateText($event->state, true) : Host::getStateText($event->state, true);
|
break;
|
||||||
break;
|
case 'soft_state':
|
||||||
case 'soft_state':
|
$icon = 'lightbulb';
|
||||||
$icon = 'lightbulb';
|
$stateName = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state);
|
||||||
$stateName = $isService ? Service::getStateText($event->state) : Host::getStateText($event->state);
|
$title = $isService ? Service::getStateText($event->state, true) : Host::getStateText($event->state, true);
|
||||||
$title = $isService ? Service::getStateText($event->state, true) : Host::getStateText($event->state, true);
|
break;
|
||||||
break;
|
case 'dt_start':
|
||||||
case 'dt_start':
|
$icon = 'starttime';
|
||||||
$icon = 'starttime';
|
$title = $this->translate('Downtime Start');
|
||||||
$title = $this->translate('Downtime Start');
|
break;
|
||||||
break;
|
case 'dt_end':
|
||||||
case 'dt_end':
|
$icon = 'endtime';
|
||||||
$icon = 'endtime';
|
$title = $this->translate('Downtime End');
|
||||||
$title = $this->translate('Downtime End');
|
break;
|
||||||
break;
|
} ?>
|
||||||
}
|
<tr>
|
||||||
?>
|
<td class="state-col state-<?= $stateName; ?>">
|
||||||
<tr>
|
<?php if ($history->getIteratorPosition() % $limit === 0): ?>
|
||||||
<td class="state-col state-<?= $stateName; ?>">
|
<a id="page-<?= $history->getIteratorPosition() / $limit + 1; ?>"></a>
|
||||||
<?php if ($history->getIteratorPosition() % $limit === 0): ?>
|
<?php endif ?>
|
||||||
<a id="page-<?= $history->getIteratorPosition() / $limit + 1; ?>"></a>
|
<strong><?= $this->escape($title); ?></strong>
|
||||||
<?php endif ?>
|
<p><?= $this->timeAgo($event->timestamp, $this->compact); ?></p>
|
||||||
<strong><?= $this->escape($title); ?></strong>
|
</td>
|
||||||
<p><?= $this->timeAgo($event->timestamp, $this->compact); ?></p>
|
<td>
|
||||||
</td>
|
<?= $this->icon($icon, $title); ?>
|
||||||
<td>
|
<?php if ($isService): ?>
|
||||||
<?= $this->icon($icon, $title); ?>
|
<?= $this->link()->service(
|
||||||
<?php if ($isService): ?>
|
$event->service_description, $event->service_display_name, $event->host_name, $event->host_display_name, 'rowaction'
|
||||||
<?= $this->link()->service(
|
) ?>
|
||||||
$event->service_description, $event->service_display_name, $event->host_name, $event->host_display_name, 'rowaction'
|
<?php else: ?>
|
||||||
) ?>
|
<?= $this->link()->host($event->host_name, $event->host_display_name) ?>
|
||||||
<?php else: ?>
|
<?php endif ?>
|
||||||
<?= $this->link()->host($event->host_name, $event->host_display_name) ?>
|
<p class="plugin-output">
|
||||||
<?php endif ?>
|
<?= empty($msg) ? '' : $this->escape($msg) ?>
|
||||||
<p class="plugin-output">
|
</p>
|
||||||
<?= empty($msg) ? '' : $this->escape($msg) ?>
|
</td>
|
||||||
</p>
|
</tr>
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<?php if (! $history->hasResult()): ?>
|
<?php if (! $history->hasResult()): ?>
|
||||||
<?= $this->translate('No history events found matching the filter'); ?>
|
<?= $this->translate('No history events found matching the filter'); ?>
|
||||||
<?php elseif ($history->hasMore()): ?>
|
<?php elseif ($history->hasMore()): ?>
|
||||||
<?php if ($this->compact): ?>
|
<?php if ($this->compact): ?>
|
||||||
<?= $this->qlink(
|
<?= $this->qlink(
|
||||||
$this->translate('Show More'),
|
$this->translate('Show More'),
|
||||||
$url->without(array('view', 'limit')),
|
$url->without(array('view', 'limit')),
|
||||||
null,
|
null,
|
||||||
array(
|
array(
|
||||||
'data-base-target' => '_next',
|
'data-base-target' => '_next',
|
||||||
'class' => 'pull-right action-link'
|
'class' => 'pull-right action-link'
|
||||||
)
|
)
|
||||||
); ?>
|
); ?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<?= $this->qlink(
|
<?= $this->qlink(
|
||||||
$this->translate('Load More'),
|
$this->translate('Load More'),
|
||||||
$url->setAnchor('page-' . ($page + 1)),
|
$url->setAnchor('page-' . ($page + 1)),
|
||||||
array(
|
array(
|
||||||
'page' => $page + 1,
|
'page' => $page + 1,
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'id' => 'load-more',
|
'id' => 'load-more',
|
||||||
'class' => 'pull-right action-link'
|
'class' => 'pull-right action-link'
|
||||||
)
|
)
|
||||||
); ?>
|
); ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue