summaryrefslogtreecommitdiffstats
path: root/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml
blob: 48141e2fd9a109699dabcc30c8e65af5a11aa5fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
use Icinga\Module\Monitoring\Object\Host;

if (! ($hostCount = count($objects))): return; endif ?>
<table class="state-table host-detail-state">
<tbody>
<?php foreach ($objects as $i => $host): /** @var Host $host */
    if ($i === 5) {
        break;
    } ?>
    <tr>
        <td class="state-col state-<?= Host::getStateText($host->host_state); ?><?= $host->host_handled ? ' handled' : '' ?>">
            <span class="sr-only"><?= Host::getStateText($host->host_state) ?></span>
            <div class="state-meta">
                <?= $this->timeSince($host->host_last_state_change, $this->compact) ?>
            </div>
        </td>
        <td>
            <?= $this->link()->host(
                $host->host_name,
                $host->host_display_name
            ) ?>
            <?= $this->hostFlags($host) ?>
        </td>
    </tr>
<?php endforeach ?>
</tbody>
</table>
<?php if ($hostCount > 5): ?>
<div class="hosts-link">
    <?= $this->qlink(
        sprintf($this->translate('List all %d hosts'), $hostCount),
        $this->url()->setPath('monitoring/list/hosts'),
        null,
        array(
            'data-base-target'  => '_next',
            'icon'              => 'forward'
        )
    ) ?>
</div>
<?php endif ?>