Use the new object-view scripts
This commit is contained in:
parent
afa3431aed
commit
2e99e476fe
|
@ -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') ?>
|
||||
|
|
|
@ -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">
|
||||
<?= $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(
|
||||
|
|
|
@ -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">
|
||||
|
|
|
@ -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">
|
||||
<?= $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">
|
||||
<?= $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') ?>
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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 ?>
|
||||
|
|
Loading…
Reference in New Issue