mirror of
				https://github.com/Icinga/icingaweb2.git
				synced 2025-11-03 20:54:27 +01:00 
			
		
		
		
	Do not display hosts without any services in the servicematrix
refs #4180
This commit is contained in:
		
							parent
							
								
									5dc7d0dd56
								
							
						
					
					
						commit
						13b509bf4b
					
				@ -4,7 +4,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
namespace Icinga\Data;
 | 
					namespace Icinga\Data;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
use \stdClass;
 | 
					 | 
				
			||||||
use Icinga\Data\BaseQuery;
 | 
					use Icinga\Data\BaseQuery;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class PivotTable
 | 
					class PivotTable
 | 
				
			||||||
@ -142,26 +141,17 @@ class PivotTable
 | 
				
			|||||||
        $yAxis = $this->fetchYAxis();
 | 
					        $yAxis = $this->fetchYAxis();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $this->query->where($this->xAxisColumn, $xAxis)->where($this->yAxisColumn, $yAxis);
 | 
					        $this->query->where($this->xAxisColumn, $xAxis)->where($this->yAxisColumn, $yAxis);
 | 
				
			||||||
        if (!$this->query->hasOrder()) {
 | 
					 | 
				
			||||||
            $this->query->order($this->xAxisColumn)->order($this->yAxisColumn);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        $emptyrow = new stdClass();
 | 
					 | 
				
			||||||
        foreach ($this->query->getColumns() as $col) {
 | 
					 | 
				
			||||||
            $emptyrow->{$col} = null;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $pivot = array();
 | 
					        $pivot = array();
 | 
				
			||||||
        foreach ($xAxis as $x) {
 | 
					 | 
				
			||||||
            foreach ($yAxis as $y) {
 | 
					 | 
				
			||||||
                $row = clone($emptyrow);
 | 
					 | 
				
			||||||
                $row->{$this->xAxisColumn} = $x;
 | 
					 | 
				
			||||||
                $row->{$this->yAxisColumn} = $y;
 | 
					 | 
				
			||||||
                $pivot[$y][$x] = $row;
 | 
					 | 
				
			||||||
            }
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        foreach ($this->query->fetchAll() as $row) {
 | 
					        foreach ($this->query->fetchAll() as $row) {
 | 
				
			||||||
 | 
					            if (!array_key_exists($row->{$this->yAxisColumn}, $pivot)) {
 | 
				
			||||||
 | 
					                $defaults = array();
 | 
				
			||||||
 | 
					                foreach ($xAxis as $label) {
 | 
				
			||||||
 | 
					                    $defaults[$label] = null;
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					                $pivot[$row->{$this->yAxisColumn}] = $defaults;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            $pivot[$row->{$this->yAxisColumn}][$row->{$this->xAxisColumn}] = $row;
 | 
					            $pivot[$row->{$this->yAxisColumn}][$row->{$this->xAxisColumn}] = $row;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -29,7 +29,7 @@
 | 
				
			|||||||
                    </a>
 | 
					                    </a>
 | 
				
			||||||
                </th>
 | 
					                </th>
 | 
				
			||||||
<?php foreach (array_values($serviceStates) as $service): ?>
 | 
					<?php foreach (array_values($serviceStates) as $service): ?>
 | 
				
			||||||
<?php if ($service->service_state !== null): ?>
 | 
					<?php if ($service !== null): ?>
 | 
				
			||||||
                <td class="state_<?= $this->monitoringState($service, 'service'); ?> <?= $service->service_handled ? 'handled' : ''; ?>">
 | 
					                <td class="state_<?= $this->monitoringState($service, 'service'); ?> <?= $service->service_handled ? 'handled' : ''; ?>">
 | 
				
			||||||
                    <a href="<?= $this->href(
 | 
					                    <a href="<?= $this->href(
 | 
				
			||||||
                        'monitoring/show/service',
 | 
					                        'monitoring/show/service',
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user