Beautify graph list for hosts and services

refs #60
This commit is contained in:
Florian Strohmaier 2017-11-07 13:34:59 +01:00 committed by Johannes Meyer
parent 8832b53170
commit 71deb0f411
3 changed files with 41 additions and 2 deletions

View file

@ -23,7 +23,8 @@ if (! $compact): ?>
<?php
if ($hosts->hasResult()) {
foreach ($hosts->peekAhead($compact) as $host) {
echo '<h2>'
echo '<div class="grid-item">'
. '<h2>';
. $this->qlink(
$host->host_name === $host->host_display_name
? $host->host_display_name
@ -39,6 +40,7 @@ if ($hosts->hasResult()) {
$host->host_check_command,
$host->_host_check_command
))->handleRequest();
echo '</div>';
}
if (! $compact && $hosts->hasMore()) {

View file

@ -23,7 +23,8 @@ if (! $compact): ?>
<?php
if ($services->hasResult()) {
foreach ($services->peekAhead($compact) as $service) {
echo '<h2>'
echo '<div class="grid-item">'
. '<h2>'
. $this->qlink(
$service->host_name === $service->host_display_name
? $service->host_display_name
@ -52,6 +53,7 @@ if ($services->hasResult()) {
$service->service_check_command,
$service->_service_check_command
))->handleRequest();
echo '</div>';
}
if (! $compact && $services->hasMore()) {

View file

@ -80,3 +80,38 @@ form[name=form_timerangepickercustom_graphite] {
margin: 0.25em;
}
}
.grid-item {
display: inline-block;
border-radius: .25em;
border: 1px solid @gray-lighter;
min-width: 302px;
vertical-align: top;
margin-right: 1em;
margin-bottom: 1em;
}
.grid-item h2 {
margin-top: 0;
background: @gray-lightest;
border-bottom: 1px solid @gray-lighter;
padding:.25em .5em;
max-width: 100%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.grid-item > .images:not(:last-child) {
margin-right: 1em;
display: inline-block;
}
.grid-item .graphiteImg {
margin-right: 1px;
}
.grid-item > p {
padding: .5em;
margin-bottom: 0;
}