monitoring: Fix stupid thead creation in the lit/hostgroups view script

Drunk?

refs #5543
This commit is contained in:
Eric Lippmann 2015-09-24 15:11:20 +02:00
parent da50ade2fb
commit e197907323
1 changed files with 12 additions and 20 deletions

View File

@ -11,25 +11,21 @@ if (! $this->compact): ?>
</div>
<?php endif ?>
<div class="content">
<?php
$firstRow = true;
foreach ($hostgroups as $hostgroup): ?>
<?php if ($firstRow): ?>
<?php $firstRow = false ?>
<table class="groupview action" data-base-target="_next">
<?php if (! $hostgroups->hasResult()): ?>
<p><?= $this->translate('No host groups found matching the filter.') ?></p>
</div>
<?php return; endif ?>
<table class="groupview action" data-base-target="_next">
<thead>
<th><?= $this->translate('Last Problem') ?></th>
<th><?= $this->translate('Host Group') ?></th>
<th><?= $this->translate('Total Hosts') ?></th>
<th><?= $this->translate('Host States') ?></th>
<th><?= $this->translate('Total Services') ?></th>
<th><?= $this->translate('Service States') ?></th>
<th><?= $this->translate('Last Problem') ?></th>
<th><?= $this->translate('Host Group') ?></th>
<th><?= $this->translate('Total Hosts') ?></th>
<th><?= $this->translate('Host States') ?></th>
<th><?= $this->translate('Total Services') ?></th>
<th><?= $this->translate('Service States') ?></th>
</thead>
<tbody>
<?php endif ?>
<?php
<?php foreach ($hostgroups as $hostgroup):
if ($hostgroup->hosts_down_unhandled) {
$handled = false;
$state = Host::STATE_DOWN;
@ -464,7 +460,6 @@ if ($hostgroup->hosts_down_unhandled) {
</td>
</tr>
<?php endforeach ?>
<?php if ($hostgroups->hasResult()): ?>
</tbody>
</table>
<?php if ($hostgroups->hasMore()): ?>
@ -478,7 +473,4 @@ if ($hostgroup->hosts_down_unhandled) {
)
) ?>
<?php endif ?>
<?php else: ?>
<?= $this->translate('No hostgroups found matching the filter') ?>
<?php endif ?>
</div>