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,101 +5,109 @@ 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') ?>
<h1 class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : ''; ?>> <h1 class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : ''; ?>>
<?= $this->render('list/components/servicesummary.phtml') ?> <?= $this->render('list/components/servicesummary.phtml') ?>
</h1> </h1>
</div> </div>
<?= $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">
<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(
'host' => $service->host_name, 'host' => $service->host_name,
'service' => $service->service_description 'service' => $service->service_description
) )
); );
$hostLink = $this->href( $hostLink = $this->href(
'monitoring/host/show', 'monitoring/host/show',
array( array(
'host' => $service->host_name, 'host' => $service->host_name,
) )
); );
$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>
<span class="state-label"><?= Service::getStateText($service->service_state, true) ?></span> <span class="state-label"><?= Service::getStateText($service->service_state, true) ?></span>
<?php if ((int) $service->service_state !== 99): ?> <?php if ((int) $service->service_state !== 99): ?>
<br> <br>
<?= $this->timeSince($service->service_last_state_change, $this->compact) ?> <?= $this->timeSince($service->service_last_state_change, $this->compact) ?>
<?php if ((int) $service->service_state > 0 && (int) $service->service_state_type === 0): ?> <?php if ((int) $service->service_state > 0 && (int) $service->service_state_type === 0): ?>
<br> <br>
<span class="text-small">Soft <?= $service->service_attempt ?></span> <span class="text-small">Soft <?= $service->service_attempt ?></span>
<?php endif ?> <?php endif ?>
<?php endif ?> <?php endif ?>
</p> </p>
</td> </td>
<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
$hostLink, . ($service->host_state != 0 ? ' (' . Host::getStateText($service->host_state, true) . ')' : ''),
null, $hostLink,
array('title' => sprintf($this->translate('Show detailed information for host %s'), $service->host_display_name)) null,
) ?>: array(
<?php endif ?><?= $this->qlink( 'title' => sprintf(
$service->service_display_name, $this->translate('Show detailed information for host %s'),
$serviceLink, $service->host_display_name
null, )
array( )
'title' => sprintf( ) ?>:
$this->translate('Show detailed information for service %s on host %s'), <?php endif ?><?= $this->qlink(
$service->service_display_name, $service->service_display_name,
$service->host_display_name $serviceLink,
), null,
'class' => 'rowaction' array(
) 'title' => sprintf(
) ?><br /> $this->translate('Show detailed information for service %s on host %s'),
<div class="sparkline-box"><?= $this->perfdata($service->service_perfdata, true, 5) ?> </div> $service->service_display_name,
<p class="plugin-output"><?= $this->pluginOutput($this->ellipsis($service->service_output, 10000), true) ?></p> $service->host_display_name
</td> ),
<?php foreach($this->addColumns as $col): ?> 'class' => 'rowaction'
<td><?= $this->escape($service->$col) ?></td> )
<?php endforeach ?> ) ?><br />
</tr> <div class="sparkline-box"><?= $this->perfdata($service->service_perfdata, true, 5) ?> </div>
<?php endforeach ?> <p class="plugin-output">
</tbody> <?= $this->pluginOutput($this->ellipsis($service->service_output, 10000), true) ?>
</table> </p>
<?php if (! $services->hasResult()): ?> </td>
<?= $this->translate('No services found matching the filter'); ?> <?php foreach($this->addColumns as $col): ?>
<?php elseif ($services->hasMore()): ?> <td><?= $this->escape($service->$col) ?></td>
<?= $this->qlink( <?php endforeach ?>
$this->translate('Show More'), </tr>
$this->url()->without(array('view', 'limit')), <?php endforeach ?>
null, </tbody>
array( </table>
'data-base-target' => '_next', <?php if (! $services->hasResult()): ?>
'class' => 'pull-right show-more' <?= $this->translate('No services found matching the filter'); ?>
) <?php elseif ($services->hasMore()): ?>
); ?> <?= $this->qlink(
<?php endif ?> $this->translate('Show More'),
$this->url()->without(array('view', 'limit')),
null,
array(
'data-base-target' => '_next',
'class' => 'pull-right show-more'
)
) ?>
<?php endif ?>
</div> </div>