monitoring: Set display names as axis headers for the service grid
refs #9538
This commit is contained in:
parent
1f7c8c712f
commit
bf7d1ba878
|
@ -597,35 +597,20 @@ class Monitoring_ListController extends Controller
|
||||||
'service_display_name' => $this->translate('Service Name')
|
'service_display_name' => $this->translate('Service Name')
|
||||||
), $query);
|
), $query);
|
||||||
$filter = (bool) $this->params->shift('problems', false) ? Filter::where('service_problem', 1) : null;
|
$filter = (bool) $this->params->shift('problems', false) ? Filter::where('service_problem', 1) : null;
|
||||||
$pivot = $query->pivot(
|
$pivot = $query
|
||||||
'service_description',
|
->pivot(
|
||||||
'host_name',
|
'service_description',
|
||||||
$filter,
|
'host_name',
|
||||||
$filter ? clone $filter : null
|
$filter,
|
||||||
);
|
$filter ? clone $filter : null
|
||||||
$pivotData = $pivot->toArray();
|
)
|
||||||
// TODO(el): list($pivotData, $pivotHeader) = $pivot->toArray();
|
->setXAxisHeader('service_display_name')
|
||||||
$pivotHeader = array(
|
->setYAxisHeader('host_display_name');
|
||||||
'cols' => array(),
|
|
||||||
'rows' => array()
|
|
||||||
);
|
|
||||||
foreach ($pivotData as $hostName => $services) {
|
|
||||||
foreach ($services as $serviceDescription => $service) {
|
|
||||||
if ($service === null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (! isset($pivotHeader['rows'][$hostName])) {
|
|
||||||
$pivotHeader['rows'][$hostName] = $service->host_display_name;
|
|
||||||
}
|
|
||||||
if (! isset($pivotHeader['cols'][$serviceDescription])) {
|
|
||||||
$pivotHeader['cols'][$serviceDescription] = $service->service_display_name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$this->view->pivotData = $pivotData;
|
|
||||||
$this->view->pivotHeader = $pivotHeader;
|
|
||||||
$this->view->horizontalPaginator = $pivot->paginateXAxis();
|
$this->view->horizontalPaginator = $pivot->paginateXAxis();
|
||||||
$this->view->verticalPaginator = $pivot->paginateYAxis();
|
$this->view->verticalPaginator = $pivot->paginateYAxis();
|
||||||
|
list($pivotData, $pivotHeader) = $pivot->toArray();
|
||||||
|
$this->view->pivotData = $pivotData;
|
||||||
|
$this->view->pivotHeader = $pivotHeader;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue