Make servicematrix x-axis header titles linking to filtered servicelist

This commit is contained in:
Johannes Meyer 2014-03-20 09:41:41 +01:00
parent 44950ea570
commit aa6d6b1d41
2 changed files with 26 additions and 11 deletions

View File

@ -16,8 +16,12 @@
<?php endif ?> <?php endif ?>
<div class="content" data-base-target="_next"> <div class="content" data-base-target="_next">
<table class="pivot servicestates"> <table class="pivot servicestates">
<?php $hasHeader = false; ?> <?php
<?php foreach ($this->pivot->toArray() as $host_name => $serviceStates): ?> $hasHeader = false;
$pivotData = $this->pivot->toArray();
$hostFilter = implode(',', array_keys($pivotData));
?>
<?php foreach ($pivotData as $host_name => $serviceStates): ?>
<?php if (!$hasHeader): ?> <?php if (!$hasHeader): ?>
<thead> <thead>
<tr> <tr>
@ -26,9 +30,17 @@
<div> <div>
<?php foreach (array_keys($serviceStates) as $service_description): ?> <?php foreach (array_keys($serviceStates) as $service_description): ?>
<span> <span>
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_description' => $service_description,
'host_name' => $hostFilter
)
); ?>">
<abbr title="<?= $service_description; ?>"> <abbr title="<?= $service_description; ?>">
<?= strlen($service_description) > 18 ? substr($service_description, 0, 18) . '...' : $service_description; ?> <?= strlen($service_description) > 18 ? substr($service_description, 0, 18) . '...' : $service_description; ?>
</abbr> </abbr>
</a>
</span> </span>
<?php endforeach ?> <?php endforeach ?>
</div> </div>

View File

@ -531,6 +531,15 @@ div.pivot-pagination {
} }
table.pivot { table.pivot {
a {
text-decoration: none;
color: black;
&:hover {
color: #666;
}
}
thead { thead {
th { th {
height: 6em; height: 6em;
@ -578,12 +587,6 @@ table.pivot {
a { a {
font-size: 0.8em; font-size: 0.8em;
text-decoration: none;
color: black;
&:hover {
color: #666;
}
} }
} }