monitoring: Indent the service groups overview w/ 4 spaces

refs #5543
This commit is contained in:
Eric Lippmann 2015-09-28 17:55:57 +02:00
parent 2e611bfd03
commit 22fb507a2e
2 changed files with 145 additions and 148 deletions

View File

@ -12,7 +12,7 @@ if (! $this->compact): ?>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<?php if (! $hostgroups->hasResult()): ?> <?php if (! $hostgroups->hasResult()): ?>
<p><?= $this->translate('No host groups found matching the filter.') ?></p> <p><?= $this->translate('No host groups found matching the filter.') ?></p>
</div> </div>
<?php return; endif ?> <?php return; endif ?>

View File

@ -2,171 +2,168 @@
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs ?>
<?= $this->sortBox ?> <?= $this->sortBox ?>
<?= $this->limiter ?> <?= $this->limiter ?>
<?= $this->paginator ?> <?= $this->paginator ?>
<?= $this->filterEditor ?> <?= $this->filterEditor ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<?php if ($servicegroups->hasResult()): ?> <?php if ($servicegroups->hasResult()): ?>
<p><?= $this->translate('No servicegroups found matching the filter') ?></p> <p><?= $this->translate('No service groups found matching the filter.') ?></p>
</div> </div>
<?php endif ?> <?php return; endif ?>
<table class="groupview action" data-base-target="_next"> <table class="groupview action" data-base-target="_next">
<thead> <thead>
<th><?= $this->translate('Service Group') ?></th> <th><?= $this->translate('Service Group') ?></th>
<th><?= $this->translate('Total Services') ?></th> <th><?= $this->translate('Total Services') ?></th>
<th><?= $this->translate('Service States') ?></th> <th><?= $this->translate('Service States') ?></th>
</thead> </thead>
<tbody> <tbody>
<?php <?php foreach ($servicegroups->peekAhead($this->compact) as $serviceGroup): ?>
<tr href="<?= $this->href('monitoring/list/services', array('servicegroup_name' => $serviceGroup->servicegroup_name)) ?>">
$servicegroups->peekAhead($this->compact);
foreach ($servicegroups as $serviceGroup): ?>
<tr href="<?= $this->href('monitoring/list/services', array('servicegroup_name' => $serviceGroup->servicegroup_name)) ?>">
<td class="groupname"> <td class="groupname">
<?= $this->qlink( <?= $this->qlink(
$serviceGroup->servicegroup_alias, $serviceGroup->servicegroup_alias,
'monitoring/list/services', 'monitoring/list/services',
array('servicegroup_name' => $serviceGroup->servicegroup_name), array('servicegroup_name' => $serviceGroup->servicegroup_name),
array('title' => sprintf($this->translate('List all services in the group "%s"'), $serviceGroup->servicegroup_alias)) array('title' => sprintf($this->translate('List all services in the group "%s"'), $serviceGroup->servicegroup_alias))
) ?> ) ?>
</td> </td>
<td class="total"> <td class="total">
<?= $serviceGroup->services_total ?> <?= $serviceGroup->services_total ?>
</td> </td>
<td> <td>
<?php <?php
$stateBadges = new StateBadges(); $stateBadges = new StateBadges();
$stateBadges $stateBadges
->setUrl('monitoring/list/services') ->setUrl('monitoring/list/services')
->add( ->add(
StateBadges::STATE_OK, StateBadges::STATE_OK,
$serviceGroup->services_ok, $serviceGroup->services_ok,
array( array(
'service_state' => 0, 'service_state' => 0,
'servicegroup_name' => $serviceGroup->servicegroup_name, 'servicegroup_name' => $serviceGroup->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %s service that is currently in state OK in service group "%s"', 'List %s service that is currently in state OK in service group "%s"',
'List %s services which are currently in state OK in service group "%s"', 'List %s services which are currently in state OK in service group "%s"',
array($serviceGroup->services_ok, $serviceGroup->servicegroup_alias) array($serviceGroup->services_ok, $serviceGroup->servicegroup_alias)
) )
->add( ->add(
StateBadges::STATE_CRITICAL, StateBadges::STATE_CRITICAL,
$serviceGroup->services_critical_unhandled, $serviceGroup->services_critical_unhandled,
array( array(
'service_state' => 2, 'service_state' => 2,
'service_acknowledged' => 0, 'service_acknowledged' => 0,
'service_in_downtime' => 0, 'service_in_downtime' => 0,
'host_problem' => 0, 'host_problem' => 0,
'servicegroup_name' => $serviceGroup->servicegroup_name, 'servicegroup_name' => $serviceGroup->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %s service that is currently in state CRITICAL in service group "%s"', 'List %s service that is currently in state CRITICAL in service group "%s"',
'List %s services which are currently in state CRITICAL in service group "%s"', 'List %s services which are currently in state CRITICAL in service group "%s"',
array($serviceGroup->services_critical_unhandled, $serviceGroup->servicegroup_alias) array($serviceGroup->services_critical_unhandled, $serviceGroup->servicegroup_alias)
) )
->add( ->add(
StateBadges::STATE_CRITICAL_HANDLED, StateBadges::STATE_CRITICAL_HANDLED,
$serviceGroup->services_critical_handled, $serviceGroup->services_critical_handled,
array( array(
'service_state' => 2, 'service_state' => 2,
'service_handled' => 1, 'service_handled' => 1,
'servicegroup_name' => $serviceGroup->servicegroup_name, 'servicegroup_name' => $serviceGroup->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %s service that is currently in state CRITICAL (Acknowledged) in service group "%s"', 'List %s service that is currently in state CRITICAL (Acknowledged) in service group "%s"',
'List %s services which are currently in state CRITICAL (Acknowledged) in service group "%s"', 'List %s services which are currently in state CRITICAL (Acknowledged) in service group "%s"',
array($serviceGroup->services_critical_unhandled, $serviceGroup->servicegroup_alias) array($serviceGroup->services_critical_unhandled, $serviceGroup->servicegroup_alias)
) )
->add( ->add(
StateBadges::STATE_UNKNOWN, StateBadges::STATE_UNKNOWN,
$serviceGroup->services_unknown_unhandled, $serviceGroup->services_unknown_unhandled,
array( array(
'service_state' => 3, 'service_state' => 3,
'service_acknowledged' => 0, 'service_acknowledged' => 0,
'service_in_downtime' => 0, 'service_in_downtime' => 0,
'host_problem' => 0, 'host_problem' => 0,
'servicegroup_name' => $serviceGroup->servicegroup_name, 'servicegroup_name' => $serviceGroup->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %s service that is currently in state UNKNOWN in service group "%s"', 'List %s service that is currently in state UNKNOWN in service group "%s"',
'List %s services which are currently in state UNKNOWN in service group "%s"', 'List %s services which are currently in state UNKNOWN in service group "%s"',
array($serviceGroup->services_unknown_unhandled, $serviceGroup->servicegroup_alias) array($serviceGroup->services_unknown_unhandled, $serviceGroup->servicegroup_alias)
) )
->add( ->add(
StateBadges::STATE_UNKNOWN_HANDLED, StateBadges::STATE_UNKNOWN_HANDLED,
$serviceGroup->services_unknown_handled, $serviceGroup->services_unknown_handled,
array( array(
'service_state' => 3, 'service_state' => 3,
'service_handled' => 1, 'service_handled' => 1,
'servicegroup_name' => $serviceGroup->servicegroup_name, 'servicegroup_name' => $serviceGroup->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %s service that is currently in state UNKNOWN (Acknowledged) in service group "%s"', 'List %s service that is currently in state UNKNOWN (Acknowledged) in service group "%s"',
'List %s services which are currently in state UNKNOWN (Acknowledged) in service group "%s"', 'List %s services which are currently in state UNKNOWN (Acknowledged) in service group "%s"',
array($serviceGroup->services_unknown_handled, $serviceGroup->servicegroup_alias) array($serviceGroup->services_unknown_handled, $serviceGroup->servicegroup_alias)
) )
->add( ->add(
StateBadges::STATE_WARNING, StateBadges::STATE_WARNING,
$serviceGroup->services_warning_unhandled, $serviceGroup->services_warning_unhandled,
array( array(
'service_state' => 1, 'service_state' => 1,
'service_acknowledged' => 0, 'service_acknowledged' => 0,
'service_in_downtime' => 0, 'service_in_downtime' => 0,
'host_problem' => 0, 'host_problem' => 0,
'servicegroup_name' => $serviceGroup->servicegroup_name, 'servicegroup_name' => $serviceGroup->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %s service that is currently in state WARNING in service group "%s"', 'List %s service that is currently in state WARNING in service group "%s"',
'List %s services which are currently in state WARNING in service group "%s"', 'List %s services which are currently in state WARNING in service group "%s"',
array($serviceGroup->services_warning_unhandled, $serviceGroup->servicegroup_alias) array($serviceGroup->services_warning_unhandled, $serviceGroup->servicegroup_alias)
) )
->add( ->add(
StateBadges::STATE_WARNING_HANDLED, StateBadges::STATE_WARNING_HANDLED,
$serviceGroup->services_warning_handled, $serviceGroup->services_warning_handled,
array( array(
'service_state' => 1, 'service_state' => 1,
'service_handled' => 1, 'service_handled' => 1,
'servicegroup_name' => $serviceGroup->servicegroup_name, 'servicegroup_name' => $serviceGroup->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %s service that is currently in state WARNING (Acknowledged) in service group "%s"', 'List %s service that is currently in state WARNING (Acknowledged) in service group "%s"',
'List %s services which are currently in state WARNING (Acknowledged) in service group "%s"', 'List %s services which are currently in state WARNING (Acknowledged) in service group "%s"',
array($serviceGroup->services_warning_handled, $serviceGroup->servicegroup_alias) array($serviceGroup->services_warning_handled, $serviceGroup->servicegroup_alias)
) )
->add( ->add(
StateBadges::STATE_PENDING, StateBadges::STATE_PENDING,
$serviceGroup->services_pending, $serviceGroup->services_pending,
array( array(
'service_state' => 99, 'service_state' => 99,
'servicegroup_name' => $serviceGroup->servicegroup_name, 'servicegroup_name' => $serviceGroup->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %s service that is currenlty in state PENDING in service group "%s"', 'List %s service that is currenlty in state PENDING in service group "%s"',
'List %s services which are currently in state PENDING in service group "%s"', 'List %s services which are currently in state PENDING in service group "%s"',
array($serviceGroup->services_pending, $serviceGroup->servicegroup_alias) array($serviceGroup->services_pending, $serviceGroup->servicegroup_alias)
); );
echo $stateBadges->render(); echo $stateBadges->render();
?> ?>
</td> </td>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
<?php if ($servicegroups->hasMore()): ?> <?php if ($servicegroups->hasMore()): ?>
<?= $this->qlink( <?= $this->qlink(
$this->translate('Show More'), $this->translate('Show More'),
$this->url()->without(array('view', 'limit')), $this->url()->without(array('view', 'limit')),
null, null,
array( array(
'data-base-target' => '_next', 'data-base-target' => '_next',
'class' => 'pull-right show-more' 'class' => 'pull-right show-more'
) )
) ?> ) ?>
<?php endif ?> <?php endif ?>
</div> </div>