Unify detail header, fit new layout

This commit is contained in:
Thomas Gelf 2014-03-06 13:20:34 +00:00
parent fdb5dede50
commit d1026c240b
4 changed files with 24 additions and 140 deletions

View File

@ -1,33 +1,28 @@
<?php $showService = $object->service_description && $tabs->getActiveName() !== 'host' ?>
<?php if (! $compact): ?>
<?= $tabs->render($this) ?>
<?php if (!$this->compact): ?>
<?= $tabs ?>
<?php endif ?>
<table class="table">
<tr>
<td>
{{HOST_ICON}} <b><?= $this->escape($object->host_name) ?>
<?php if ($object->host_address && $object->host_address !== $object->host_name): ?>
(<?= $this->escape($object->host_address) ?>)
<?php endif ?>
</b>
</td>
<td>
<?= $this->util()->getHostStateName($object->host_state) ?>
<br/>
<table class="objectstate">
<tr class="state <?= $this->monitoringState($object, 'host') ?><?= $object->host_handled ? ' handled' : '' ?>">
<td class="state"<?= $showService ? '' : ' rowspan="2"' ?>>
<?= $this->util()->getHostStateName($object->host_state) ?><br />
since <?= $this->timeSince($object->host_last_state_change) ?>
</td>
<td><b><?= $this->escape($object->host_name) ?></b><?php
if ($object->host_address && $object->host_address !== $object->host_name): ?>
<br><?= $this->escape($object->host_address) ?></br>
<?php endif ?>
</td>
</tr>
<?php if ($showService): ?>
<tr>
<td>
{{SERVICE_ICON}} <b>Service: <?= $this->escape($object->service_description) ?></b>
</td>
<td>
<?= $this->util()->getServiceStateName($object->service_state); ?>
<br/>
<tr class="state <?= $this->monitoringState($object, 'service') ?><?= $object->service_handled ? ' handled' : '' ?>">
<td class="state">
<?= $this->util()->getServiceStateName($object->service_state); ?><br />
since <?= $this->timeSince($object->service_last_state_change) ?>
</td>
<td><b>Service: <?= $this->escape($object->service_description) ?></b></td>
</tr>
<?php endif; ?>
<?php else: ?>
<tr><td><!--<b>Host state</b>-->&nbsp;</td></tr>
<?php endif ?>
</table>

View File

@ -1,115 +0,0 @@
<?php
/** @var boolean $showService */
$showService = false;
if (isset($this->service) && $this->tabs->getActiveName() !== 'host') {
$showService = true;
}
/** @var boolean $inlineCommands */
$inlineCommands = true;
if ($this->tabs->getActiveName() === 'history') {
$inlineCommands = false;
}
if (!$this->compact) {
echo $this->tabs->render($this);
}
?>
<div>
<?php if ($inlineCommands === true): ?>
<div class="pull-right">
</div>
<?php endif; ?>
<table>
<tr>
<td>
{{HOST_ICON}}
<?php if ($this->object->host_icon_image): ?>
<div>
<img src="<?= $this->object->host_icon_image; ?>" alt="Host image"/>
</div>
<?php endif; ?>
<strong>
<?= $this->escape($this->object->host_name); ?>
<?php if ($this->object->host_address && $this->object->host_address !== $this->object->host_name): ?>
(<?= $this->escape($this->object->host_address); ?>)
<?php endif; ?>
</strong>
<?php if (isset($this->object->host_alias) && $this->object->host_alias !== $this->object->host_name): ?>
<br/>
<sup>(<?= $this->object->host_alias; ?>)</sup>
<?php endif; ?>
</td>
<td
<?= $showService ? '' : ' rowspan="2"'; ?>
<?= $this->util()->getHostStateName($this->object->host_state); ?>
since <?= $this->timeSince($this->object->host_last_state_change); ?>
<?php if ($this->object->host_acknowledged === '1'): ?>
(Has been acknowledged)
<?php endif; ?>
</td>
</tr>
<?php if ($this->object->host_action_url || $this->object->host_notes_url): ?>
<tr>
<td rowspan="2">
<?php if ($this->object->host_action_url): ?>
{{EXTERNAL_LINK_ICON}}
<a target="_new" href='<?= $this->object->host_notes_url ?>'>Host actions </a>
<?php endif; ?>
<?php if ($this->object->host_notes_url): ?>
{{EXTERNAL_LINK_ICON}}
<a target="_new" href='<?= $this->object->host_notes_url ?>'>Host notes </a>
<?php endif; ?>
</td>
</tr>
<?php endif; ?>
<?php if ($showService === true): ?>
<tr>
<td>
{{SERVICE_ICON}}
<?php if ($this->service->service_icon_image): ?>
<div>
<img src="<?= $this->service->service_icon_image; ?>" alt="Host image"/>
</div>
<?php endif; ?>
<strong>
Service: <?= $this->escape($this->service->service_description); ?>
</strong>
</td>
<td>
<?= $this->util()->getServiceStateName($this->service->service_state); ?>
since <?= $this->timeSince($this->service->service_last_state_change); ?>
<?php if ($this->service->service_acknowledged === '1'): ?>
(Has been acknowledged)
<?php endif; ?>
</td>
</tr>
<?php if ($this->service->service_action_url || $this->service->service_notes_url): ?>
<tr>
<td rowspan="2">
<?php if ($this->service->service_action_url): ?>
{{EXTERNAL_LINK_ICON}}
<a target="_new" href='<?= $this->service->service_notes_url ?>'>Service actions </a>
<?php endif; ?>
<?php if ($this->service->service_notes_url): ?>
{{EXTERNAL_LINK_ICON}}
<a target="_new" href='<?= $this->service->service_notes_url ?>'>Service notes </a>
<?php endif; ?>
</td>
</tr>
<?php endif; ?>
<?php endif; ?>
</table>
<div class="clearfix"></div>
</div>

View File

@ -1,6 +1,7 @@
<div class="controls">
<?= $this->tabs ?>
<?= $this->render('show/components/header.phtml') ?>
</div>
<div class="content">
<?= $this->render('show/components/status.phtml'); ?>
<?= $this->render('show/components/comments.phtml'); ?>
<?= $this->render('show/components/downtime.phtml'); ?>
@ -10,3 +11,4 @@
<?= $this->render('show/components/hostgroups.phtml'); ?>
<?= $this->render('show/components/contacts.phtml'); ?>
<?= $this->render('show/components/command.phtml') ?>
</div>

View File

@ -1,6 +1,7 @@
<div class="controls">
<?= $this->tabs; ?>
<?= $this->render('show/components/header.phtml') ?>
</div>
<div class="content" data-base-target="col1">
<?= $this->render('show/components/status.phtml'); ?>
<?= $this->render('show/components/comments.phtml'); ?>
<?= $this->render('show/components/downtime.phtml'); ?>
@ -10,3 +11,4 @@
<?= $this->render('show/components/servicegroups.phtml'); ?>
<?= $this->render('show/components/contacts.phtml'); ?>
<?= $this->render('show/components/command.phtml') ?>
</div>