Skip to content

Commit

Permalink
monitoring/CSS: Fix spacing of state summaries
Browse files Browse the repository at this point in the history
refs #5543
  • Loading branch information
lippserd committed Nov 12, 2015
1 parent 840ecf6 commit 77e797d
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 31 deletions.
Expand Up @@ -8,16 +8,16 @@ if (! $stats instanceof stdClass) {
}
?>
<div class="hosts-summary">
<?= $this->qlink(
sprintf($this->translatePlural('%u Host', '%u Hosts', $stats->hosts_total), $stats->hosts_total),
// @TODO(el): Fix that
Url::fromPath('monitoring/list/hosts')->setParams(isset($baseFilter) ? $baseFilter->getUrlParams() : array()),
null,
array('title' => sprintf(
$this->translatePlural('List %u host', 'List all %u hosts', $stats->hosts_total),
$stats->hosts_total
))
) ?>&#58;
<span class="hosts-link"><?= $this->qlink(
sprintf($this->translatePlural('%u Host', '%u Hosts', $stats->hosts_total), $stats->hosts_total),
// @TODO(el): Fix that
Url::fromPath('monitoring/list/hosts')->setParams(isset($baseFilter) ? $baseFilter->getUrlParams() : array()),
null,
array('title' => sprintf(
$this->translatePlural('List %u host', 'List all %u hosts', $stats->hosts_total),
$stats->hosts_total
))
) ?>&#58;</span>
<?php
$stateBadges = new StateBadges();
$stateBadges
Expand Down
Expand Up @@ -8,19 +8,19 @@ if (! $stats instanceof stdClass) {
}
?>
<div class="services-summary">
<?= $this->qlink(
sprintf($this->translatePlural(
'%u Service', '%u Services', $stats->services_total),
$stats->services_total
),
// @TODO(el): Fix that
Url::fromPath('monitoring/list/services')->setParams(isset($baseFilter) ? $baseFilter->getUrlParams() : array()),
null,
array('title' => sprintf(
$this->translatePlural('List %u service', 'List all %u services', $stats->services_total),
$stats->services_total
))
) ?>&#58;
<span class="services-link"><?= $this->qlink(
sprintf($this->translatePlural(
'%u Service', '%u Services', $stats->services_total),
$stats->services_total
),
// @TODO(el): Fix that
Url::fromPath('monitoring/list/services')->setParams(isset($baseFilter) ? $baseFilter->getUrlParams() : array()),
null,
array('title' => sprintf(
$this->translatePlural('List %u service', 'List all %u services', $stats->services_total),
$stats->services_total
))
) ?>&#58;</span>
<?php
$stateBadges = new StateBadges();
$stateBadges
Expand Down
Expand Up @@ -2,7 +2,7 @@
<tbody>
<?php
foreach ($comments as $i => $comment):
if ($i > 5) {
if ($i === 5) {
break;
}
?>
Expand Down
Expand Up @@ -2,7 +2,7 @@
use Icinga\Module\Monitoring\Object\Host;

if (! ($hostCount = count($objects))): return; endif ?>
<table class="state-table">
<table class="state-table host-detail-state">
<tbody>
<?php foreach ($objects as $i => $host): /** @var Host $host */
if ($i === 5) {
Expand Down
Expand Up @@ -2,7 +2,7 @@
use Icinga\Module\Monitoring\Object\Host;
/** @var Host $object */
?>
<table class="state-table">
<table class="state-table host-detail-state">
<tr>
<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>
Expand Down
Expand Up @@ -3,7 +3,7 @@ use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;
/** @var \Icinga\Module\Monitoring\Object\MonitoredObject $object */
?>
<table class="state-table">
<table class="state-table service-detail-state">
<tr>
<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>
Expand Down
Expand Up @@ -3,7 +3,7 @@ use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service;

if (! ($serviceCount = count($objects))): return; endif ?>
<table class="state-table">
<table class="state-table service-detail-state">
<tbody>
<?php foreach ($objects as $i => $service): /** @var Service $service */
if ($i === 5) {
Expand Down
17 changes: 14 additions & 3 deletions modules/monitoring/public/css/module.less
Expand Up @@ -39,16 +39,27 @@
width: 1em;
}

// Host and service summaries in detail and list views
.hosts-summary,
.services-summary {
.v-center();
margin-top: @horizontal-padding;
margin-bottom: 0.5em;

> .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 {
.hosts-summary,
.services-summary {
margin: 0;
.pull-left();
}
}
Expand Down

0 comments on commit 77e797d

Please sign in to comment.