monitoring/list/hosts: Make overdue/unreachable hosts better visible

refs #3212
This commit is contained in:
Johannes Meyer 2019-07-12 11:46:34 +02:00
parent 2c11f5307d
commit 18b933679c
3 changed files with 16 additions and 4 deletions

View File

@ -77,7 +77,8 @@ class ListController extends Controller
'host_notifications_enabled', 'host_notifications_enabled',
'host_active_checks_enabled', 'host_active_checks_enabled',
'host_passive_checks_enabled', 'host_passive_checks_enabled',
'host_check_command' 'host_check_command',
'host_next_update'
), $this->addColumns())); ), $this->addColumns()));
$this->applyRestriction('monitoring/filter/objects', $hosts); $this->applyRestriction('monitoring/filter/objects', $hosts);

View File

@ -1,4 +1,5 @@
<?php <?php
use Icinga\Date\DateFormatter;
use Icinga\Module\Monitoring\Object\Host; use Icinga\Module\Monitoring\Object\Host;
if (! $this->compact): ?> if (! $this->compact): ?>
@ -25,10 +26,16 @@ if (! $this->compact): ?>
<tbody> <tbody>
<?php foreach($hosts->peekAhead($this->compact) as $host): <?php foreach($hosts->peekAhead($this->compact) as $host):
$hostStateName = Host::getStateText($host->host_state); $hostStateName = Host::getStateText($host->host_state);
$hostLink = $this->href('monitoring/host/show', array('host' => $host->host_name)); ?> $hostLink = $this->href('monitoring/host/show', array('host' => $host->host_name));
<tr> $hostCheckOverdue = $host->host_next_update < time();?>
<tr<?= $hostCheckOverdue ? ' class="state-outdated"' : '' ?>>
<td class="state-col state-<?= $hostStateName ?><?= $host->host_handled ? ' handled' : '' ?>"> <td class="state-col state-<?= $hostStateName ?><?= $host->host_handled ? ' handled' : '' ?>">
<div class="state-label"><?= Host::getStateText($host->host_state, true) ?></div> <div class="state-label">
<?php if ($hostCheckOverdue): ?>
<?= $this->icon('clock', sprintf($this->translate('Overdue %s'), DateFormatter::timeSince($host->host_next_update))) ?>
<?php endif ?>
<?= Host::getStateText($host->host_state, true) ?>
</div>
<?php if ((int) $host->host_state !== 99): ?> <?php if ((int) $host->host_state !== 99): ?>
<div class="state-meta"> <div class="state-meta">
<?= $this->timeSince($host->host_last_state_change, $this->compact) ?> <?= $this->timeSince($host->host_last_state_change, $this->compact) ?>

View File

@ -240,6 +240,10 @@
background-color: @tr-hover-color; background-color: @tr-hover-color;
cursor: pointer; cursor: pointer;
} }
tr[href].state-outdated:not(:hover):not(.active) td:not(.state-col) {
opacity: 0.7;
}
} }
// Event history // Event history