Refine tactical overview style

This commit is contained in:
Johannes Meyer 2014-03-10 15:09:53 +01:00
parent 55dc579aa0
commit e291974e55
8 changed files with 193 additions and 312 deletions

View File

@ -22,17 +22,11 @@ class Monitoring_TacticalController extends MonitoringController
$this->_request, $this->_request,
array( array(
'hosts_up', 'hosts_up',
'hosts_up_not_checked',
'hosts_pending', 'hosts_pending',
'hosts_pending_not_checked', 'hosts_down',
'hosts_down_handled',
'hosts_down_unhandled', 'hosts_down_unhandled',
'hosts_down_passive', 'hosts_unreachable',
'hosts_down_not_checked',
'hosts_unreachable_handled',
'hosts_unreachable_unhandled', 'hosts_unreachable_unhandled',
'hosts_unreachable_passive',
'hosts_unreachable_not_checked',
'services_ok_on_ok_hosts', 'services_ok_on_ok_hosts',
'services_ok_not_checked_on_ok_hosts', 'services_ok_not_checked_on_ok_hosts',

View File

@ -9,7 +9,7 @@
<div class="box contactgroup"> <div class="box contactgroup">
<h2><?= $groupInfo['alias']; ?></h2> <h2><?= $groupInfo['alias']; ?></h2>
<?php if ($groupInfo['alias'] !== $groupName): ?> <?php if ($groupInfo['alias'] !== $groupName): ?>
<h3><?= $groupName; ?></h3> <h2><?= $groupName; ?></h2>
<?php endif ?> <?php endif ?>
<div class="box contents"> <div class="box contents">
<?php foreach ($groupInfo['contacts'] as $c): ?> <?php foreach ($groupInfo['contacts'] as $c): ?>

View File

@ -7,9 +7,11 @@
<div class="boxview" data-base-target="_next"> <div class="boxview" data-base-target="_next">
<?php foreach($hostgroups as $h): ?> <?php foreach($hostgroups as $h): ?>
<div class="box hostgroup"> <div class="box hostgroup">
<h2>
<a href="<?= $this->href('monitoring/list/services', array('hostgroup' => $h->hostgroup)); ?>"> <a href="<?= $this->href('monitoring/list/services', array('hostgroup' => $h->hostgroup)); ?>">
<h2><?= $h->hostgroup; ?></h2> <?= $h->hostgroup; ?>
</a> </a>
</h2>
<div class="box contents"> <div class="box contents">
<table> <table>
<thead> <thead>

View File

@ -7,12 +7,14 @@
<div class="boxview" data-base-target="_next"> <div class="boxview" data-base-target="_next">
<?php foreach($servicegroups as $servicegroup): ?> <?php foreach($servicegroups as $servicegroup): ?>
<div class="box servicegroup"> <div class="box servicegroup">
<h2>
<a href="<?= $this->href( <a href="<?= $this->href(
'monitoring/list/services', 'monitoring/list/services',
array('servicegroup' => $servicegroup->servicegroup) array('servicegroup' => $servicegroup->servicegroup)
); ?>"> ); ?>">
<h2><?= $servicegroup->servicegroup; ?></h2> <?= $servicegroup->servicegroup; ?>
</a> </a>
</h2>
<div class="box contents"> <div class="box contents">
<table> <table>
<thead> <thead>

View File

@ -1,87 +1,31 @@
<div class="box ok_hosts"> <?php
<h2><?= $this->translate('OK Hosts'); ?></h2> $service_problems = (
<div class="box contents"> $this->statusSummary->services_warning_handled_on_ok_hosts ||
<table> $this->statusSummary->services_warning_unhandled_on_ok_hosts ||
<thead> $this->statusSummary->services_critical_handled_on_ok_hosts ||
<tr> $this->statusSummary->services_critical_unhandled_on_ok_hosts ||
<th><?= $this->translate('Hosts'); ?></th> $this->statusSummary->services_unknown_handled_on_ok_hosts ||
<th><?= $this->translate('Services'); ?></th> $this->statusSummary->services_unknown_unhandled_on_ok_hosts
</tr> );
</thead> ?>
<tbody> <div class="box ok_hosts state_<?= $this->statusSummary->hosts_up ? 'up' : 'pending'; ?>">
<tr>
<td>
<?php if ($this->statusSummary->hosts_up): ?> <?php if ($this->statusSummary->hosts_up): ?>
<div class="box entry state_up"> <h2>
<a href="<?= $this->href( <a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 0)); ?>">
'monitoring/list/hosts', <?= sprintf($this->translate('%d Hosts UP'), $this->statusSummary->hosts_up); ?>
array('host_state' => 0)
); ?>">
<?= $this->statusSummary->hosts_up; ?> UP
</a> </a>
<?php if ($this->statusSummary->hosts_up_not_checked): ?> </h2>
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 0,
'host_active_checks_enabled' => 0,
'host_passive_checks_enabled' => 0
)
); ?>">
<?php
if ($this->statusSummary->hosts_up_not_checked > 1) {
printf(
$this->translate('%d are not checked at all'),
$this->statusSummary->hosts_up_not_checked
);
} else {
printf(
$this->translate('%d is not checked at all'),
$this->statusSummary->hosts_up_not_checked
);
}
?>
</a>
<?php endif ?>
</div>
<?php endif ?> <?php endif ?>
<?php if ($this->statusSummary->hosts_pending): ?> <?php if ($this->statusSummary->hosts_pending): ?>
<div class="box entry state_pending"> <h2>
<a href="<?= $this->href( <a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 99)); ?>">
'monitoring/list/hosts', <?= sprintf($this->translate('%d Hosts PENDING'), $this->statusSummary->hosts_pending); ?>
array('host_state' => 99)
); ?>">
<?= $this->statusSummary->hosts_pending; ?> PENDING
</a>
<?php if ($this->statusSummary->hosts_pending_not_checked): ?>
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 99,
'host_active_checks_enabled' => 0,
'host_passive_checks_enabled' => 0
)
); ?>">
<?php
if ($this->statusSummary->hosts_pending_not_checked > 1) {
printf(
$this->translate('%d are not checked at all'),
$this->statusSummary->hosts_pending_not_checked
);
} else {
printf(
$this->translate('%d is not checked at all'),
$this->statusSummary->hosts_pending_not_checked
);
}
?>
</a> </a>
</h2>
<?php endif ?> <?php endif ?>
</div> <?php if ($service_problems || $this->statusSummary->hosts_down || $this->statusSummary->hosts_unreachable): ?>
<?php endif ?> <div class="box contents">
</td> <strong><?= $this->translate('Services'); ?></strong>
<td>
<?php if ($this->statusSummary->hosts_up || $this->statusSummary->hosts_pending): ?>
<?= $this->partial( <?= $this->partial(
'tactical/components/parts/servicestatesummarybyhoststate.phtml', 'tactical/components/parts/servicestatesummarybyhoststate.phtml',
array( array(
@ -104,10 +48,10 @@
'services_unknown_not_checked' => $this->statusSummary->services_unknown_not_checked_on_ok_hosts 'services_unknown_not_checked' => $this->statusSummary->services_unknown_not_checked_on_ok_hosts
) )
); ?> ); ?>
<?php else: ?>
<div class="box contents zero">
<h3>0</h3>
<span><?= $this->translate('Service Problems'); ?></span>
<?php endif ?> <?php endif ?>
</td>
</tr>
</tbody>
</table>
</div> </div>
</div> </div>

