Separate reachability and check source info in detail views

refs #2953
This commit is contained in:
Alexander A. Klimov 2017-12-19 17:57:04 +01:00
parent 72592fcccf
commit 0b6336c623
3 changed files with 18 additions and 14 deletions

View File

@ -35,6 +35,7 @@
<tbody>
<?= $this->render('show/components/command.phtml') ?>
<?= $this->render('show/components/checksource.phtml') ?>
<?= $this->render('show/components/reachable.phtml') ?>
<?= $this->render('show/components/checkstatistics.phtml') ?>
<?= $this->render('show/components/checktimeperiod.phtml') ?>
</tbody>

View File

@ -1,18 +1,6 @@
<?php if ($object->check_source !== null): ?>
<tr>
<th>
<?= $this->translate('Check Source') ?>
</th>
<td>
<?= $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' => 'icon-stateful state-ok'));
} else {
echo $this->icon('circle', $this->translate('Not reachable'), array('class' => 'icon-stateful state-critical'));
} ?>
<?php endif ?>
</td>
<th><?= $this->translate('Check Source') ?></th>
<td><?= $this->escape($object->check_source) ?></td>
</tr>
<?php endif ?>

View File

@ -0,0 +1,15 @@
<?php if ($object->is_reachable !== null): ?>
<tr>
<th>
<?= $this->translate('Reachable') ?>
</th>
<td>
<span class="check-source-meta"><?= (bool) $object->is_reachable ? $this->translate('yes') : $this->translate('no') ?></span>
<?php if ((bool) $object->is_reachable) {
echo $this->icon('circle', $this->translate('Is reachable'), array('class' => 'icon-stateful state-ok'));
} else {
echo $this->icon('circle', $this->translate('Not reachable'), array('class' => 'icon-stateful state-critical'));
} ?>
</td>
</tr>
<?php endif ?>