From 589d1bb75cb9ce39049b3dc2e3eaeffa14690d0a Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 3 May 2018 09:34:36 +0200 Subject: [PATCH] list/servicegrid: Use a different view script when axes are flipped refs #2640 --- .../controllers/ListController.php | 3 + .../scripts/list/servicegrid-flipped.phtml | 143 ++++++++++++++++++ 2 files changed, 146 insertions(+) create mode 100644 modules/monitoring/application/views/scripts/list/servicegrid-flipped.phtml diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 171a10427..900062764 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -619,6 +619,9 @@ class ListController extends Controller list($pivotData, $pivotHeader) = $pivot->toArray(); $this->view->pivotData = $pivotData; $this->view->pivotHeader = $pivotHeader; + if ($this->params->get('flipped')) { + $this->render('servicegrid-flipped'); + } } /** diff --git a/modules/monitoring/application/views/scripts/list/servicegrid-flipped.phtml b/modules/monitoring/application/views/scripts/list/servicegrid-flipped.phtml new file mode 100644 index 000000000..777fdc890 --- /dev/null +++ b/modules/monitoring/application/views/scripts/list/servicegrid-flipped.phtml @@ -0,0 +1,143 @@ +compact): ?> +
+ tabs ?> +
+ sortBox ?> +
+ filterEditor ?> +
+ +
+ +

translate('No services found matching the filter.') ?>

+
+ $_) { + $serviceFilter->orFilter(Filter::where('service_description', $serviceDescription)); +} +?> + + + + + $hostAlias): ?> + + + + + + + + $serviceDisplayName): ?> + + + + + + compact && $this->horizontalPaginator->getPages()->pageCount > 1): ?> + + + + + compact && $this->verticalPaginator->getPages()->pageCount > 1): ?> + + + + + +
partial( + 'joystickPagination.phtml', + 'default', + array( + 'flippable' => true, + 'xAxisPaginator' => $horizontalPaginator, + 'yAxisPaginator' => $verticalPaginator + ) + ) ?>
qlink( + $this->ellipsis($hostAlias, 18), + Url::fromPath('monitoring/list/services')->addFilter( + Filter::matchAll($serviceFilter, Filter::where('host_name', $hostName)) + ), + null, + array('title' => sprintf($this->translate('List all reported services on host %s'), $hostAlias)), + false + ) ?>
$_) { + $hostFilter->orFilter(Filter::where('host_name', $hostName)); + } + echo $this->qlink( + $serviceDisplayName, + Url::fromPath('monitoring/list/services')->addFilter( + Filter::matchAll($hostFilter, Filter::where('service_description', $serviceDescription)) + ), + null, + array('title' => sprintf( + $this->translate('List all services with the name "%s" on all reported hosts'), + $serviceDisplayName + )) + ); + ?> + + + protectId($service->host_name . '_' . $service->service_description . '_desc') ?> + + escape($service->service_output) ?> + + qlink( + '', + 'monitoring/service/show', + array( + 'host' => $hostName, + 'service' => $serviceDescription + ), + array( + 'aria-describedby' => $ariaDescribedById, + 'aria-label' => sprintf( + $this->translate('Show detailed information for service %s on host %s'), + $service->service_display_name, + $service->host_display_name + ), + 'class' => 'service-grid-link state-' . Service::getStateText($service->service_state) . ($service->service_handled ? ' handled' : ''), + 'title' => $service->service_output + ) + ) ?> + + qlink( + $this->translate('Load more'), + Url::fromRequest(), + array( + 'limit' => ($this->horizontalPaginator->getItemCountPerPage() + 20) + . ',' + . $this->verticalPaginator->getItemCountPerPage() + ), + array( + 'class' => 'action-link', + 'data-base-target' => '_self' + ) + ) ?> + +
+ qlink( + $this->translate('Load more'), + Url::fromRequest(), + array( + 'limit' => $this->horizontalPaginator->getItemCountPerPage() + . ',' + . ($this->verticalPaginator->getItemCountPerPage() + 20) + ), + array( + 'class' => 'action-link', + 'data-base-target' => '_self' + ) + ) ?> +
+