View File

@ -1,154 +1,25 @@
<div class="box problem_hosts"> <div class="box problem_hosts <?php
<h2><?= $this->translate('Problem Hosts'); ?></h2> echo $this->statusSummary->hosts_down ? 'state_down' : 'state_unreachable';
if (!$this->statusSummary->hosts_down_unhandled && !$this->statusSummary->hosts_unreachable_unhandled) {
echo ' handled';
}
?>">
<?php if ($this->statusSummary->hosts_down): ?>
<h2>
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 1)); ?>">
<?= sprintf($this->translate('%d Hosts DOWN'), $this->statusSummary->hosts_down); ?>
</a>
</h2>
<?php endif ?>
<?php if ($this->statusSummary->hosts_unreachable): ?>
<h2>
<a href="<?= $this->href('monitoring/list/hosts', array('host_state' => 2)); ?>">
<?= sprintf($this->translate('%d Hosts UNREACHABLE'), $this->statusSummary->hosts_unreachable); ?>
</a>
</h2>
<?php endif ?>
<div class="box contents"> <div class="box contents">
<table> <strong><?= $this->translate('Services'); ?></strong>
<thead>
<tr>
<th><?= $this->translate('Hosts'); ?></th>
<th><?= $this->translate('Services'); ?></th>
</tr>
</thead>
<tbody>
<tr>
<td>
<?php if ($this->statusSummary->hosts_down_handled || $this->statusSummary->hosts_down_unhandled): ?>
<div class="box entry state_down <?= $this->statusSummary->hosts_down_unhandled ? '' : 'handled'; ?>">
<?php if ($this->statusSummary->hosts_down_unhandled): ?>
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_state' => 1, 'host_unhandled' => 1)
); ?>">
<?= $this->statusSummary->hosts_down_unhandled; ?> DOWN
</a>
<?php endif ?>
<?php if ($this->statusSummary->hosts_down_handled): ?>
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_state' => 1, 'host_handled' => 1)
); ?>">
<?= $this->statusSummary->hosts_down_handled . ' ' . $this->statusSummary->hosts_down_unhandled ? $this->translate('Acknowledged') : 'DOWN'; ?>
</a>
<?php endif ?>
<?php if ($this->statusSummary->hosts_down_passive): ?>
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 1,
'host_active_checks_enabled' => 0,
'host_passive_checks_enabled' => 1
)
); ?>">
<?php
if ($this->statusSummary->hosts_down_passive > 1) {
printf(
$this->translate('%d are passively checked'),
$this->statusSummary->hosts_down_passive
);
} else {
printf(
$this->translate('%d is passively checked'),
$this->statusSummary->hosts_down_passive
);
}
?>
</a>
<?php endif ?>
<?php if ($this->statusSummary->hosts_down_not_checked): ?>
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 1,
'host_active_checks_enabled' => 0,
'host_passive_checks_enabled' => 0
)
); ?>">
<?php
if ($this->statusSummary->hosts_down_not_checked > 1) {
printf(
$this->translate('%d are not checked at all'),
$this->statusSummary->hosts_down_not_checked
);
} else {
printf(
$this->translate('%d is not checked at all'),
$this->statusSummary->hosts_down_not_checked
);
}
?>
</a>
<?php endif ?>
</div>
<?php endif ?>
<?php if ($this->statusSummary->hosts_unreachable_handled || $this->statusSummary->hosts_unreachable_unhandled): ?>
<div class="box entry state_unreachable <?= $this->statusSummary->hosts_unreachable_unhandled ? '' : 'handled'; ?>">
<?php if ($this->statusSummary->hosts_unreachable_unhandled): ?>
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_state' => 2, 'host_unhandled' => 1)
); ?>">
<?= $this->statusSummary->hosts_unreachable_unhandled; ?> UNREACHABLE
</a>
<?php endif ?>
<?php if ($this->statusSummary->hosts_unreachable_handled): ?>
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_state' => 2, 'host_handled' => 1)
); ?>">
<?= $this->statusSummary->hosts_unreachable . ' ' . $this->statusSummary->hosts_unreachable_unhandled ? $this->translate('Acknowledged') : 'UNREACHABLE'; ?>
</a>
<?php endif ?>
<?php if ($this->statusSummary->hosts_unreachable_passive): ?>
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 2,
'host_active_checks_enabled' => 0,
'host_passive_checks_enabled' => 1
)
); ?>">
<?php
if ($this->statusSummary->hosts_unreachable_passive > 1) {
printf(
$this->translate('%d are passively checked'),
$this->statusSummary->hosts_unreachable_passive
);
} else {
printf(
$this->translate('%d is passively checked'),
$this->statusSummary->hosts_unreachable_passive
);
}
?>
</a>
<?php endif ?>
<?php if ($this->statusSummary->hosts_unreachable_not_checked): ?>
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 2,
'host_active_checks_enabled' => 0,
'host_passive_checks_enabled' => 0
)
); ?>">
<?php
if ($this->statusSummary->hosts_unreachable_not_checked > 1) {
printf(
$this->translate('%d are not checked at all'),
$this->statusSummary->hosts_unreachable_not_checked
);
} else {
printf(
$this->translate('%d is not checked at all'),
$this->statusSummary->hosts_unreachable_not_checked
);
}
?>
</a>
<?php endif ?>
</div>
<?php endif ?>
</td>
<td>
<?= $this->partial( <?= $this->partial(
'tactical/components/parts/servicestatesummarybyhoststate.phtml', 'tactical/components/parts/servicestatesummarybyhoststate.phtml',
array( array(
@ -171,9 +42,5 @@
'services_unknown_not_checked' => $this->statusSummary->services_unknown_not_checked_on_problem_hosts 'services_unknown_not_checked' => $this->statusSummary->services_unknown_not_checked_on_problem_hosts
) )
); ?> ); ?>
</td>
</tr>
</tbody>
</table>
</div> </div>
</div> </div>

