mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-23 13:54:26 +02:00
Add more consistency to the servicematrix when switching pages
This commit is contained in:
parent
9561096f4a
commit
bf717654f0
@ -163,22 +163,20 @@ class PivotTable
|
|||||||
*/
|
*/
|
||||||
public function toArray()
|
public function toArray()
|
||||||
{
|
{
|
||||||
|
$pivot = array();
|
||||||
$xAxis = $this->xAxisQuery->fetchColumn();
|
$xAxis = $this->xAxisQuery->fetchColumn();
|
||||||
$yAxis = $this->yAxisQuery->fetchColumn();
|
$yAxis = $this->yAxisQuery->fetchColumn();
|
||||||
|
|
||||||
$pivot = array();
|
|
||||||
if (!empty($xAxis) && !empty($yAxis)) {
|
if (!empty($xAxis) && !empty($yAxis)) {
|
||||||
$this->baseQuery->where($this->xAxisColumn, $xAxis)->where($this->yAxisColumn, $yAxis);
|
$this->baseQuery->where($this->xAxisColumn, $xAxis)->where($this->yAxisColumn, $yAxis);
|
||||||
|
|
||||||
foreach ($this->baseQuery->fetchAll() as $row) {
|
foreach ($yAxis as $yLabel) {
|
||||||
if (!array_key_exists($row->{$this->yAxisColumn}, $pivot)) {
|
foreach ($xAxis as $xLabel) {
|
||||||
$defaults = array();
|
$pivot[$yLabel][$xLabel] = null;
|
||||||
foreach ($xAxis as $label) {
|
|
||||||
$defaults[$label] = null;
|
|
||||||
}
|
|
||||||
$pivot[$row->{$this->yAxisColumn}] = $defaults;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach ($this->baseQuery->fetchAll() as $row) {
|
||||||
$pivot[$row->{$this->yAxisColumn}][$row->{$this->xAxisColumn}] = $row;
|
$pivot[$row->{$this->yAxisColumn}][$row->{$this->xAxisColumn}] = $row;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -458,6 +458,7 @@ class Monitoring_ListController extends Controller
|
|||||||
$this->view->history = $query->paginate();
|
$this->view->history = $query->paginate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Should be able to identify hosts that have not a single service (without compromising the pagination)
|
||||||
public function servicematrixAction()
|
public function servicematrixAction()
|
||||||
{
|
{
|
||||||
$this->view->title = 'Servicematrix';
|
$this->view->title = 'Servicematrix';
|
||||||
|
@ -50,7 +50,6 @@ $hostFilter = implode(',', array_keys($pivotData));
|
|||||||
<tbody>
|
<tbody>
|
||||||
<?php $hasHeader = true; ?>
|
<?php $hasHeader = true; ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php if (count(array_filter(array_values($serviceStates)))): ?>
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>
|
<th>
|
||||||
<a href="<?= $this->href('monitoring/show/host', array('host' => $host_name)); ?>">
|
<a href="<?= $this->href('monitoring/show/host', array('host' => $host_name)); ?>">
|
||||||
@ -74,7 +73,6 @@ $hostFilter = implode(',', array_keys($pivotData));
|
|||||||
</td>
|
</td>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endif ?>
|
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
@ -591,9 +591,9 @@ table.pivot {
|
|||||||
}
|
}
|
||||||
|
|
||||||
td {
|
td {
|
||||||
min-width: 1.5em;
|
|
||||||
min-height: 1.5em;
|
|
||||||
padding: 2px;
|
padding: 2px;
|
||||||
|
min-width: 1.5em;
|
||||||
|
line-height: 1.5em;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
a {
|
a {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user