tinystatesummary: use h1, styling

This commit is contained in:
Thomas Gelf 2014-11-19 07:53:16 +01:00
parent 3844087740
commit a20fa3201d
4 changed files with 27 additions and 23 deletions

View File

@ -6,9 +6,9 @@ $selfUrl = 'monitoring/list/hosts';
$currentUrl = Url::fromRequest()->getRelativeUrl(); $currentUrl = Url::fromRequest()->getRelativeUrl();
?> ?>
<h3 class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : '' ?>> <h1 class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : '' ?>>
<?= $this->qlink(sprintf($this->translate('%s hosts:'), $this->stats->hosts_total), $selfUrl); ?> <?= $this->qlink(sprintf($this->translate('%s hosts:'), $this->stats->hosts_total), $selfUrl); ?>
<span class="badges">
<?php if($this->stats->hosts_up): ?> <?php if($this->stats->hosts_up): ?>
<span class="state ok<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 0))->getRelativeUrl() ? ' active' : '' ?>"> <span class="state ok<?= $currentUrl === Url::fromPath($selfUrl, array('host_state' => 0))->getRelativeUrl() ? ' active' : '' ?>">
<?= $this->qlink( <?= $this->qlink(
@ -80,4 +80,5 @@ $currentUrl = Url::fromRequest()->getRelativeUrl();
) ?> ) ?>
</span> </span>
<?php endif; ?> <?php endif; ?>
</h3> </span>
</h1>

View File

@ -4,8 +4,9 @@ use Icinga\Web\Url;
$selfUrl = 'monitoring/list/services'; $selfUrl = 'monitoring/list/services';
$currentUrl = Url::fromRequest()->getRelativeUrl(); $currentUrl = Url::fromRequest()->getRelativeUrl();
?><h3 class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : '' ?>> ?><h1 class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : '' ?>>
<?= $this->qlink(sprintf($this->translate('%s services:'), $this->stats->services_total), $selfUrl) ?> <?= $this->qlink(sprintf($this->translate('%s services:'), $this->stats->services_total), $selfUrl) ?>
<span class="badges">
<?php if ($this->stats->services_ok): ?> <?php if ($this->stats->services_ok): ?>
<span class="state ok<?= $currentUrl === Url::fromPath($selfUrl, array('service_state' => 0))->getRelativeUrl() ? ' active' : '' ?>"><?= $this->qlink( <span class="state ok<?= $currentUrl === Url::fromPath($selfUrl, array('service_state' => 0))->getRelativeUrl() ? ' active' : '' ?>"><?= $this->qlink(
$this->stats->services_ok, $this->stats->services_ok,
@ -79,5 +80,6 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
array('title' => sprintf($this->translate('Services with state %s'), strtoupper($this->translate('pending')))) array('title' => sprintf($this->translate('Services with state %s'), strtoupper($this->translate('pending'))))
) ?></span> ) ?></span>
<?php endif ?> <?php endif ?>
</h3> </span>
</h1>

View File

@ -5,13 +5,13 @@ $selfUrl = Url::fromPath('monitoring/show/services', array('host' => $this->obje
$currentUrl = Url::fromRequest()->without('limit')->getRelativeUrl(); $currentUrl = Url::fromRequest()->without('limit')->getRelativeUrl();
?> ?>
<h3 class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : '' ?>> <h1 class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : '' ?>>
<?php if ($object->stats->services_total > 0): ?> <?php if ($object->stats->services_total > 0): ?>
<?= $this->qlink(sprintf($this->translate('%s configured services:'), $object->stats->services_total), $selfUrl) ?> <?= $this->qlink(sprintf($this->translate('%s configured services:'), $object->stats->services_total), $selfUrl) ?>
<?php else: ?> <?php else: ?>
<?= $this->translate('No services configured on this host'); ?> <?= $this->translate('No services configured on this host'); ?>
<?php endif; ?> <?php endif; ?>
<span class="badges">
<?php if ($object->stats->services_ok > 0): ?> <?php if ($object->stats->services_ok > 0): ?>
<span class="state ok<?= $currentUrl === $selfUrl->with('service_state', 0)->getRelativeUrl() ? ' active' : '' ?>"><?= $this->qlink( <span class="state ok<?= $currentUrl === $selfUrl->with('service_state', 0)->getRelativeUrl() ? ' active' : '' ?>"><?= $this->qlink(
$object->stats->services_ok, $object->stats->services_ok,
@ -84,5 +84,6 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
array('title' => sprintf($this->translate('Services with state %s'), strtoupper($this->translate('pending')))) array('title' => sprintf($this->translate('Services with state %s'), strtoupper($this->translate('pending'))))
) ?></span> ) ?></span>
<?php endif ?> <?php endif ?>
</h3> </span>
</h1>

View File

@ -92,36 +92,36 @@ div.contacts div.notification-periods {
margin-top: 0.5em; margin-top: 0.5em;
} }
h3.tinystatesummary { h1.tinystatesummary .badges {
line-height: 2em; display: inline-block;
font-size: 0.95em; margin-bottom: 4px;
margin-right: 1em; margin-left: 1em;
border-bottom: 2px solid @colorPetrol;
} }
h3.tinystatesummary a { h1.tinystatesummary .state {
color: inherit; border-radius: 0.3em;
text-decoration: none;
padding: 1px 3px;
} }
h3.tinystatesummary a:hover { h1.tinystatesummary .state > a {
text-decoration: underline; color: white;
font-size: 0.7em;
padding: 2px 5px;
}
h1.tinystatesummary .state.handled a {
} }
/* State badges */ /* State badges */
span.state { span.state {
font-size: 1em; font-weight: bold;
font-weight: 700;
color: white; color: white;
font-weight: bold; font-weight: bold;
padding: 1px 2px; padding: 1px 2px;
margin-right: 5px; margin-right: 5px;
} }
span.state.active { span.state.active {
border: 2px solid white; border: 2px solid #555;
} }
span.state span.state { span.state span.state {