View File

@ -5,9 +5,12 @@
<?php endif ?> <?php endif ?>
<div class="content tactical"> <div class="content tactical">
<div class="boxview" data-base-target="_next"> <div class="boxview" data-base-target="_next">
<?php if ($this->statusSummary->hosts_down || $this->statusSummary->hosts_unreachable): ?>
<?= $this->render('tactical/components/problem_hosts.phtml'); ?> <?= $this->render('tactical/components/problem_hosts.phtml'); ?>
<?php endif ?>
<?php if ($this->statusSummary->hosts_up || $this->statusSummary->hosts_pending): ?>
<?= $this->render('tactical/components/ok_hosts.phtml'); ?> <?= $this->render('tactical/components/ok_hosts.phtml'); ?>
<br /> <?php endif ?>
<?= $this->render('tactical/components/hostservicechecks.phtml'); ?> <?= $this->render('tactical/components/hostservicechecks.phtml'); ?>
<?= $this->render('tactical/components/monitoringfeatures.phtml'); ?> <?= $this->render('tactical/components/monitoringfeatures.phtml'); ?>
</div> </div>

View File

@ -237,14 +237,6 @@ a.critical {
/* Box caption */ /* Box caption */
.boxview div.box h2 { .boxview div.box h2 {
margin-top: 0.2em;
margin-bottom: 0.6em;
color: white;
font-weight: bold;
}
.boxview div.box h3 {
margin-top: 0; margin-top: 0;
margin-bottom: 0.6em; margin-bottom: 0.6em;
font-size: 0.8em; font-size: 0.8em;
@ -252,8 +244,29 @@ a.critical {
color: #eee; color: #eee;
} }
.boxview div.box h2:first-child {
margin-top: 0.2em;
font-size: inherit;
color: white;
}
.boxview div.box h2 > a {
color: inherit;
}
.boxview div.box h2 > a:hover {
color: #fafafa;
}
.boxview div.box h2:first-child > a:hover {
color: #dfdfdf;
}
/* Box body of contents */ /* Box body of contents */
.boxview div.box.contents { .boxview div.box.contents {
padding: 0.2em;
background: #fbfbfb; background: #fbfbfb;
border-radius: 0.4em; border-radius: 0.4em;
-moz-border-radius: 0.4em; -moz-border-radius: 0.4em;
@ -377,8 +390,64 @@ div.box.entry.handled a:hover {
/* Tactical overview element styles */ /* Tactical overview element styles */
div.tactical div.box { .tactical > .boxview > div.box {
min-height: 15em; min-height: 17em;
}
.tactical div.box.contents {
min-height: 14.5em;
}
div.box.contents.zero {
min-width: 11.1em;
background-color: transparent;
}
div.box.contents.zero span {
font-weight: bold;
color: white;
}
div.box.contents.zero h3 {
margin: 0;
font-size: 12em;
line-height: 1em;
color: white;
}
div.box.ok_hosts.state_up {
background-color: @colorOk;
}
div.box.ok_hosts.state_pending {
background-color: @colorPending;
}
div.box.problem_hosts.state_down {
background-color: @colorCritical;
}
div.box.problem_hosts.state_down.handled {
background-color: @colorCriticalHandled;
}
div.box.problem_hosts.state_unreachable {
background-color: @colorUnreachable;
}
div.box.problem_hosts.state_unreachable.handled {
background-color: @colorUnreachableHandled;
}
div.box.ok_hosts div.box.entry, div.box.problem_hosts div.box.entry {
min-width: 11.1em;
}
div.box.monitoringfeatures div.box.contents {
padding: 0 0 0.4em;
} }
div.box.monitoringfeatures div.box-separator { div.box.monitoringfeatures div.box-separator {