mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-26 07:14:35 +02:00
monitoring: Count hosts once in hosts/show.phtml
This commit is contained in:
parent
973a56c984
commit
c87733debc
@ -2,11 +2,12 @@
|
|||||||
<?= $this->tabs ?>
|
<?= $this->tabs ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<?php if (count($objects) === 0): ?>
|
<?php $hostCount = count($objects) ?>
|
||||||
|
<?php if ($hostCount === 0): ?>
|
||||||
<?= $this->translate('No hosts matching the filter') ?>
|
<?= $this->translate('No hosts matching the filter') ?>
|
||||||
<?php else: ?>
|
<?php else: ?>
|
||||||
<div class="hbox-item">
|
<div class="hbox-item">
|
||||||
<b><?= sprintf($this->translatePlural('Host (%u)', 'Hosts (%u)', array_sum(array_values($hostStates))), array_sum(array_values($hostStates))) ?></b>
|
<b><?= sprintf($this->translatePlural('Host (%u)', 'Hosts (%u)', $hostCount), $hostCount) ?></b>
|
||||||
</div>
|
</div>
|
||||||
<div class="hbox-item">
|
<div class="hbox-item">
|
||||||
<?= $this->hostStatesPieChart ?>
|
<?= $this->hostStatesPieChart ?>
|
||||||
@ -22,9 +23,9 @@
|
|||||||
$this->translatePlural(
|
$this->translatePlural(
|
||||||
'%u Host',
|
'%u Host',
|
||||||
'%u Hosts',
|
'%u Hosts',
|
||||||
count($objects)
|
$hostCount
|
||||||
),
|
),
|
||||||
count($objects)
|
$hostCount
|
||||||
) ?>
|
) ?>
|
||||||
</h3>
|
</h3>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user