monitoring: Count services once in services/show.phtml

This commit is contained in:
Eric Lippmann 2014-12-30 10:43:39 +01:00
parent c28f4284e4
commit 3d95e37b7f
1 changed files with 3 additions and 2 deletions

View File

@ -2,13 +2,14 @@
<?= $this->tabs ?>
</div>
<div class="content">
<?php if (count($objects) === 0): ?>
<?php $serviceCount = count($objects) ?>
<?php if ($serviceCount === 0): ?>
<?= $this->translate('No services matching the filter') ?>
<?php else: ?>
<div class="hbox">
<div class="hbox-item" style="width: 6em;">
<b><?= sprintf($this->translatePlural('Service (%u)', 'Services (%u)', array_sum(array_values($serviceStates))), array_sum(array_values($serviceStates))) ?></b>
<b><?= sprintf($this->translatePlural('Service (%u)', 'Services (%u)', $serviceCount), $serviceCount) ?></b>
</div>
<div class="hbox-item">
<?= $this->serviceStatesPieChart ?>