monitoring/CSS: Fix spacing of state summaries

refs #5543
This commit is contained in:
Eric Lippmann 2015-11-12 11:40:32 +01:00
parent 840ecf681e
commit 77e797db88
8 changed files with 42 additions and 31 deletions

View File

@ -8,16 +8,16 @@ if (! $stats instanceof stdClass) {
} }
?> ?>
<div class="hosts-summary"> <div class="hosts-summary">
<?= $this->qlink( <span class="hosts-link"><?= $this->qlink(
sprintf($this->translatePlural('%u Host', '%u Hosts', $stats->hosts_total), $stats->hosts_total), sprintf($this->translatePlural('%u Host', '%u Hosts', $stats->hosts_total), $stats->hosts_total),
// @TODO(el): Fix that // @TODO(el): Fix that
Url::fromPath('monitoring/list/hosts')->setParams(isset($baseFilter) ? $baseFilter->getUrlParams() : array()), Url::fromPath('monitoring/list/hosts')->setParams(isset($baseFilter) ? $baseFilter->getUrlParams() : array()),
null, null,
array('title' => sprintf( array('title' => sprintf(
$this->translatePlural('List %u host', 'List all %u hosts', $stats->hosts_total), $this->translatePlural('List %u host', 'List all %u hosts', $stats->hosts_total),
$stats->hosts_total $stats->hosts_total
)) ))
) ?>&#58; ) ?>&#58;</span>
<?php <?php
$stateBadges = new StateBadges(); $stateBadges = new StateBadges();
$stateBadges $stateBadges

View File

@ -8,19 +8,19 @@ if (! $stats instanceof stdClass) {
} }
?> ?>
<div class="services-summary"> <div class="services-summary">
<?= $this->qlink( <span class="services-link"><?= $this->qlink(
sprintf($this->translatePlural( sprintf($this->translatePlural(
'%u Service', '%u Services', $stats->services_total), '%u Service', '%u Services', $stats->services_total),
$stats->services_total $stats->services_total
), ),
// @TODO(el): Fix that // @TODO(el): Fix that
Url::fromPath('monitoring/list/services')->setParams(isset($baseFilter) ? $baseFilter->getUrlParams() : array()), Url::fromPath('monitoring/list/services')->setParams(isset($baseFilter) ? $baseFilter->getUrlParams() : array()),
null, null,
array('title' => sprintf( array('title' => sprintf(
$this->translatePlural('List %u service', 'List all %u services', $stats->services_total), $this->translatePlural('List %u service', 'List all %u services', $stats->services_total),
$stats->services_total $stats->services_total
)) ))
) ?>&#58; ) ?>&#58;</span>
<?php <?php
$stateBadges = new StateBadges(); $stateBadges = new StateBadges();
$stateBadges $stateBadges

View File

@ -2,7 +2,7 @@
<tbody> <tbody>
<?php <?php
foreach ($comments as $i => $comment): foreach ($comments as $i => $comment):
if ($i > 5) { if ($i === 5) {
break; break;
} }
?> ?>

View File

@ -2,7 +2,7 @@
use Icinga\Module\Monitoring\Object\Host; use Icinga\Module\Monitoring\Object\Host;
if (! ($hostCount = count($objects))): return; endif ?> if (! ($hostCount = count($objects))): return; endif ?>
<table class="state-table"> <table class="state-table host-detail-state">
<tbody> <tbody>
<?php foreach ($objects as $i => $host): /** @var Host $host */ <?php foreach ($objects as $i => $host): /** @var Host $host */
if ($i === 5) { if ($i === 5) {

View File

@ -2,7 +2,7 @@
use Icinga\Module\Monitoring\Object\Host; use Icinga\Module\Monitoring\Object\Host;
/** @var Host $object */ /** @var Host $object */
?> ?>
<table class="state-table"> <table class="state-table host-detail-state">
<tr> <tr>
<td class="state-col state-<?= Host::getStateText($object->host_state) ?><?= $object->host_handled ? ' handled' : '' ?>"> <td class="state-col state-<?= Host::getStateText($object->host_state) ?><?= $object->host_handled ? ' handled' : '' ?>">
<div class="state-header"><?= Host::getStateText($object->host_state, true) ?></div> <div class="state-header"><?= Host::getStateText($object->host_state, true) ?></div>

View File

@ -3,7 +3,7 @@ use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service; use Icinga\Module\Monitoring\Object\Service;
/** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */ /** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */
?> ?>
<table class="state-table"> <table class="state-table service-detail-state">
<tr> <tr>
<td class="state-col state-<?= Host::getStateText($object->host_state) ?><?= $object->host_handled ? ' handled' : '' ?>"> <td class="state-col state-<?= Host::getStateText($object->host_state) ?><?= $object->host_handled ? ' handled' : '' ?>">
<div class="state-label"><?= Host::getStateText($object->host_state, true) ?></div> <div class="state-label"><?= Host::getStateText($object->host_state, true) ?></div>

View File

@ -3,7 +3,7 @@ use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service; use Icinga\Module\Monitoring\Object\Service;
if (! ($serviceCount = count($objects))): return; endif ?> if (! ($serviceCount = count($objects))): return; endif ?>
<table class="state-table"> <table class="state-table service-detail-state">
<tbody> <tbody>
<?php foreach ($objects as $i => $service): /** @var Service $service */ <?php foreach ($objects as $i => $service): /** @var Service $service */
if ($i === 5) { if ($i === 5) {

View File

@ -39,16 +39,27 @@
width: 1em; width: 1em;
} }
// Host and service summaries in detail and list views
.hosts-summary, .hosts-summary,
.services-summary { .services-summary {
.v-center(); margin-bottom: 0.5em;
margin-top: @horizontal-padding;
> .hosts-link,
> .services-link,
> .state-badges {
vertical-align: middle;
}
}
// State table in the host and service multi-selection and detail views
.host-detail-state,
.service-detail-state {
margin-bottom: 0.5em;
} }
.grid { .grid {
.hosts-summary, .hosts-summary,
.services-summary { .services-summary {
margin: 0;
.pull-left(); .pull-left();
} }
} }