Use the new object-view scripts

This commit is contained in:
Johannes Meyer 2015-02-02 16:28:35 +01:00
parent afa3431aed
commit 2e99e476fe
6 changed files with 17 additions and 55 deletions

View File

@ -1,6 +1,6 @@
<div class="controls">
<?= $this->render('show/components/header.phtml') ?>
<?= $this->render('show/components/hostservicesummary.phtml') ?>
<?= $this->render('partials/host/object-header.phtml') ?>
<?= $this->render('partials/host/servicesummary.phtml') ?>
</div>
<div class="content" data-base-target="_next">
<?= $this->render('show/components/output.phtml') ?>

View File

@ -1,23 +1,10 @@
<div class="controls">
<?= $this->tabs ?>
<?= $this->render('partials/host/objects-header.phtml') ?>
</div>
<div class="content">
<?php $hostCount = count($objects) ?>
<?php if ($hostCount === 0): ?>
<?php if (($hostCount = count($objects)) === 0): ?>
<?= $this->translate('No hosts matching the filter') ?>
<?php else: ?>
<div class="hbox-item">
<b><?= sprintf($this->translatePlural('Host (%u)', 'Hosts (%u)', $hostCount), $hostCount) ?></b>
</div>
<div class="hbox-item">
&nbsp;<?= $this->hostStatesPieChart ?>
</div>
<div class="hbox-item" style="font-size: 14px">
<?php foreach (array_filter($hostStates) as $text => $count) {
echo sprintf('%s: %u <br>', $this->translate(strtoupper($text)), $count);
} ?>
</div>
<h3>
<?= sprintf(
$this->translatePlural(

View File

@ -1,5 +1,5 @@
<div class="controls">
<?= $this->render('show/components/header.phtml') ?>
<?= $this->render('partials/service/object-header.phtml') ?>
<h1><?= $this->translate("Service detail information") ?></h1>
</div>
<div class="content" data-base-target="_next">

View File

@ -1,41 +1,11 @@
<div class="controls">
<?= $this->tabs ?>
<?= $this->render('partials/service/objects-header.phtml') ?>
</div>
<div class="content">
<?php $serviceCount = count($objects) ?>
<?php if ($serviceCount === 0): ?>
<?php if (($serviceCount = count($objects)) === 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)', $serviceCount), $serviceCount) ?></b>
</div>
<div class="hbox-item">
&nbsp;<?= $this->serviceStatesPieChart ?>
</div>
<div class="hbox-item" style="font-size: 14px">
<?php foreach (array_filter($serviceStates) as $text => $count) {
echo sprintf(' %s: %u <br>', $this->translate(strtoupper($text)), $count);
} ?>
</div>
</div>
<div class="hbox">
<div class="hbox-item" style="width: 6em;">
<?php $hostCount = array_sum(array_values($hostStates)) ?>
<b><?= sprintf($this->translatePlural('Host (%u)', 'Hosts (%u)', $hostCount), $hostCount) ?></b>
</div>
<div class="hbox-item">
&nbsp;<?= $this->hostStatesPieChart ?>
</div>
<div class="hbox-item" style="font-size: 14px">
<?php foreach (array_filter($hostStates) as $text => $count) {
echo sprintf('%s: %u <br>', $this->translate(strtoupper($text)), $count);
} ?>
</div>
</div>
<div>
<a href="<?= $listAllLink ?>" title="<?= $this->translate('List all') ?>">
<?= $this->translate('List all') ?>

View File

@ -3,10 +3,17 @@
use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;
$self = $this;
$hostContext = $object->getType() === 'host';
?>
<div class="controls">
<?= $this->render('show/components/header.phtml'); ?>
<?php if ($hostContext): ?>
<?= $this->render('partials/host/object-header.phtml'); ?>
<?php else: ?>
<?= $this->render('partials/service/object-header.phtml'); ?>
<?php endif ?>
<h1><?= $this->translate('This Object\'s Event History'); ?></h1>
<?= $this->widget('limiter', array('url' => $url, 'max' => $history->count())); ?>
<?= $this->paginationControl($history, null, null, array('preserve' => $this->preserve)); ?>
@ -19,8 +26,6 @@ use Icinga\Module\Monitoring\Object\Service;
<?php return; endif ?>
<?php
$self = $this;
$hostContext = $object->getType() === 'host';
function contactsLink($match, $view) {
$links = array();
foreach (preg_split('/,\s/', $match[1]) as $contact) {

View File

@ -1,5 +1,5 @@
<div class="controls">
<?= $this->render('show/components/header.phtml') ?>
<?= $this->render('show/components/hostservicesummary.phtml') ?>
<?= $this->render('partials/host/object-header.phtml') ?>
<?= $this->render('partials/host/servicesummary.phtml') ?>
</div>
<?= $services ?>