Clean up service list view script, obsolete compact variant

This commit is contained in:
Thomas Gelf 2014-03-06 10:35:11 +00:00
parent 7cb26a0d34
commit b61a732eaa
2 changed files with 75 additions and 84 deletions

View File

@ -169,7 +169,6 @@ class Monitoring_ListController extends MonitoringController
))->activate('services');
$this->view->title = 'Service Status';
$this->setAutorefreshInterval(10);
$this->compactView = 'services-compact';
$query = $this->fetchServices();
$this->applyRestrictions($query);
$this->view->services = $query->paginate();

View File

@ -1,6 +1,7 @@
<?php
$helper = $this->getHelper('MonitoringState');
?>
if (!$this->compact): ?>
<div class="controls">
<?= $this->tabs ?>
<div style="display: inline-block; margin: 1em; vertical-align: top;">
@ -14,7 +15,8 @@ $helper = $this->getHelper('MonitoringState');
</div>
<div class="content">
<table class="action multiselect">
<?php endif ?>
<table class="action multiselect<?php if ($this->compact): ?> compact<?php endif ?>">
<tbody>
<?php
@ -34,94 +36,84 @@ foreach ($services as $service):
);
$serviceStateName = strtolower($this->util()->getServiceStateName($service->service_state));
?>
<!-- <tr <?= ($this->activeRowHref === $serviceLink) ? 'class="active"' : ''; ?>>-->
<tr class="state <?= $serviceStateName ?><?= $service->service_handled ? ' handled' : '' ?>">
<!-- Color column -->
<!--
<td class="tacheader-status-<?= $serviceStateName; ?>">
<a style="visibility:hidden" href="<?= $serviceLink; ?>"></a>
</td>
<td>
<a style="visibility:hidden" href="<?= $serviceLink; ?>"></a>
<?php if (!$service->service_handled && $service->service_state > 0): ?>
<a href="#" title="Unhandled">
<i class="icon-table icinga-icon-unhandled"></i>
</a>
<?php endif; ?>
<tr class="state <?= $serviceStateName ?><?= $service->service_handled ? ' handled' : '' ?>">
<td class="state" title="<?= $helper->getStateTitle($service, 'service'); ?>">
<strong><?= strtoupper($helper->monitoringState($service, 'service')); ?></strong><br />
<?php if ($service->service_acknowledged && !$service->service_in_downtime): ?>
<a href="#" title="Acknowledged">
<i class="icon-table icinga-icon-acknowledgement"></i>
</a>
<?php endif; ?>
<?php if (!$this->compact): ?>Since <?php endif ?><?= $this->timeSince($service->service_last_state_change); ?>
<?php if ($service->service_state > 0 && (int) $service->service_state_type === 0): ?>
<br />
<strong>Soft <?= $service->service_attempt ?></strong>
<?php endif ?>
</td>
<?php if ($service->service_is_flapping): ?>
<a href="#" title="Flapping">
<i class="icon-table icinga-icon-flapping"></i>
</a>
<?php endif; ?>
<td title="<?= $helper->getStateTitle($service, 'host'); ?>">
<?php if (!$service->service_notifications_enabled): ?>
<a href="#" title="Notifications Disabled">
<i class="icon-table icinga-icon-notification-disabled"></i>
</a>
<?php endif; ?>
<?php if ($service->service_in_downtime): ?>
<a href="#" title="In Downtime">
<i class="icon-table icinga-icon-in-downtime"></i>
</a>
<?php endif; ?>
<?php if (!$service->service_active_checks_enabled): ?>
<?php if (!$service->service_passive_checks_enabled): ?>
<a href="#" title="Active And Passive Checks Disabled">
<i class="icon-table icinga-icon-active-passive-checks-disabled"></i>
</a>
<?php else: ?>
<a href="#" title="Active Checks Disabled">
<i class="icon-table icinga-icon-active-checks-disabled"></i>
</a>
<?php endif; ?>
<?php endif; ?>
<?php if (isset($service->service_last_comment) && $service->service_last_comment !== null): ?>
<a href="#" title="Comments">
<i class="icon-table icinga-icon-comment"></i>
</a>
<?php endif; ?>
</td>
-->
<td class="state" title="<?= $helper->getStateTitle($service, 'service'); ?>">
<strong><?= strtoupper($helper->monitoringState($service, 'service')); ?></strong><br />
<div class="small-row">
Since <?= $this->timeSince($service->service_last_state_change); ?>
<?php if ($service->service_state): ?>
<br />
<strong><?= ($service->service_state_type === '1') ? 'Hard' : 'Soft'; ?> </strong>
<?= $service->service_attempt; ?>
<?php endif ?>
</div>
</div>
</td>
<td title="<?= $helper->getStateTitle($service, 'host'); ?>">
<?= $this->perfdata($service->service_perfdata, true) ?>
<!-- <?php if ($service->service_icon_image): ?>
<div class="pull-left" style="margin-right: 2px;">
<i class="inline-image" style="background-image: url(<?= $this->escape($this->resolveMacros($service->service_icon_image, $service)); ?>);"></i>
</div>
<?php endif; ?>-->
<?php if (!$service->service_handled && $service->service_state > 0): ?>
<?= $this->img('img/icons/unhandled.png', array(
'title' => 'Unhandled',
'align' => 'right'
)) ?>
<?php endif ?>
<?php if ($service->service_acknowledged && !$service->service_in_downtime): ?>
<?= $this->img('img/icons/acknowledgement.png', array(
'title' => 'Acknowledged',
'align' => 'right'
)) ?>
<?php endif ?>
<?php if ($service->service_is_flapping): ?>
<?= $this->img('img/icons/flapping.png', array(
'title' => 'Flapping',
'align' => 'right'
)) ?>
<?php endif ?>
<?php if (!$service->service_notifications_enabled): ?>
<?= $this->img('img/icons/notification_disabled.png', array(
'title' => 'Notifications Disabled',
'align' => 'right'
)) ?>
<?php endif ?>
<?php if ($service->service_in_downtime): ?>
<?= $this->img('img/icons/in_downtime.png', array(
'title' => 'In Downtime',
'align' => 'right'
)) ?>
<?php endif ?>
<?php if (!$service->service_active_checks_enabled): ?>
<?php if (!$service->service_passive_checks_enabled): ?>
<?= $this->img('img/icons/active_passive_checks_disabled.png', array(
'title' => 'Active And Passive Checks Disabled',
'align' => 'right'
)) ?>
<?php else: ?>
<?= $this->img('img/icons/active_checks_disabled.png', array(
'title' => 'Active Checks Disabled',
'align' => 'right'
)) ?>
<?php endif ?>
<?php endif ?>
<?php if ($service->service_icon_image): ?>
<?= $this->img($this->resolveMacros($service->service_icon_image, $service), array('align' => 'left')) ?>
<?php endif ?>
<a href="<?= $serviceLink ?>"><?= $service->service_display_name ?></a> on <a href="<?= $hostLink ?>"><?= $service->host_name; ?>
<?php if ($service->host_state != 0): ?>
(<?= ucfirst($helper->monitoringState($service, 'host')); ?>)
<?php endif; ?>
(<?= ucfirst($helper->monitoringState($service, 'host')); ?>)
<?php endif ?>
</a><br />
<p class="pluginoutput"><?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?></p>
</td>
</tr>
<?php endforeach; ?>
<p class="pluginoutput"><?= $this->escape(substr(strip_tags($service->service_output), 0, 10000)); ?></p>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php if (!$this->compact): ?>
</div>
<?php endif ?>