monitoring: Re-indent the list/services view script

refs #5543
This commit is contained in:
Eric Lippmann 2015-09-23 14:02:39 +02:00
parent cf2fe8433a
commit 59599916b0
1 changed files with 98 additions and 90 deletions

View File

@ -5,7 +5,7 @@ use Icinga\Module\Monitoring\Object\Service;
$services->peekAhead($this->compact); $services->peekAhead($this->compact);
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls separated"> <div class="controls separated">
<?= $this->tabs ?> <?= $this->tabs ?>
<div class="dontprint"> <div class="dontprint">
<?= $this->render('list/components/selectioninfo.phtml') ?> <?= $this->render('list/components/selectioninfo.phtml') ?>
@ -17,16 +17,16 @@ if (! $this->compact): ?>
<?= $this->limiter ?> <?= $this->limiter ?>
<?= $this->paginator ?> <?= $this->paginator ?>
<?= $this->filterEditor ?> <?= $this->filterEditor ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<table data-base-target="_next" <table data-base-target="_next"
class="action multiselect <?php if ($this->compact): ?> compact<?php endif ?>" style="table-layout: auto;" class="action multiselect<?php if ($this->compact): ?> compact<?php endif ?>" style="table-layout: auto;"
data-icinga-multiselect-url="<?= $this->href("monitoring/services/show") ?>" data-icinga-multiselect-url="<?= $this->href('monitoring/services/show') ?>"
data-icinga-multiselect-controllers="<?= $this->href("monitoring/services") ?>" data-icinga-multiselect-controllers="<?= $this->href('monitoring/services') ?>"
data-icinga-multiselect-data="service,host"> data-icinga-multiselect-data="service,host">
<tbody> <tbody>
<?php foreach ($services as $service): <?php foreach ($services as $service):
$serviceLink = $this->href( $serviceLink = $this->href(
'monitoring/service/show', 'monitoring/service/show',
array( array(
@ -41,7 +41,7 @@ if (! $this->compact): ?>
) )
); );
$serviceStateName = Service::getStateText($service->service_state); $serviceStateName = Service::getStateText($service->service_state);
?> ?>
<tr class="state <?= $serviceStateName ?><?= $service->service_handled ? ' handled' : '' ?>"> <tr class="state <?= $serviceStateName ?><?= $service->service_handled ? ' handled' : '' ?>">
<td class="state"> <td class="state">
<p> <p>
@ -60,13 +60,19 @@ if (! $this->compact): ?>
<td> <td>
<?= $this->iconImage()->service($service) ?> <?= $this->iconImage()->service($service) ?>
<span class="objectflags"><?= implode(' ', $this->serviceFlags($service)) ?></span> <span class="objectflags"><?= implode(' ', $this->serviceFlags($service)) ?></span>
<?php if ($this->showHost): ?><?= $this->qlink( <?php if ($this->showHost): ?><?= $this->qlink(
$service->host_display_name . ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : ''), $service->host_display_name
. ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : ''),
$hostLink, $hostLink,
null, null,
array('title' => sprintf($this->translate('Show detailed information for host %s'), $service->host_display_name)) array(
'title' => sprintf(
$this->translate('Show detailed information for host %s'),
$service->host_display_name
)
)
) ?>: ) ?>:
<?php endif ?><?= $this->qlink( <?php endif ?><?= $this->qlink(
$service->service_display_name, $service->service_display_name,
$serviceLink, $serviceLink,
null, null,
@ -78,20 +84,22 @@ if (! $this->compact): ?>
), ),
'class' => 'rowaction' 'class' => 'rowaction'
) )
) ?><br /> ) ?><br />
<div class="sparkline-box"><?= $this->perfdata($service->service_perfdata, true, 5) ?> </div> <div class="sparkline-box"><?= $this->perfdata($service->service_perfdata, true, 5) ?> </div>
<p class="plugin-output"><?= $this->pluginOutput($this->ellipsis($service->service_output, 10000), true) ?></p> <p class="plugin-output">
<?= $this->pluginOutput($this->ellipsis($service->service_output, 10000), true) ?>
</p>
</td> </td>
<?php foreach($this->addColumns as $col): ?> <?php foreach($this->addColumns as $col): ?>
<td><?= $this->escape($service->$col) ?></td> <td><?= $this->escape($service->$col) ?></td>
<?php endforeach ?> <?php endforeach ?>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
<?php if (! $services->hasResult()): ?> <?php if (! $services->hasResult()): ?>
<?= $this->translate('No services found matching the filter'); ?> <?= $this->translate('No services found matching the filter'); ?>
<?php elseif ($services->hasMore()): ?> <?php elseif ($services->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')),
@ -100,6 +108,6 @@ if (! $this->compact): ?>
'data-base-target' => '_next', 'data-base-target' => '_next',
'class' => 'pull-right show-more' 'class' => 'pull-right show-more'
) )
); ?> ) ?>
<?php endif ?> <?php endif ?>
</div> </div>