icingaweb2/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml

47 lines
1.4 KiB
PHTML

<?php
use Icinga\Module\Monitoring\Object\Service;
$i = 0;
?>
<?php if (($serviceCount = count($objects)) > 0): ?>
<table class='action state statesummary'>
<tbody>
<?php foreach ($objects as $service): /** @var Service $service */ ?>
<?php
if (++ $i > 5) {
continue;
}
?>
<tr>
<td class="state-col state-<?= Service::getStateText($service->service_state); ?><?= $service->service_handled ? ' handled' : '' ?>"?>
<?= Service::getStateText($service->service_state, true); ?><br />
</td>
<td>
<?= $this->iconImage()->service($service) ?>
<?= implode(' ', $this->serviceFlags($service)) ?>
<b>
<?= $this->escape($service->getHost()->getName()); ?>:
<?= $this->escape($service->getName()); ?> <br>
</b>
<?= $this->escape($service->service_output) ?>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<div class="hbox-item multi-commands">
<?php if ($i > 5): ?>
<?= $this->qlink(
sprintf($this->translate('List all %d services'), $i),
$listAllLink,
null,
array(
'icon' => 'down-open',
'data-base-target' => '_next'
)
);
?>
<?php endif ?>
</div>
<?php endif ?>