monitoring: Fix order of information and actions in the check execution part in the detail area

fixes #10310
This commit is contained in:
Eric Lippmann 2016-02-23 15:41:01 +01:00
parent ff3aa43070
commit 18e3884b8b
3 changed files with 39 additions and 20 deletions

View File

@ -4,16 +4,14 @@
<?= $this->translate('Check Source') ?>
</th>
<td>
<?php if ($object->is_reachable !== null) {
if ((bool) $object->is_reachable) {
echo $this->icon('circle', $this->translate('Is reachable'), array('class' => 'fg-color-ok'));
} else {
echo $this->icon('circle', $this->translate('Not reachable'), array('class' => 'fg-color-critical'));
}
} ?>
<?= $this->escape($object->check_source) ?>
<?php if ($object->is_reachable !== null): ?>
<span class="check-source-meta"><?= (bool) $object->is_reachable ? $this->translate('is reachable') : $this->translate('is not reachable') ?></span>
<?php if ((bool) $object->is_reachable) {
echo $this->icon('circle', $this->translate('Is reachable'), array('class' => 'check-source-reachable'));
} else {
echo $this->icon('circle', $this->translate('Not reachable'), array('class' => 'check-source-not-reachable'));
} ?>
<?php endif ?>
</td>
</tr>

View File

@ -6,18 +6,28 @@ $activeChecksEnabled = (bool) $object->active_checks_enabled;
<tr>
<th><?= $activeChecksEnabled ? $this->translate('Last check') : $this->translate('Last update') ?></th>
<td data-base-target="_self">
<?php if ((int) $object->state !== 99): ?>
<?= $this->timeAgo($object->last_check) ?>
<?php if ($object->next_update < time()): ?>
<?= $this->icon('circle', $this->translate('Check result is late'), array('class' => 'check-result-late')) ?>
<?php endif ?>
<?php endif ?>
<?php if (isset($checkNowForm)) { // Form is unset if the current user lacks the respective permission
echo $checkNowForm;
} ?>
<?php if ((int) $object->state !== 99) {
echo $this->timeAgo($object->last_check);
} ?>
</td>
</tr>
<tr>
<th><?= $activeChecksEnabled ? $this->translate('Next check') : $this->translate('Next update') ?></th>
<td>
<?php if ((int) $object->state !== 99) {
if ($activeChecksEnabled) {
echo $this->timeUntil($object->next_check);
} else {
echo sprintf($this->translate('expected %s'), $this->timeUntil($object->next_update));
}
} ?>
<?php if ($activeChecksEnabled && $this->hasPermission('monitoring/command/schedule-check')) {
if ($object->getType() === $object::TYPE_SERVICE) {
echo $this->qlink(
@ -49,16 +59,6 @@ $activeChecksEnabled = (bool) $object->active_checks_enabled;
);
}
} ?>
<?php if ((int) $object->state !== 99) {
if ($activeChecksEnabled) {
echo $this->timeUntil($object->next_check);
} else {
echo sprintf($this->translate('expected %s'), $this->timeUntil($object->next_update));
}
} ?>
<?php if ($object->next_update < time()) {
echo $this->icon('circle', $this->translate('Check result is late'), array('class' => 'fg-color-critical'));
} ?>
</td>
</tr>

View File

@ -1,5 +1,26 @@
/*! Icinga Web 2 | (c) 2014 Icinga Development Team | GPLv2+ */
// Styles for the icon displayed if a check source is reachable
.check-source-reachable {
color: @color-ok;
}
// Styles for the icon displayed if a check source is not reachable
.check-source-not-reachable {
color: @color-critical;
}
// Styles for the icon displayed if a check result is late
.check-result-late {
color: @color-critical;
&:before {
// Remove right margin because the check now form may be displayed right next to the icon and we already have a gap
// because of inline-blocks
margin-right: 0;
}
}
// Show more and load more links in overviews
.action-links {
text-align: right;