From e799d65d3ff883f026ea0675ea2ab42f1d3bb1b1 Mon Sep 17 00:00:00 2001 From: Matthias Jentsch Date: Thu, 28 Aug 2014 16:52:02 +0200 Subject: [PATCH] Only apply SVG responsiveness when not rendered in compact mode Don't let SVGs grow vertically in when displayed in the dashboard, to avoid wasted space --- .../application/controllers/ChartController.php | 5 +++++ .../application/views/scripts/chart/hostgroup.phtml | 13 ++++++++----- .../views/scripts/chart/servicegroup.phtml | 12 +++++++----- public/css/icinga/widgets.less | 5 +++-- 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/modules/monitoring/application/controllers/ChartController.php b/modules/monitoring/application/controllers/ChartController.php index 8fda70909..305ff92bc 100644 --- a/modules/monitoring/application/controllers/ChartController.php +++ b/modules/monitoring/application/controllers/ChartController.php @@ -22,6 +22,11 @@ use Icinga\Chart\Unit\StaticAxis; class Monitoring_ChartController extends Controller { + public function init() + { + $this->view->compact = $this->_request->getParam('view') === 'compact'; + } + public function testAction() { $this->chart = new GridChart(); diff --git a/modules/monitoring/application/views/scripts/chart/hostgroup.phtml b/modules/monitoring/application/views/scripts/chart/hostgroup.phtml index b319d9a06..22a8a8c05 100644 --- a/modules/monitoring/application/views/scripts/chart/hostgroup.phtml +++ b/modules/monitoring/application/views/scripts/chart/hostgroup.phtml @@ -1,6 +1,9 @@ -
-render(); -?> -
+compact) { ?> +
+ render(); ?> + render() : ''; ?> +
+ + render(); ?> + diff --git a/modules/monitoring/application/views/scripts/chart/servicegroup.phtml b/modules/monitoring/application/views/scripts/chart/servicegroup.phtml index b319d9a06..f24efe5ba 100644 --- a/modules/monitoring/application/views/scripts/chart/servicegroup.phtml +++ b/modules/monitoring/application/views/scripts/chart/servicegroup.phtml @@ -1,6 +1,8 @@ -
-render(); -?> -
+compact) { ?> +
+ render(); ?> +
+ + render(); ?> + diff --git a/public/css/icinga/widgets.less b/public/css/icinga/widgets.less index 7ea480a73..a5c540a1e 100644 --- a/public/css/icinga/widgets.less +++ b/public/css/icinga/widgets.less @@ -175,6 +175,7 @@ ul.tree li a.error:hover { } /* charts should grow as much as possible but never beyond the current viewport's size */ -div.chart { - height: 90vh; +.svg-container-responsive { + padding: 1.5em; + height: 80vh; }