From be05d3a73ae55aaf26d03033946496e4b00895fd Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 15 Apr 2015 13:23:34 +0200 Subject: [PATCH 01/48] Fix dashboard header handling refs #7876 --- public/js/icinga/loader.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/public/js/icinga/loader.js b/public/js/icinga/loader.js index 1c674b947..e63125a4d 100644 --- a/public/js/icinga/loader.js +++ b/public/js/icinga/loader.js @@ -760,12 +760,8 @@ // $container.html(content); } else { - if ($container.closest('.dashboard').length - ) { - if (! $('h1', $content).length) { - var title = $('h1', $container).first().detach(); - $('h1', $content).first().detach(); - } + if ($container.closest('.dashboard').length) { + var title = $('h1', $container).first().detach(); $container.html(title).append(content); } else if (action === 'replace') { $container.html(content); From ed2de3c4d04886e5af21ba0f828da2bb4dc0d40c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 15 Apr 2015 14:20:36 +0200 Subject: [PATCH 02/48] Fix SortBox widget refs #7876 --- library/Icinga/Web/Controller.php | 8 +- library/Icinga/Web/StyleSheet.php | 3 +- library/Icinga/Web/Widget/SortBox.php | 127 +++++++++++--------------- public/css/icinga/controls.less | 18 ++++ 4 files changed, 78 insertions(+), 78 deletions(-) create mode 100644 public/css/icinga/controls.less diff --git a/library/Icinga/Web/Controller.php b/library/Icinga/Web/Controller.php index e7a1d51f5..da9486b9e 100644 --- a/library/Icinga/Web/Controller.php +++ b/library/Icinga/Web/Controller.php @@ -14,15 +14,15 @@ use Icinga\Web\Widget\SortBox; class Controller extends ModuleActionController { /** - * Create a sort control box at the 'sortControl' view parameter + * Create a SortBox widget at the `sortBox' view property * - * @param array $columns An array containing the sort columns, with the - * submit value as the key and the label as the value + * @param array $columns An array containing the sort columns, with the + * submit value as the key and the label as the value */ protected function setupSortControl(array $columns) { $req = $this->getRequest(); - $this->view->sortControl = SortBox::create( + $this->view->sortBox = SortBox::create( 'sortbox-' . $req->getActionName(), $columns )->applyRequest($req); diff --git a/library/Icinga/Web/StyleSheet.php b/library/Icinga/Web/StyleSheet.php index 3f1e2b2a7..ab36d78c5 100644 --- a/library/Icinga/Web/StyleSheet.php +++ b/library/Icinga/Web/StyleSheet.php @@ -26,7 +26,8 @@ class StyleSheet 'css/icinga/pagination.less', 'css/icinga/monitoring-colors.less', 'css/icinga/selection-toolbar.less', - 'css/icinga/login.less' + 'css/icinga/login.less', + 'css/icinga/controls.less' ); public static function compileForPdf() diff --git a/library/Icinga/Web/Widget/SortBox.php b/library/Icinga/Web/Widget/SortBox.php index be96b614e..fc2025e5b 100644 --- a/library/Icinga/Web/Widget/SortBox.php +++ b/library/Icinga/Web/Widget/SortBox.php @@ -3,64 +3,57 @@ namespace Icinga\Web\Widget; -use Zend_Form_Element_Submit; use Icinga\Web\Form; use Icinga\Web\Request; -use Icinga\Web\Form\Decorator\ConditionalHidden; /** - * Sortbox widget + * SortBox widget * - * The "SortBox" Widget allows you to create a generic sort input for sortable views. - * It automatically creates a form containing a select box with all sort options and a - * dropbox with the sort direction. It also handles automatic submission of sorting changes and draws an additional - * submit button when JavaScript is disabled. + * The "SortBox" Widget allows you to create a generic sort input for sortable views. It automatically creates a form + * containing a select box with all sort options and a dropbox with the sort direction. It also handles automatic + * submission of sorting changes and draws an additional submit button when JavaScript is disabled. * - * The constructor takes an string for the component name ad an array containing the select options, where the key is - * the value to be submitted and the value is the label that will be shown. You then should call applyRequest in order - * to make sure the form is correctly populated when a request with a sort parameter is being made. + * The constructor takes an string for the component name and an array containing the select options, where the key is + * the value to be submitted and the value is the label that will be shown. You then should call applyRequest in order + * to make sure the form is correctly populated when a request with a sort parameter is being made. * - * Example: - *

+ * Example:
+ *  

  *      $this->view->sortControl = new SortBox(
- *      $this->getRequest()->getActionName(),
+ *          $this->getRequest()->getActionName(),
  *          $columns
  *      );
  *      $this->view->sortControl->applyRequest($this->getRequest());
- *      
- * By default the sortBox uses the GET parameter 'sort' for the sorting key and 'dir' for the sorting direction - * + *
*/ class SortBox extends AbstractWidget { - /** * An array containing all sort columns with their associated labels * * @var array */ - private $sortFields; + protected $sortFields; /** * The name of the form that will be created * * @var string */ - private $name; + protected $name; /** * A request object used for initial form population * - * @var \Icinga\Web\Request + * @var Request */ - private $request; + protected $request; /** * Create a SortBox with the entries from $sortFields * - * @param string $name The name of the sort form - * @param array $sortFields An array containing the columns and their labels to be displayed - * in the sort select box + * @param string $name The name for the SortBox + * @param array $sortFields An array containing the columns and their labels to be displayed in the SortBox */ public function __construct($name, array $sortFields) { @@ -69,13 +62,12 @@ class SortBox extends AbstractWidget } /** - * Create a SortBox with the entries from $sortFields + * Create a SortBox * - * @param string $name The name of the sort form - * @param array $sortFields An array containing the columns and their labels to be displayed - * in the sort select box + * @param string $name The name for the SortBox + * @param array $sortFields An array containing the columns and their labels to be displayed in the SortBox * - * @return static + * @return SortBox */ public static function create($name, array $sortFields) { @@ -85,9 +77,9 @@ class SortBox extends AbstractWidget /** * Apply the parameters from the given request on this SortBox * - * @param Request $request The request to use for populating the form + * @param Request $request The request to use for populating the form * - * @return $this + * @return $this */ public function applyRequest($request) { @@ -96,60 +88,49 @@ class SortBox extends AbstractWidget } /** - * Create a submit button that is hidden via the ConditionalDecorator - * in order to allow sorting changes to be submitted in a JavaScript-less environment - * - * @return Zend_Form_Element_Submit The submit button that is hidden by default - * @see ConditionalDecorator - */ - private function createFallbackSubmitButton() - { - $manualSubmitButton = new Zend_Form_Element_Submit( - array( - 'name' => 'submit_' . $this->name, - 'label' => 'Sort', - 'class' => '', - 'condition' => 0, - 'value' => '{{SUBMIT_ICON}}' - ) - ); - $manualSubmitButton->addDecorator(new ConditionalHidden()); - $manualSubmitButton->setAttrib('addLabelPlaceholder', true); - return $manualSubmitButton; - } - - /** - * Renders this widget via the given view and returns the - * HTML as a string + * Render this SortBox as HTML * * @return string */ public function render() { $form = new Form(); - $form->setAttrib('class', 'inline'); - $form->setMethod('POST'); $form->setTokenDisabled(); $form->setName($this->name); - $form->addElement('select', 'sort', array( - 'label' => 'Sort By', - 'multiOptions' => $this->sortFields, - 'style' => 'width: 12em', - 'autosubmit' => true + $form->setAttrib('class', 'sort-control inline'); + + $form->addElement( + 'select', + 'sort', + array( + 'autosubmit' => true, + 'label' => $this->view()->translate('Sort by'), + 'multiOptions' => $this->sortFields + ) + ); + $form->getElement('sort')->setDecorators(array( + array('ViewHelper'), + array('Label') )); - $form->addElement('select', 'dir', array( - 'multiOptions' => array( - 'asc' => 'Asc', - 'desc' => 'Desc', - ), - 'style' => 'width: 5em', - 'autosubmit' => true - )); - $sort = $form->getElement('sort')->setDecorators(array('ViewHelper')); - $dir = $form->getElement('dir')->setDecorators(array('ViewHelper')); + $form->addElement( + 'select', + 'dir', + array( + 'autosubmit' => true, + 'multiOptions' => array( + 'asc' => 'Asc', + 'desc' => 'Desc', + ), + 'decorators' => array( + array('ViewHelper') + ) + ) + ); + if ($this->request) { $form->populate($this->request->getParams()); } + return $form; } } diff --git a/public/css/icinga/controls.less b/public/css/icinga/controls.less new file mode 100644 index 000000000..9445beb46 --- /dev/null +++ b/public/css/icinga/controls.less @@ -0,0 +1,18 @@ +/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ + +form.sort-control { + label { + width: auto; + margin-right: 0.5em; + } + + select[name=sort] { + width: 12em; + margin-left: 0; + } + + select[name=dir] { + width: 5em; + margin-left: 0; + } +} From 17262ae2bd46f75416c386dcd63280b7516a7c5a Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 15 Apr 2015 14:21:27 +0200 Subject: [PATCH 03/48] Make the sort control floating at the right by default refs #7876 --- public/css/icinga/controls.less | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/css/icinga/controls.less b/public/css/icinga/controls.less index 9445beb46..73e78b3e9 100644 --- a/public/css/icinga/controls.less +++ b/public/css/icinga/controls.less @@ -1,6 +1,8 @@ /*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ form.sort-control { + float: right; + label { width: auto; margin-right: 0.5em; From 5e92171ab7fd317531080687a6ec7efa3d3d1b0c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 15 Apr 2015 15:15:03 +0200 Subject: [PATCH 04/48] Drop the `inline' view property, as it's not used anywhere --- .../monitoring/application/controllers/ListController.php | 4 ---- .../application/views/scripts/alertsummary/index.phtml | 6 ++---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index b4167f83d..e1726a68d 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -22,10 +22,6 @@ class Monitoring_ListController extends Controller { $this->createTabs(); $this->view->compact = $this->_request->getParam('view') === 'compact'; - if ($this->_request->getParam('view') === 'inline') { - $this->view->compact = true; - $this->view->inline = true; - } } /** diff --git a/modules/monitoring/application/views/scripts/alertsummary/index.phtml b/modules/monitoring/application/views/scripts/alertsummary/index.phtml index dbfff6433..8bb36b518 100644 --- a/modules/monitoring/application/views/scripts/alertsummary/index.phtml +++ b/modules/monitoring/application/views/scripts/alertsummary/index.phtml @@ -59,8 +59,7 @@
partial('list/notifications.phtml', array( 'notifications' => $this->recentAlerts, - 'compact' => true, - 'inline' => true + 'compact' => true )); ?>
@@ -71,8 +70,7 @@
partial('list/notifications.phtml', array( 'notifications' => $this->notifications, - 'compact' => true, - 'inline' => true + 'compact' => true )); ?>
From 32e8b606b4384073fa9d3256d1c514376d35be53 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Wed, 15 Apr 2015 15:17:59 +0200 Subject: [PATCH 05/48] Monitoring\Controller: Drop `compactView' property, as it's not used anywere --- .../monitoring/library/Monitoring/Controller.php | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/modules/monitoring/library/Monitoring/Controller.php b/modules/monitoring/library/Monitoring/Controller.php index bf69182d7..c3cbe3c2d 100644 --- a/modules/monitoring/library/Monitoring/Controller.php +++ b/modules/monitoring/library/Monitoring/Controller.php @@ -21,16 +21,6 @@ class Controller extends IcingaWebController */ protected $backend; - /** - * Compact layout name - * - * Set to a string containing the compact layout name to use when - * 'compact' is set as the layout parameter, otherwise null - * - * @var string - */ - protected $compactView; - protected function moduleInit() { $this->backend = Backend::createBackend($this->_getParam('backend')); @@ -39,10 +29,6 @@ class Controller extends IcingaWebController protected function handleFormatRequest($query) { - if ($this->compactView !== null && ($this->_getParam('view', false) === 'compact')) { - $this->_helper->viewRenderer($this->compactView); - } - if ($this->_getParam('format') === 'sql') { echo '
'
                 . htmlspecialchars(wordwrap($query->dump()))

From 675d070b86808bb4ca6b520f2e5bae456875b7fc Mon Sep 17 00:00:00 2001
From: Johannes Meyer 
Date: Wed, 15 Apr 2015 15:33:00 +0200
Subject: [PATCH 06/48] Set the view property `compact' exactly once

refs #7876
---
 library/Icinga/Web/Controller/ActionController.php           | 1 +
 .../monitoring/application/controllers/ChartController.php   | 5 -----
 .../monitoring/application/controllers/ListController.php    | 1 -
 .../monitoring/application/controllers/ShowController.php    | 2 --
 .../monitoring/application/views/scripts/show/contact.phtml  | 5 ++++-
 5 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/library/Icinga/Web/Controller/ActionController.php b/library/Icinga/Web/Controller/ActionController.php
index 26e0e452a..b78090a7f 100644
--- a/library/Icinga/Web/Controller/ActionController.php
+++ b/library/Icinga/Web/Controller/ActionController.php
@@ -87,6 +87,7 @@ class ActionController extends Zend_Controller_Action
         $this->_helper->layout()->isIframe = $request->getUrl()->shift('isIframe');
         $this->_helper->layout()->moduleName = false;
 
+        $this->view->compact = $request->getParam('view') === 'compact';
         if ($this->rerenderLayout = $request->getUrl()->shift('renderLayout')) {
             $this->xhrLayout = 'body';
         }
diff --git a/modules/monitoring/application/controllers/ChartController.php b/modules/monitoring/application/controllers/ChartController.php
index 08f9334ee..39f60c304 100644
--- a/modules/monitoring/application/controllers/ChartController.php
+++ b/modules/monitoring/application/controllers/ChartController.php
@@ -16,11 +16,6 @@ use Icinga\Chart\Unit\LinearUnit;
 
 class Monitoring_ChartController extends Controller
 {
-    public function init()
-    {
-        $this->view->compact = $this->_request->getParam('view') === 'compact';
-    }
-
     private function drawLogChart1()
     {
         $chart = new GridChart();
diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php
index e1726a68d..ac1d41590 100644
--- a/modules/monitoring/application/controllers/ListController.php
+++ b/modules/monitoring/application/controllers/ListController.php
@@ -21,7 +21,6 @@ class Monitoring_ListController extends Controller
     public function init()
     {
         $this->createTabs();
-        $this->view->compact = $this->_request->getParam('view') === 'compact';
     }
 
     /**
diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php
index 0d7df501a..fe5633ab2 100644
--- a/modules/monitoring/application/controllers/ShowController.php
+++ b/modules/monitoring/application/controllers/ShowController.php
@@ -167,8 +167,6 @@ class Monitoring_ShowController extends Controller
             ));
 
             $notifications->where('contact_object_id', $contact->contact_object_id);
-
-            $this->view->compact = true;
             $this->view->notifications = $notifications->paginate();
         }
 
diff --git a/modules/monitoring/application/views/scripts/show/contact.phtml b/modules/monitoring/application/views/scripts/show/contact.phtml
index c4142707a..1ad5eccf9 100644
--- a/modules/monitoring/application/views/scripts/show/contact.phtml
+++ b/modules/monitoring/application/views/scripts/show/contact.phtml
@@ -57,7 +57,10 @@
 
 
 
-render('list/notifications.phtml') ?>
+partial('list/notifications.phtml', array(
+    'notifications' => $notifications,
+    'compact' => true
+)); ?>
 
 
translate('No notifications have been sent for this contact') ?>
From 6d0870ad2e8b75cff9b61e1af2dbc04375c22ce8 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 10:04:24 +0200 Subject: [PATCH 07/48] Adjust padding and margin of .content and .controls refs #7876 --- modules/monitoring/public/css/module.less | 3 +++ public/css/icinga/controls.less | 1 + public/css/icinga/layout-structure.less | 12 ++++++------ public/css/icinga/tabs.less | 4 ++-- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/modules/monitoring/public/css/module.less b/modules/monitoring/public/css/module.less index 050a8fb5b..f121bb66f 100644 --- a/modules/monitoring/public/css/module.less +++ b/modules/monitoring/public/css/module.less @@ -94,11 +94,14 @@ div.contacts div.notification-periods { div.tinystatesummary { .page-header(); font-size: 1em; + margin-bottom: 0.5em; + .badges { display: inline-block; margin-bottom: 4px; margin-left: 1em; } + .state > a { color: white; font-size: 0.8em; diff --git a/public/css/icinga/controls.less b/public/css/icinga/controls.less index 73e78b3e9..b8e82b795 100644 --- a/public/css/icinga/controls.less +++ b/public/css/icinga/controls.less @@ -1,6 +1,7 @@ /*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ form.sort-control { + .dontprint; float: right; label { diff --git a/public/css/icinga/layout-structure.less b/public/css/icinga/layout-structure.less index a1bf3682d..b10c6e6ed 100644 --- a/public/css/icinga/layout-structure.less +++ b/public/css/icinga/layout-structure.less @@ -119,12 +119,12 @@ html { .container .controls { top: 0; background-color: white; - padding: 0; + padding: 1em 1em 0; z-index: 100; } .container .fake-controls { - padding: 0; + padding: 1em 1em 0; } .container .controls .pagination { @@ -149,10 +149,6 @@ html { font-size: 0.9em; } -.container .controls > * { - margin-left: 1em; -} - .container .controls .pagination { margin-left: 1.2em; } @@ -161,6 +157,10 @@ html { padding: 1em; } +.controls + .fake-controls + .content { + padding-top: 0; +} + .dashboard .content { padding: 0; overflow: auto; diff --git a/public/css/icinga/tabs.less b/public/css/icinga/tabs.less index 8d391b038..6d35c5e20 100644 --- a/public/css/icinga/tabs.less +++ b/public/css/icinga/tabs.less @@ -1,12 +1,12 @@ /*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ ul.tabs { - padding: 1em 0 0 0; + padding: 0; list-style-type: inside; } .controls ul.tabs { - margin-left: 0em; + margin-left: -1em; margin-top: -3.54em; height: 2.6em; overflow: hidden; From b52b5071348f066c31cea3565e71b339defda25c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 10:05:48 +0200 Subject: [PATCH 08/48] FilterEditor: Fix css --- library/Icinga/Web/Widget/FilterEditor.php | 30 ++++++++++++---------- public/css/icinga/widgets.less | 22 +++++++++++----- 2 files changed, 32 insertions(+), 20 deletions(-) diff --git a/library/Icinga/Web/Widget/FilterEditor.php b/library/Icinga/Web/Widget/FilterEditor.php index ad9b1b5b2..7812cdf47 100644 --- a/library/Icinga/Web/Widget/FilterEditor.php +++ b/library/Icinga/Web/Widget/FilterEditor.php @@ -649,7 +649,7 @@ class FilterEditor extends AbstractWidget public function renderSearch() { - $html = '
' . $this->renderSearch() . $this->shorten($this->filter, 50) . ''; } - return $this->renderSearch() - . '' - . '
  • ' - . $this->renderFilter($this->filter) - . '
' - . '
' - . '' - . '' - . '
' - . '
'; + return '
' + . $this->renderSearch() + . '
' + . '
  • ' + . $this->renderFilter($this->filter) + . '
' + . '
' + . '' + . '' + . '
' + . '
' + . '
'; } protected function shorten($string, $length) diff --git a/public/css/icinga/widgets.less b/public/css/icinga/widgets.less index 45701a697..1993704b6 100644 --- a/public/css/icinga/widgets.less +++ b/public/css/icinga/widgets.less @@ -48,8 +48,22 @@ table.multiselect tr[href] td { -ms-user-select: none; } -#main form.filterEditor input[type=text], #main form.filterEditor select { - width: 12em; +#main div.filter { + margin-top: 1em; + + form.editor { + input[type=text], select { + width: 12em; + } + + ul.tree li.active { + background-color: #eee; + } + + div.buttons { + float: right; + } + } } ul.datafilter li { @@ -281,10 +295,6 @@ li li .badge { background-color: @colorUnknown; } -.widgetFilter li.active { - background-color: #eee; -} - .sparkline-box { position: relative; top: -3px; From 7735e5d31d0cf1e8fb70530502a4ee965b237954 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:07:18 +0200 Subject: [PATCH 09/48] Fix padding and margin of .content and .controls refs #7876 --- public/css/icinga/layout-structure.less | 4 ---- public/css/icinga/main-content.less | 6 ------ public/css/icinga/tabs.less | 1 + 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/public/css/icinga/layout-structure.less b/public/css/icinga/layout-structure.less index b10c6e6ed..23a598b52 100644 --- a/public/css/icinga/layout-structure.less +++ b/public/css/icinga/layout-structure.less @@ -157,10 +157,6 @@ html { padding: 1em; } -.controls + .fake-controls + .content { - padding-top: 0; -} - .dashboard .content { padding: 0; overflow: auto; diff --git a/public/css/icinga/main-content.less b/public/css/icinga/main-content.less index 32054e242..b442723cb 100644 --- a/public/css/icinga/main-content.less +++ b/public/css/icinga/main-content.less @@ -118,7 +118,6 @@ table.avp a:hover { /* Definitively monitoring-only: */ table.objectstate { - margin: 1em; border-collapse: separate; border-spacing: 1px; } @@ -194,11 +193,6 @@ table.benchmark { color: inherit; } -/* controls have no padding as of tabs */ -.controls > h1 { - margin-right: 1em; -} - [class^="icon-"]:before, [class*=" icon-"]:before { text-decoration: none; } diff --git a/public/css/icinga/tabs.less b/public/css/icinga/tabs.less index 6d35c5e20..2c02bfb94 100644 --- a/public/css/icinga/tabs.less +++ b/public/css/icinga/tabs.less @@ -7,6 +7,7 @@ ul.tabs { .controls ul.tabs { margin-left: -1em; + margin-right: -1em; margin-top: -3.54em; height: 2.6em; overflow: hidden; From 2bd31ee39509c99458860fe1b8b72fa5ef01227f Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:08:41 +0200 Subject: [PATCH 10/48] Icinga\Web\Controller: Add helper functions to create control widgets refs #7876 --- library/Icinga/Web/Controller.php | 72 ++++++++++++++++++++++++++++--- 1 file changed, 67 insertions(+), 5 deletions(-) diff --git a/library/Icinga/Web/Controller.php b/library/Icinga/Web/Controller.php index da9486b9e..42bd94b5e 100644 --- a/library/Icinga/Web/Controller.php +++ b/library/Icinga/Web/Controller.php @@ -3,8 +3,10 @@ namespace Icinga\Web; +use Zend_Paginator; use Icinga\Web\Controller\ModuleActionController; use Icinga\Web\Widget\SortBox; +use Icinga\Web\Widget\Limiter; /** * This is the controller all modules should inherit from @@ -16,15 +18,75 @@ class Controller extends ModuleActionController /** * Create a SortBox widget at the `sortBox' view property * + * In case the current view has been requested as compact this method does nothing. + * * @param array $columns An array containing the sort columns, with the * submit value as the key and the label as the value + * + * @return $this */ protected function setupSortControl(array $columns) { - $req = $this->getRequest(); - $this->view->sortBox = SortBox::create( - 'sortbox-' . $req->getActionName(), - $columns - )->applyRequest($req); + if (! $this->view->compact) { + $req = $this->getRequest(); + $this->view->sortBox = SortBox::create( + 'sortbox-' . $req->getActionName(), + $columns + )->applyRequest($req); + } + + return $this; + } + + /** + * Create a Limiter widget at the `limiter' view property + * + * In case the current view has been requested as compact this method does nothing. + * + * @return $this + */ + protected function setupLimitControl() + { + if (! $this->view->compact) { + $this->view->limiter = new Limiter(); + } + + return $this; + } + + /** + * Set the view property `paginator' to the given Zend_Paginator + * + * In case the current view has been requested as compact this method does nothing. + * + * @param Zend_Paginator $paginator The Zend_Paginator for which to show a pagination control + * + * @return $this + */ + protected function setupPaginationControl(Zend_Paginator $paginator) + { + if (! $this->view->compact) { + $this->view->paginator = $paginator; + } + + return $this; + } + + /** + * Set the view property `filterEditor' to the given FilterEditor + * + * In case the current view has been requested as compact this method does nothing. + * + * @param Form $editor The FilterEditor + * + * @return $this + */ + protected function setupFilterControl($editor) + { + if (! $this->view->compact) { + $this->view->filterEditor = $editor; + } + + return $this; } } From d5cc340439fba9008df8e4aaae82581d8c1596a8 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:09:17 +0200 Subject: [PATCH 11/48] ApplicationLog: Ensure dashboard compliance refs #7876 --- application/controllers/ListController.php | 3 +++ application/views/scripts/list/applicationlog.phtml | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/application/controllers/ListController.php b/application/controllers/ListController.php index feaf13921..985c53512 100644 --- a/application/controllers/ListController.php +++ b/application/controllers/ListController.php @@ -52,5 +52,8 @@ class ListController extends Controller 'fields' => $pattern ))); $this->view->logData = $resource->select()->order('DESC')->paginate(); + + $this->setupLimitControl(); + $this->setupPaginationControl($this->view->logData); } } diff --git a/application/views/scripts/list/applicationlog.phtml b/application/views/scripts/list/applicationlog.phtml index 583fde516..cc412eb9c 100644 --- a/application/views/scripts/list/applicationlog.phtml +++ b/application/views/scripts/list/applicationlog.phtml @@ -1,9 +1,12 @@ +compact): ?>
- tabs->render($this) ?> -
- logData ?> + tabs; ?> + sortBox; ?> + limiter; ?> + paginator; ?> + filterEditor; ?>
- +
logData !== null): ?> From 57d519bca8a96a29e2c2265a5ebdf86f3855ae6d Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:09:35 +0200 Subject: [PATCH 12/48] ModuleOverview: Ensure dashboard compliance refs #7876 --- application/controllers/ConfigController.php | 12 ++++++++++-- application/views/scripts/config/modules.phtml | 10 +++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/application/controllers/ConfigController.php b/application/controllers/ConfigController.php index 491a33ef3..370b8f5d0 100644 --- a/application/controllers/ConfigController.php +++ b/application/controllers/ConfigController.php @@ -11,14 +11,14 @@ use Icinga\Forms\Config\GeneralConfigForm; use Icinga\Forms\Config\ResourceConfigForm; use Icinga\Forms\ConfirmRemovalForm; use Icinga\Security\SecurityException; -use Icinga\Web\Controller\ActionController; +use Icinga\Web\Controller; use Icinga\Web\Notification; use Icinga\Web\Widget; /** * Application and module configuration */ -class ConfigController extends ActionController +class ConfigController extends Controller { /** * The first allowed config action according to the user's permissions @@ -130,6 +130,14 @@ class ConfigController extends ActionController ->order('enabled', 'desc') ->order('name') ->paginate(); + $this->setupLimitControl(); + $this->setupPaginationControl($this->view->modules); + // TODO: Not working + /*$this->setupSortControl(array( + 'name' => $this->translate('Modulename'), + 'path' => $this->translate('Installation Path'), + 'enabled' => $this->translate('State') + ));*/ } public function moduleAction() diff --git a/application/views/scripts/config/modules.phtml b/application/views/scripts/config/modules.phtml index 9121de405..2abf16fc6 100644 --- a/application/views/scripts/config/modules.phtml +++ b/application/views/scripts/config/modules.phtml @@ -1,8 +1,12 @@ +compact): ?>
-tabs ?> -paginationControl($modules) ?> + tabs; ?> + sortBox; ?> + limiter; ?> + paginator; ?> + filterEditor; ?>
- +
From 5f4a61f36e4e5dc3da7298a68dc03d008773146a Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:09:50 +0200 Subject: [PATCH 13/48] Alertsummary: Ensure dashboard compliance refs #7876 --- .../controllers/AlertsummaryController.php | 4 +++- .../views/scripts/alertsummary/index.phtml | 11 ++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/monitoring/application/controllers/AlertsummaryController.php b/modules/monitoring/application/controllers/AlertsummaryController.php index 0d3917e90..aea8def93 100644 --- a/modules/monitoring/application/controllers/AlertsummaryController.php +++ b/modules/monitoring/application/controllers/AlertsummaryController.php @@ -69,8 +69,10 @@ class Monitoring_AlertsummaryController extends Controller 'notification_state' ) ); - $this->view->notifications = $query->paginate(); + + $this->setupLimitControl(); + $this->setupPaginationControl($this->view->notifications); } /** diff --git a/modules/monitoring/application/views/scripts/alertsummary/index.phtml b/modules/monitoring/application/views/scripts/alertsummary/index.phtml index 8bb36b518..d96ca5bdc 100644 --- a/modules/monitoring/application/views/scripts/alertsummary/index.phtml +++ b/modules/monitoring/application/views/scripts/alertsummary/index.phtml @@ -1,12 +1,13 @@ +compact): ?>
- tabs ?> -
+ tabs; ?> +
- widget('limiter') ?> - paginationControl($notifications, null, null, array('preserve' => $this->preserve)) ?> + limiter; ?> + paginator; ?>
- +
From 93889442834a464085fe3e7a36a7978ed9cf57c7 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:10:21 +0200 Subject: [PATCH 14/48] show/history: Ensure dashboard compliance refs #7876 --- .../controllers/ShowController.php | 3 ++ .../views/scripts/show/history.phtml | 30 +++++++++++-------- 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index fe5633ab2..bf8c5298d 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -73,6 +73,9 @@ class Monitoring_ShowController extends Controller $this->view->history = $this->view->object->eventhistory->getQuery()->paginate($this->params->get('limit', 50)); $this->handleFormatRequest($this->view->object->eventhistory); $this->fetchHostStats(); + + $this->setupLimitControl(); + $this->setupPaginationControl($this->view->history); } public function servicesAction() diff --git a/modules/monitoring/application/views/scripts/show/history.phtml b/modules/monitoring/application/views/scripts/show/history.phtml index d82f454f6..d2fd1a383 100644 --- a/modules/monitoring/application/views/scripts/show/history.phtml +++ b/modules/monitoring/application/views/scripts/show/history.phtml @@ -1,29 +1,33 @@ getType() === 'host'; -?> - +if (! $this->compact): ?>
- + tabs; ?> + render('partials/host/object-header.phtml'); ?> - + render('partials/service/object-header.phtml'); ?> - +

translate('This Object\'s Event History'); ?>

- widget('limiter', array('url' => $url, 'max' => $history->count())); ?> - paginationControl($history, null, null, array('preserve' => $this->preserve)); ?> + sortBox; ?> + limiter; ?> + paginator; ?> + filterEditor; ?>
- +
- - translate('No history available for this object'); ?> -
- +translate('No history available for this object') . '
'; + return; +} +?> Date: Fri, 17 Apr 2015 16:10:49 +0200 Subject: [PATCH 15/48] show/contact: Ensure dashboard compliance refs #7876 --- .../monitoring/application/controllers/ShowController.php | 4 ++-- .../monitoring/application/views/scripts/show/contact.phtml | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/modules/monitoring/application/controllers/ShowController.php b/modules/monitoring/application/controllers/ShowController.php index bf8c5298d..968512c26 100644 --- a/modules/monitoring/application/controllers/ShowController.php +++ b/modules/monitoring/application/controllers/ShowController.php @@ -145,9 +145,7 @@ class Monitoring_ShowController extends Controller 'contact_notify_host_flapping', 'contact_notify_host_downtime', )); - $query->where('contact_name', $contactName); - $contact = $query->getQuery()->fetchRow(); if ($contact) { @@ -171,6 +169,8 @@ class Monitoring_ShowController extends Controller $notifications->where('contact_object_id', $contact->contact_object_id); $this->view->notifications = $notifications->paginate(); + $this->setupLimitControl(); + $this->setupPaginationControl($this->view->notifications); } $this->view->contact = $contact; diff --git a/modules/monitoring/application/views/scripts/show/contact.phtml b/modules/monitoring/application/views/scripts/show/contact.phtml index 1ad5eccf9..027301c88 100644 --- a/modules/monitoring/application/views/scripts/show/contact.phtml +++ b/modules/monitoring/application/views/scripts/show/contact.phtml @@ -1,6 +1,8 @@ getHelper('ContactFlags') ?>
- tabs ?> + compact): ?> + tabs; ?> +

translate('Contact details') ?>

- tabs ?> -
+ tabs; ?> +
@@ -21,6 +20,8 @@ $firstRow = !$beingExtended;
+ +
From 74cf3cf3753dc8be236597d623283fb780f226ec Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:12:35 +0200 Subject: [PATCH 17/48] list/hosts: Ensure dashboard compliance refs #7876 --- .../controllers/ListController.php | 20 +++++------ .../views/scripts/list/hosts.phtml | 34 +++++++------------ 2 files changed, 23 insertions(+), 31 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index ac1d41590..a1e22d442 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -117,18 +117,8 @@ class Monitoring_ListController extends Controller 'host_current_check_attempt', 'host_max_check_attempts' ), $this->extraColumns())); - $this->filterQuery($query); - $this->applyRestriction('monitoring/hosts/filter', $query); - - $this->setupSortControl(array( - 'host_severity' => $this->translate('Severity'), - 'host_state' => $this->translate('Current State'), - 'host_display_name' => $this->translate('Hostname'), - 'host_address' => $this->translate('Address'), - 'host_last_check' => $this->translate('Last Check') - )); $this->view->hosts = $query->paginate(); $this->view->stats = $this->backend->select()->from('statusSummary', array( @@ -142,6 +132,16 @@ class Monitoring_ListController extends Controller 'hosts_unreachable_unhandled', 'hosts_pending', ))->getQuery()->fetchRow(); + + $this->setupLimitControl(); + $this->setupPaginationControl($this->view->hosts); + $this->setupSortControl(array( + 'host_severity' => $this->translate('Severity'), + 'host_state' => $this->translate('Current State'), + 'host_display_name' => $this->translate('Hostname'), + 'host_address' => $this->translate('Address'), + 'host_last_check' => $this->translate('Last Check') + )); } /** diff --git a/modules/monitoring/application/views/scripts/list/hosts.phtml b/modules/monitoring/application/views/scripts/list/hosts.phtml index a7511fcd8..3efb70320 100644 --- a/modules/monitoring/application/views/scripts/list/hosts.phtml +++ b/modules/monitoring/application/views/scripts/list/hosts.phtml @@ -1,33 +1,25 @@ compact): ?> -
- +if (! $this->compact): ?>
- tabs ?> -
- render('list/components/selectioninfo.phtml') ?> - render('list/components/hostssummary.phtml') ?> - translate('Sort by') ?> sortControl->render($this) ?> + tabs; ?> +
+ render('list/components/selectioninfo.phtml'); ?> + render('list/components/hostssummary.phtml'); ?>
- -widget('limiter')->setMaxLimit($this->hosts->count()) ?> -paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?> -selectionToolbar('multi', $this->href('monitoring/hosts/show?' . $this->filter->toQueryString())) ?> + sortBox; ?> + limiter; ?> + paginator; ?> + selectionToolbar('multi', $this->href('monitoring/hosts/show?' . $this->filter->toQueryString())); ?> + filterEditor; ?>
- +
-filterEditor ?> count() === 0) { - echo $this->translate('No hosts matching the filter'); - if (! $this->compact) { - echo '
'; - } +if (count($hosts) === 0) { + echo $this->translate('No hosts found matching the filter') . '
'; return; } ?> From 29648191e4be272138b7b73a77a14c721fca18a4 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:12:56 +0200 Subject: [PATCH 18/48] list/services: Ensure dashboard compliance refs #7876 --- .../controllers/ListController.php | 14 ++----- .../views/scripts/list/services.phtml | 42 ++++++++----------- 2 files changed, 20 insertions(+), 36 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index a1e22d442..e69c9034f 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -205,11 +205,12 @@ class Monitoring_ListController extends Controller 'max_check_attempts' => 'service_max_check_attempts' ), $this->extraColumns()); $query = $this->backend->select()->from('serviceStatus', $columns); - $this->filterQuery($query); - $this->applyRestriction('monitoring/services/filter', $query); + $this->view->services = $query->paginate(); + $this->setupLimitControl(); + $this->setupPaginationControl($this->view->services); $this->setupSortControl(array( 'service_severity' => $this->translate('Service Severity'), 'service_state' => $this->translate('Current Service State'), @@ -221,14 +222,6 @@ class Monitoring_ListController extends Controller 'host_address' => $this->translate('Host Address'), 'host_last_check' => $this->translate('Last Host Check') )); - $limit = $this->params->get('limit'); - $this->view->limit = $limit; - if ($limit === 0) { - $this->view->services = $query->getQuery()->fetchAll(); - } else { - // TODO: Workaround, paginate should be able to fetch limit from new params - $this->view->services = $query->paginate($this->params->get('limit')); - } $this->view->stats = $this->backend->select()->from('statusSummary', array( 'services_total', @@ -247,7 +240,6 @@ class Monitoring_ListController extends Controller 'services_unknown_handled', 'services_pending', ))->getQuery()->fetchRow(); - } /** diff --git a/modules/monitoring/application/views/scripts/list/services.phtml b/modules/monitoring/application/views/scripts/list/services.phtml index 3f1437dae..7473f7f25 100644 --- a/modules/monitoring/application/views/scripts/list/services.phtml +++ b/modules/monitoring/application/views/scripts/list/services.phtml @@ -4,41 +4,33 @@ use Icinga\Module\Monitoring\Object\Service; $selfUrl = 'monitoring/list/services'; -if (!$this->compact): ?> +if (! $this->compact): ?>
-tabs ?> -
-render('list/components/selectioninfo.phtml') ?> -render('list/components/servicesummary.phtml') ?> -
-translate('Sort by') ?> sortControl ?> + tabs; ?> +
+ render('list/components/selectioninfo.phtml'); ?> + render('list/components/servicesummary.phtml'); ?> +
+ sortBox; ?> + limiter; ?> + paginator; ?> + filterEditor; ?>
-
-limit === 0): ?> -widget('limiter') ?> - -widget('limiter')->setCurrentPageCount($this->services->count()) ?> -paginationControl($services, null, null, array('preserve' => $this->preserve)) ?> -
-
-filterEditor ?> - + - +if (count($services) === 0) { + echo $this->translate('No services found matching the filter') . '
'; + return; +} +?>
" data-icinga-multiselect-data="service_description,host_name"> -href( 'monitoring/service/show', array( From 5f19ec1b2e5d02325268da114ca903f5d140bf80 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:13:22 +0200 Subject: [PATCH 19/48] list/downtimes: Ensure dashboard compliance refs #7876 --- .../controllers/ListController.php | 8 +++-- .../views/scripts/list/downtimes.phtml | 32 ++++++++----------- 2 files changed, 18 insertions(+), 22 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index e69c9034f..f1f758e9c 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -250,8 +250,10 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } + $this->addTitleTab('downtimes', $this->translate('Downtimes'), $this->translate('List downtimes')); $this->setAutorefreshInterval(12); + $query = $this->backend->select()->from('downtime', array( 'id' => 'downtime_internal_id', 'objecttype' => 'downtime_objecttype', @@ -273,9 +275,11 @@ class Monitoring_ListController extends Controller 'host_display_name', 'service_display_name' )); - $this->filterQuery($query); + $this->view->downtimes = $query->paginate(); + $this->setupLimitControl(); + $this->setupPaginationControl($this->view->downtimes); $this->setupSortControl(array( 'downtime_is_in_effect' => $this->translate('Is In Effect'), 'host_display_name' => $this->translate('Host'), @@ -289,8 +293,6 @@ class Monitoring_ListController extends Controller 'downtime_duration' => $this->translate('Duration') )); - $this->view->downtimes = $query->paginate(); - if ($this->Auth()->hasPermission('monitoring/command/downtime/delete')) { $this->view->delDowntimeForm = new DeleteDowntimeCommandForm(); } diff --git a/modules/monitoring/application/views/scripts/list/downtimes.phtml b/modules/monitoring/application/views/scripts/list/downtimes.phtml index 2387e9487..b279d4063 100644 --- a/modules/monitoring/application/views/scripts/list/downtimes.phtml +++ b/modules/monitoring/application/views/scripts/list/downtimes.phtml @@ -1,30 +1,24 @@ - -compact): ?> +if (! $this->compact): ?>
- tabs->render($this); ?> -
- translate('Sort by'); ?> sortControl->render($this); ?> - filterEditor): ?> - filterPreview ?> - -
- widget('limiter', array('url' => $this->url, 'max' => $downtimes->count())); ?> - paginationControl($downtimes, null, null, array('preserve' => $this->preserve)); ?> + tabs; ?> + sortBox; ?> + limiter; ?> + paginator; ?> + filterEditor; ?>
-
-filterEditor ?> - - translate('No active downtimes'); ?> -
- +translate('No downtimes found matching the filter') . ''; + return; +} +?>
From a09e41e3b8fbe2249e739d01cc3961aa5a531d47 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:13:36 +0200 Subject: [PATCH 20/48] list/notifications: Ensure dashboard compliance refs #7876 --- .../controllers/ListController.php | 5 ++++ .../views/scripts/list/notifications.phtml | 26 +++++++++---------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index f1f758e9c..b040da72d 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -306,12 +306,14 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } + $this->addTitleTab( 'notifications', $this->translate('Notifications'), $this->translate('List notifications') ); $this->setAutorefreshInterval(15); + $query = $this->backend->select()->from('notification', array( 'host_name', 'service_description', @@ -324,6 +326,9 @@ class Monitoring_ListController extends Controller )); $this->filterQuery($query); $this->view->notifications = $query->paginate(); + + $this->setupLimitControl(); + $this->setupPaginationControl($this->view->notifications); $this->setupSortControl(array( 'notification_start_time' => $this->translate('Notification Start') )); diff --git a/modules/monitoring/application/views/scripts/list/notifications.phtml b/modules/monitoring/application/views/scripts/list/notifications.phtml index 9a3b424b4..c49f5fc3f 100644 --- a/modules/monitoring/application/views/scripts/list/notifications.phtml +++ b/modules/monitoring/application/views/scripts/list/notifications.phtml @@ -1,26 +1,24 @@ - -compact): ?> +if (! $this->compact): ?>
- tabs ?> -
- translate('Sort by') ?> sortControl->render($this) ?> -
- widget('limiter') ?> - paginationControl($notifications, null, null, array('preserve' => $this->preserve)) ?> + tabs; ?> + sortBox; ?> + limiter; ?> + paginator; ?> + filterEditor; ?>
-
- - translate('No notifications matching the filter') ?> - +translate('No notifications found matching the filter') . '
'; + return; +} +?>
Date: Fri, 17 Apr 2015 16:13:56 +0200 Subject: [PATCH 21/48] list/contacts: Ensure dashboard compliance refs #7876 --- .../controllers/ListController.php | 4 +++ .../views/scripts/list/contacts.phtml | 27 ++++++++++--------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index b040da72d..8a09ef213 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -339,7 +339,9 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } + $this->addTitleTab('contacts', $this->translate('Contacts'), $this->translate('List contacts')); + $query = $this->backend->select()->from('contact', array( 'contact_name', 'contact_id', @@ -363,6 +365,8 @@ class Monitoring_ListController extends Controller $this->filterQuery($query); $this->view->contacts = $query->paginate(); + $this->setupLimitControl(); + $this->setupPaginationControl($this->view->contacts); $this->setupSortControl(array( 'contact_name' => $this->translate('Name'), 'contact_alias' => $this->translate('Alias'), diff --git a/modules/monitoring/application/views/scripts/list/contacts.phtml b/modules/monitoring/application/views/scripts/list/contacts.phtml index 80405f7c6..78910cead 100644 --- a/modules/monitoring/application/views/scripts/list/contacts.phtml +++ b/modules/monitoring/application/views/scripts/list/contacts.phtml @@ -1,18 +1,21 @@ +compact): ?>
- tabs ?> -
- sortControl->render($this); ?> -
- paginationControl($contacts, null, null, array('preserve' => $this->preserve)); ?> + tabs; ?> + sortBox; ?> + limiter; ?> + paginator; ?> + filterEditor; ?>
- +
- translate('No contacts matching the filter'); - return; - } - foreach ($contacts as $contact): ?> +translate('No contacts found matching the filter') . '
'; + return; +} +?> +
img('/static/gravatar', array('email' => $contact->contact_email)); ?> qlink( From b9249dac4e3de98b4c04cbd6f973b28461ab4044 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:14:13 +0200 Subject: [PATCH 22/48] list/contactgroups: Ensure dashboard compliance refs #7876 --- .../controllers/ListController.php | 9 +++++++- .../views/scripts/list/contactgroups.phtml | 21 ++++++++++++------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 8a09ef213..3e6abce48 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -424,11 +424,13 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } + $this->addTitleTab( 'contactgroups', $this->translate('Contact Groups'), $this->translate('List contact groups') ); + $query = $this->backend->select()->from('contactgroup', array( 'contactgroup_name', 'contactgroup_alias', @@ -436,7 +438,7 @@ class Monitoring_ListController extends Controller 'contact_alias', 'contact_email', 'contact_pager', - ))->order('contactgroup_alias'); + )); $this->filterQuery($query); // Fetch and prepare all contact groups: @@ -453,6 +455,11 @@ class Monitoring_ListController extends Controller } // TODO: Find a better naming $this->view->groupData = $groupData; + + $this->setupSortControl(array( + 'contactgroup_name' => $this->translate('Contactgroup Name'), + 'contactgroup_alias' => $this->translate('Contactgroup Alias') + )); } public function commentsAction() diff --git a/modules/monitoring/application/views/scripts/list/contactgroups.phtml b/modules/monitoring/application/views/scripts/list/contactgroups.phtml index 09083a387..5e3b038a7 100644 --- a/modules/monitoring/application/views/scripts/list/contactgroups.phtml +++ b/modules/monitoring/application/views/scripts/list/contactgroups.phtml @@ -1,17 +1,22 @@ -compact): ?> +compact): ?>
- tabs ?> + tabs; ?> + sortBox; ?> + limiter; ?> + paginator; ?> + filterEditor; ?>
-
- $groupInfo): ?> +if (count($groupData) === 0) { + echo $this->translate('No contactgroups found matching the filter') . '
'; + return; +} +?> +
+ $groupInfo): ?>

From 2190e553be82f60005aa855e354f7903d2767012 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:14:29 +0200 Subject: [PATCH 23/48] list/comments: Ensure dashboard compliance refs #7876 --- .../controllers/ListController.php | 4 ++++ .../views/scripts/list/comments.phtml | 24 +++++++++---------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 3e6abce48..61fb84956 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -467,8 +467,10 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } + $this->addTitleTab('comments', $this->translate('Comments'), $this->translate('List comments')); $this->setAutorefreshInterval(12); + $query = $this->backend->select()->from('comment', array( 'id' => 'comment_internal_id', 'objecttype' => 'comment_objecttype', @@ -486,6 +488,8 @@ class Monitoring_ListController extends Controller $this->filterQuery($query); $this->view->comments = $query->paginate(); + $this->setupLimitControl(); + $this->setupPaginationControl($this->view->comments); $this->setupSortControl( array( 'comment_timestamp' => $this->translate('Comment Timestamp'), diff --git a/modules/monitoring/application/views/scripts/list/comments.phtml b/modules/monitoring/application/views/scripts/list/comments.phtml index cdbe28244..ee752b037 100644 --- a/modules/monitoring/application/views/scripts/list/comments.phtml +++ b/modules/monitoring/application/views/scripts/list/comments.phtml @@ -1,20 +1,20 @@ -compact): ?> +compact): ?>
- tabs->render($this); ?> -
- translate('Sort by'); ?> sortControl->render($this); ?> -
- widget('limiter', array('url' => $this->url, 'max' => $comments->count())); ?> - paginationControl($comments, null, null, array('preserve' => $this->preserve)); ?> + tabs; ?> + sortBox; ?> + limiter; ?> + paginator; ?> + filterEditor; ?>
-
- - translate('No comments matching the filter'); ?> -
- +translate('No comments found matching the filter') . '
'; + return; +} +?>
From 7ae7bf38c47617c24252a31c4c541a22a5910249 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:14:46 +0200 Subject: [PATCH 24/48] list/servicegroups: Ensure dashboard compliance refs #7876 --- .../controllers/ListController.php | 5 +++ .../views/scripts/list/servicegroups.phtml | 32 ++++++++----------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 61fb84956..def41fb57 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -510,12 +510,14 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } + $this->addTitleTab( 'servicegroups', $this->translate('Service Groups'), $this->translate('List service groups') ); $this->setAutorefreshInterval(12); + $query = $this->backend->select()->from('groupsummary', array( 'servicegroup_name', 'servicegroup_alias', @@ -547,6 +549,9 @@ class Monitoring_ListController extends Controller // service groups. We should separate them. $this->filterQuery($query); $this->view->servicegroups = $query->paginate(); + + $this->setupLimitControl(); + $this->setupPaginationControl($this->view->servicegroups); $this->setupSortControl(array( 'services_severity' => $this->translate('Severity'), 'servicegroup_alias' => $this->translate('Service Group Name'), diff --git a/modules/monitoring/application/views/scripts/list/servicegroups.phtml b/modules/monitoring/application/views/scripts/list/servicegroups.phtml index 9ef23a95a..9fb8d0e08 100644 --- a/modules/monitoring/application/views/scripts/list/servicegroups.phtml +++ b/modules/monitoring/application/views/scripts/list/servicegroups.phtml @@ -1,24 +1,20 @@ -compact): ?> -
- +compact): ?>
- tabs ?> -
- translate('Sort by'); ?> sortControl->render($this); ?> -
- widget('limiter')->setMaxLimit(count($servicegroups)); ?> - paginationControl($servicegroups, null, null, array('preserve' => $this->preserve)); ?> -
-
+ tabs; ?> + sortBox; ?> + limiter; ?> + paginator; ?> filterEditor; ?> +
- translate('No service groups matching the filter'); - echo '
'; - return; - } - ?> +
+translate('No servicegroups found matching the filter') . '
'; + return; +} +?>
From faa29e3dee6e93a5ed8d0142f75040d9d6055a0b Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:14:59 +0200 Subject: [PATCH 25/48] list/hostgroups: Ensure dashboard compliance refs #7876 --- .../controllers/ListController.php | 5 +++ .../views/scripts/list/hostgroups.phtml | 32 ++++++++----------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index def41fb57..f655f7192 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -569,8 +569,10 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } + $this->addTitleTab('hostgroups', $this->translate('Host Groups'), $this->translate('List host groups')); $this->setAutorefreshInterval(12); + $query = $this->backend->select()->from('groupsummary', array( 'hostgroup_name', 'hostgroup_alias', @@ -602,6 +604,9 @@ class Monitoring_ListController extends Controller // service groups. We should separate them. $this->filterQuery($query); $this->view->hostgroups = $query->paginate(); + + $this->setupLimitControl(); + $this->setupPaginationControl($this->view->hostgroups); $this->setupSortControl(array( 'services_severity' => $this->translate('Severity'), 'hostgroup_alias' => $this->translate('Host Group Name'), diff --git a/modules/monitoring/application/views/scripts/list/hostgroups.phtml b/modules/monitoring/application/views/scripts/list/hostgroups.phtml index 1e3eb29ac..ef8cd78ea 100644 --- a/modules/monitoring/application/views/scripts/list/hostgroups.phtml +++ b/modules/monitoring/application/views/scripts/list/hostgroups.phtml @@ -1,24 +1,20 @@ -compact): ?> -
- +compact): ?>
- tabs ?> -
- translate('Sort by'); ?> sortControl->render($this); ?> -
- widget('limiter')->setMaxLimit(count($hostgroups)); ?> - paginationControl($hostgroups, null, null, array('preserve' => $this->preserve)); ?> -
-
+ tabs; ?> + sortBox; ?> + limiter; ?> + paginator; ?> filterEditor; ?> +
- translate('No host groups matching the filter'); - echo '
'; - return; - } - ?> +
+translate('No hostgroups found matching the filter') . '
'; + return; +} +?>
translate('Last Problem'); ?>
From 7be00791a79eabd76465f3ee4d09c68c3a6f44d5 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:15:58 +0200 Subject: [PATCH 26/48] list/eventhistory: Ensure dashboard compliance refs #7876 --- .../controllers/ListController.php | 5 ++- .../views/scripts/list/eventhistory.phtml | 33 +++++++------------ 2 files changed, 16 insertions(+), 22 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index f655f7192..a6c38c2e1 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -624,6 +624,7 @@ class Monitoring_ListController extends Controller if ($url = $this->hasBetterUrl()) { return $this->redirectNow($url); } + $this->addTitleTab( 'eventhistory', $this->translate('Event Overview'), @@ -645,11 +646,13 @@ class Monitoring_ListController extends Controller )); $this->filterQuery($query); + $this->view->history = $query->paginate(); + $this->setupLimitControl(); + $this->setupPaginationControl($this->view->history); $this->setupSortControl(array( 'timestamp' => $this->translate('Occurence') )); - $this->view->history = $query->paginate(); } public function servicegridAction() diff --git a/modules/monitoring/application/views/scripts/list/eventhistory.phtml b/modules/monitoring/application/views/scripts/list/eventhistory.phtml index b76b5a796..9ab581d59 100644 --- a/modules/monitoring/application/views/scripts/list/eventhistory.phtml +++ b/modules/monitoring/application/views/scripts/list/eventhistory.phtml @@ -1,32 +1,23 @@ - -compact): ?> +if (! $this->compact): ?>
- tabs ?> -
-
- translate('Sort by') ?> sortControl ?> -
-
- - widget('limiter', array('url' => $this->url, 'max' => $this->history->count())); ?> - paginationControl($history, null, null, array('preserve' => $this->preserve)); ?> - + tabs; ?> + sortBox; ?> + limiter; ?> + paginator; ?> + filterEditor; ?>
-
-filterEditor ?> - - translate('No history events matching the filter') ?> -
- - +translate('No history events found matching the filter') . ''; + return; +} +?>
translate('Last Problem'); ?>
From 58b93101c70af2b2c1dc95a230b4584320dca322 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:18:56 +0200 Subject: [PATCH 27/48] multiselect views: Ensure dashboard compliance refs #7876 --- .../monitoring/application/views/scripts/hosts/show.phtml | 5 ++++- .../views/scripts/partials/host/objects-header.phtml | 3 --- .../views/scripts/partials/service/objects-header.phtml | 3 --- .../monitoring/application/views/scripts/services/show.phtml | 5 ++++- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/monitoring/application/views/scripts/hosts/show.phtml b/modules/monitoring/application/views/scripts/hosts/show.phtml index 5c00cf827..9d532d6dd 100644 --- a/modules/monitoring/application/views/scripts/hosts/show.phtml +++ b/modules/monitoring/application/views/scripts/hosts/show.phtml @@ -1,9 +1,12 @@
+ compact): ?> + + render('partials/host/objects-header.phtml'); ?>
- translate('No hosts matching the filter'); ?> + translate('No hosts found matching the filter'); ?>

translatePlural('%u Host', '%u Hosts', $hostCount), $hostCount); ?>

qlink( diff --git a/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml b/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml index f5edd0213..838a78dd8 100644 --- a/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/host/objects-header.phtml @@ -1,6 +1,3 @@ -compact): ?> - - 0): ?>
translatePlural('Host (%u)', 'Hosts (%u)', $hostCount), $hostCount); ?> diff --git a/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml b/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml index 1ac27b934..25a7117dd 100644 --- a/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/service/objects-header.phtml @@ -1,6 +1,3 @@ -compact): ?> - - 0): ?>
diff --git a/modules/monitoring/application/views/scripts/services/show.phtml b/modules/monitoring/application/views/scripts/services/show.phtml index a71e32792..8bf45a32c 100644 --- a/modules/monitoring/application/views/scripts/services/show.phtml +++ b/modules/monitoring/application/views/scripts/services/show.phtml @@ -1,9 +1,12 @@
+ compact): ?> + + render('partials/service/objects-header.phtml'); ?>
- translate('No services matching the filter'); ?> + translate('No services found matching the filter'); ?>

translatePlural('%u Service', '%u Services', $serviceCount), $serviceCount); ?>

qlink( From b2246c2aff322ac8800dde80564b3e82a67f92c5 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:19:30 +0200 Subject: [PATCH 28/48] host/show: Ensure dashboard compliance refs #7876 --- modules/monitoring/application/views/scripts/host/show.phtml | 3 +++ .../views/scripts/partials/host/object-header.phtml | 4 ---- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/monitoring/application/views/scripts/host/show.phtml b/modules/monitoring/application/views/scripts/host/show.phtml index 867692301..32389515b 100644 --- a/modules/monitoring/application/views/scripts/host/show.phtml +++ b/modules/monitoring/application/views/scripts/host/show.phtml @@ -1,4 +1,7 @@
+ compact): ?> + tabs; ?> + render('partials/host/object-header.phtml') ?> render('partials/host/servicesummary.phtml') ?>
diff --git a/modules/monitoring/application/views/scripts/partials/host/object-header.phtml b/modules/monitoring/application/views/scripts/partials/host/object-header.phtml index 69d0f62f5..0efedf328 100644 --- a/modules/monitoring/application/views/scripts/partials/host/object-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/host/object-header.phtml @@ -1,11 +1,7 @@ -compact): ?> - -
From b9f9ea614236e8a65bad6698091aede4fcf97cb7 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:19:38 +0200 Subject: [PATCH 29/48] service/show: Ensure dashboard compliance refs #7876 --- .../views/scripts/partials/service/object-header.phtml | 4 ---- .../monitoring/application/views/scripts/service/show.phtml | 3 +++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/monitoring/application/views/scripts/partials/service/object-header.phtml b/modules/monitoring/application/views/scripts/partials/service/object-header.phtml index 5f3ccb70f..45111fe1e 100644 --- a/modules/monitoring/application/views/scripts/partials/service/object-header.phtml +++ b/modules/monitoring/application/views/scripts/partials/service/object-header.phtml @@ -1,12 +1,8 @@ -compact): ?> - -
diff --git a/modules/monitoring/application/views/scripts/service/show.phtml b/modules/monitoring/application/views/scripts/service/show.phtml index 3a09e2bf4..4d33644ce 100644 --- a/modules/monitoring/application/views/scripts/service/show.phtml +++ b/modules/monitoring/application/views/scripts/service/show.phtml @@ -1,4 +1,7 @@
+ compact): ?> + tabs; ?> + render('partials/service/object-header.phtml') ?>

translate("Service detail information") ?>

From 78e4df2ce99a6ff3f8b8b734479564f9c5bce4a0 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:20:06 +0200 Subject: [PATCH 30/48] monitoring health views: Ensure dashboard compliance refs #7876 --- .../views/scripts/process/disable-notifications.phtml | 4 +++- .../monitoring/application/views/scripts/process/info.phtml | 6 +++--- .../application/views/scripts/process/not-running.phtml | 4 +++- .../application/views/scripts/process/performance.phtml | 5 +++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/modules/monitoring/application/views/scripts/process/disable-notifications.phtml b/modules/monitoring/application/views/scripts/process/disable-notifications.phtml index 9b9a2b133..e8c75e53f 100644 --- a/modules/monitoring/application/views/scripts/process/disable-notifications.phtml +++ b/modules/monitoring/application/views/scripts/process/disable-notifications.phtml @@ -1,6 +1,8 @@ +compact): ?>
- tabs->showOnlyCloseButton() ?> + tabs->showOnlyCloseButton(); ?>
+

notifications_enabled === false): ?> diff --git a/modules/monitoring/application/views/scripts/process/info.phtml b/modules/monitoring/application/views/scripts/process/info.phtml index 835228814..8cb5aebe1 100644 --- a/modules/monitoring/application/views/scripts/process/info.phtml +++ b/modules/monitoring/application/views/scripts/process/info.phtml @@ -1,12 +1,12 @@ runtimeVariables()->create($this->runtimevariables); $cp = $this->checkPerformance()->create($this->checkperformance); -?> +if (! $this->compact): ?>
- tabs ?> + tabs; ?>
+
diff --git a/modules/monitoring/application/views/scripts/process/not-running.phtml b/modules/monitoring/application/views/scripts/process/not-running.phtml index 58b6c2980..8439fc49e 100644 --- a/modules/monitoring/application/views/scripts/process/not-running.phtml +++ b/modules/monitoring/application/views/scripts/process/not-running.phtml @@ -1,6 +1,8 @@ +compact): ?>
- tabs ?> + tabs; ?>
+
translate('%s is currently not up and running'), $this->backendName) ?>
diff --git a/modules/monitoring/application/views/scripts/process/performance.phtml b/modules/monitoring/application/views/scripts/process/performance.phtml index 6276d76d1..0bff8891f 100644 --- a/modules/monitoring/application/views/scripts/process/performance.phtml +++ b/modules/monitoring/application/views/scripts/process/performance.phtml @@ -1,7 +1,8 @@ +compact): ?>
-tabs ?> + tabs; ?>
-runtimeVariables()->create($this->runtimevariables); $cp = $this->checkPerformance()->create($this->checkperformance); From c099b7ddd70e9ae5c0ff3824eab9614961653dca Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:20:22 +0200 Subject: [PATCH 31/48] eventgrid: Ensure dashboard compliance refs #7876 --- .../views/scripts/list/eventgrid.phtml | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/eventgrid.phtml b/modules/monitoring/application/views/scripts/list/eventgrid.phtml index 1af75caf9..6936e9063 100644 --- a/modules/monitoring/application/views/scripts/list/eventgrid.phtml +++ b/modules/monitoring/application/views/scripts/list/eventgrid.phtml @@ -1,21 +1,25 @@ - - - -
- tabs->render($this); ?> -
- -
-
- +if (! $this->compact): ?> +
+ tabs; ?> + sortBox; ?> + limiter; ?> + paginator; ?> + filterEditor; ?> + +
+
translate('No state changes in the selected time period.') . '
'; + return; +} + $settings = array( 'cnt_up' => array( 'tooltip' => $this->translate('%d hosts ok on %s'), @@ -63,11 +67,8 @@ $to = intval($form->getValue('to', time())); if ($to - $from > 315360000) { $from = $to - 315360000; } -$data = array(); -if (count($summary) === 0) { - echo $this->translate('No state changes in the selected time period.'); -} +$data = array(); foreach ($summary as $entry) { $day = $entry->day; $value = $entry->$column; From 14a555629d8016955c5f4642ac357f6ef3629c3c Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:20:29 +0200 Subject: [PATCH 32/48] servicegrid: Ensure dashboard compliance refs #7876 --- .../views/scripts/list/servicegrid.phtml | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/monitoring/application/views/scripts/list/servicegrid.phtml b/modules/monitoring/application/views/scripts/list/servicegrid.phtml index a2e7502ea..6fb6db63e 100644 --- a/modules/monitoring/application/views/scripts/list/servicegrid.phtml +++ b/modules/monitoring/application/views/scripts/list/servicegrid.phtml @@ -1,28 +1,28 @@ -compact): ?> +if (! $this->compact): ?>
tabs; ?> -
- translate('Sort by'); ?> sortControl; ?> -
+ sortBox; ?> + limiter; ?> + paginator; ?> + filterEditor; ?>
- pivot->toArray(); +if (count($pivotData) === 0) { + echo $this->translate('No services found matching the filter') . ''; + return; +} + $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . ')'; ?> - - - translate('No Services matching the filter'); ?> - - +
$serviceStates): ?> From dbf471feac723f77aa159e76cb968490b924f521 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Fri, 17 Apr 2015 16:21:14 +0200 Subject: [PATCH 33/48] Use the helper to setup the FilterEditor widget refs #7876 --- modules/monitoring/application/controllers/ListController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index a6c38c2e1..78c88dabc 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -689,7 +689,7 @@ class Monitoring_ListController extends Controller ->handleRequest($this->getRequest()); $query->applyFilter($editor->getFilter()); - $this->view->filterEditor = $editor; + $this->setupFilterControl($editor); $this->view->filter = $editor->getFilter(); if ($sort = $this->params->get('sort')) { From 4b43fbe5276219499bca90c2f36a29a70b5997d5 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 20 Apr 2015 13:03:13 +0200 Subject: [PATCH 34/48] Host- and Service multiselection: Ensure dashboard compliance refs #7876 --- .../monitoring/application/controllers/HostsController.php | 2 +- .../monitoring/application/controllers/ServicesController.php | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/monitoring/application/controllers/HostsController.php b/modules/monitoring/application/controllers/HostsController.php index 27d26e51b..7ffd02394 100644 --- a/modules/monitoring/application/controllers/HostsController.php +++ b/modules/monitoring/application/controllers/HostsController.php @@ -26,7 +26,7 @@ class Monitoring_HostsController extends Controller public function init() { $hostList = new HostList($this->backend); - $hostList->setFilter(Filter::fromQueryString((string) $this->params)); + $hostList->setFilter(Filter::fromQueryString((string) $this->params->without('view'))); $this->hostList = $hostList; } diff --git a/modules/monitoring/application/controllers/ServicesController.php b/modules/monitoring/application/controllers/ServicesController.php index b82d6f00e..d902b3b75 100644 --- a/modules/monitoring/application/controllers/ServicesController.php +++ b/modules/monitoring/application/controllers/ServicesController.php @@ -27,7 +27,9 @@ class Monitoring_ServicesController extends Controller public function init() { $serviceList = new ServiceList($this->backend); - $serviceList->setFilter(Filter::fromQueryString((string) $this->params->without('service_problem', 'service_handled'))); + $serviceList->setFilter(Filter::fromQueryString( + (string) $this->params->without('service_problem', 'service_handled', 'view') + )); $this->serviceList = $serviceList; } From 5196f16bdeef69d408a45e56fe26cdbc61df76b7 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 20 Apr 2015 13:06:45 +0200 Subject: [PATCH 35/48] Do not forcibly hide controls in the dashboard Our views respect view=compact now entirely so there is no need for such a generic "solution" since it also prevents some views from being completely displayed in the dashboard such as the host, service and contact detail view. refs #7876 --- public/css/icinga/layout-structure.less | 2 +- public/js/icinga/ui.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/public/css/icinga/layout-structure.less b/public/css/icinga/layout-structure.less index 23a598b52..9d0d38def 100644 --- a/public/css/icinga/layout-structure.less +++ b/public/css/icinga/layout-structure.less @@ -163,7 +163,7 @@ html { } .dashboard .controls { - display: none; + padding: 0; } /* Not growing larger than 3840px at 1em=16px right now */ diff --git a/public/js/icinga/ui.js b/public/js/icinga/ui.js index 2c85a2df9..3bfb87c61 100644 --- a/public/js/icinga/ui.js +++ b/public/js/icinga/ui.js @@ -716,8 +716,6 @@ }, initializeControls: function (parent) { - - var self = this; if ($(parent).closest('.dashboard').length) { return; } @@ -747,7 +745,6 @@ }, fixControls: function ($parent) { - var self = this; if ('undefined' === typeof $parent) { @@ -773,6 +770,11 @@ $('.controls', $parent).each(function (idx, el) { var $el = $(el); + + if ($el.closest('.dashboard').length) { + return; + } + var $fake = $el.next('.fake-controls'); var y = $parent.scrollTop(); From 8b18c5a60a6873122bc4c38871e0096dce1b2ffb Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 20 Apr 2015 13:18:36 +0200 Subject: [PATCH 36/48] Fix parameters to ignore when setting a filter for the ServiceList refs #7876 --- .../monitoring/application/controllers/ServicesController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/monitoring/application/controllers/ServicesController.php b/modules/monitoring/application/controllers/ServicesController.php index d902b3b75..0f94e91aa 100644 --- a/modules/monitoring/application/controllers/ServicesController.php +++ b/modules/monitoring/application/controllers/ServicesController.php @@ -28,7 +28,7 @@ class Monitoring_ServicesController extends Controller { $serviceList = new ServiceList($this->backend); $serviceList->setFilter(Filter::fromQueryString( - (string) $this->params->without('service_problem', 'service_handled', 'view') + (string) $this->params->without(array('service_problem', 'service_handled', 'view')) )); $this->serviceList = $serviceList; } From 76305269a91f410575baf3fb65971e5b89d2b7bb Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 20 Apr 2015 13:18:57 +0200 Subject: [PATCH 37/48] Hide the top margin for group views in the dashboard refs #7876 --- public/css/icinga/monitoring-colors.less | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/css/icinga/monitoring-colors.less b/public/css/icinga/monitoring-colors.less index 5c19bfe35..8ab95b3cc 100644 --- a/public/css/icinga/monitoring-colors.less +++ b/public/css/icinga/monitoring-colors.less @@ -814,6 +814,10 @@ div.timeline { /* Monitoring groupsummary styles */ +.dashboard table.groupview { + margin-top: 0; +} + table.groupview { width: 100%; margin-top: 1em; From 0be8b8997b1cf4dd8e4ca49d1584b6710ff596e1 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 20 Apr 2015 13:25:29 +0200 Subject: [PATCH 38/48] Timeline: Do not enable infinite scrolling when shown in the dashboard refs #7876 --- modules/monitoring/public/js/module.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/public/js/module.js b/modules/monitoring/public/js/module.js index 03cfc1c3d..3421be2cf 100644 --- a/modules/monitoring/public/js/module.js +++ b/modules/monitoring/public/js/module.js @@ -44,7 +44,8 @@ /** * Prepare the timer to handle the timeline's infinite loading */ - if ($('div.timeline').length) { + var $timeline = $('div.timeline'); + if ($timeline.length && !$timeline.closest('.dashboard').length) { if (this.scrollCheckTimer === null) { this.scrollCheckTimer = this.module.icinga.timer.register( this.checkTimelinePosition, From 6b3dd63bb344bf45116e5513264b3f4c5b21520f Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 20 Apr 2015 14:55:18 +0200 Subject: [PATCH 39/48] Doc module: Fix div.controls of the index controller's index action refs #7876 --- modules/doc/application/views/scripts/index/index.phtml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/doc/application/views/scripts/index/index.phtml b/modules/doc/application/views/scripts/index/index.phtml index 0b98623ac..67ee52ac1 100644 --- a/modules/doc/application/views/scripts/index/index.phtml +++ b/modules/doc/application/views/scripts/index/index.phtml @@ -1,6 +1,7 @@ -
+
showOnlyCloseButton(); ?>

translate('Available documentations'); ?>

+
  • qlink( From 0997eaf45935b5252cf5a3467938a05ea3b6cd84 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 20 Apr 2015 14:56:30 +0200 Subject: [PATCH 40/48] Host detail view: Fix that the list of services is missing all tabs refs #7876 --- .../monitoring/application/views/scripts/show/services.phtml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/monitoring/application/views/scripts/show/services.phtml b/modules/monitoring/application/views/scripts/show/services.phtml index 57b4b204e..d3a0c3ef8 100644 --- a/modules/monitoring/application/views/scripts/show/services.phtml +++ b/modules/monitoring/application/views/scripts/show/services.phtml @@ -1,4 +1,7 @@
    + compact): ?> + tabs; ?> + render('partials/host/object-header.phtml') ?> render('partials/host/servicesummary.phtml') ?>
    From 1ff9449ad7a23a1f32b237938ba14d6fcac88b00 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 20 Apr 2015 14:58:25 +0200 Subject: [PATCH 41/48] List views: Show the output and dashboard actions for all views refs #7876 --- application/controllers/ListController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/controllers/ListController.php b/application/controllers/ListController.php index 985c53512..972573dc1 100644 --- a/application/controllers/ListController.php +++ b/application/controllers/ListController.php @@ -3,6 +3,8 @@ use Icinga\Module\Monitoring\Controller; use Icinga\Web\Url; +use Icinga\Web\Widget\Tabextension\DashboardAction; +use Icinga\Web\Widget\Tabextension\OutputFormat; use Icinga\Application\Config; use Icinga\Application\Logger; use Icinga\Data\ConfigObject; @@ -29,7 +31,7 @@ class ListController extends Controller 'list/' . str_replace(' ', '', $action) ) - ))->activate($action); + ))->extend(new OutputFormat())->extend(new DashboardAction())->activate($action); } /** From 48df225f987a0bf3140b28735558f0fd8c04ac12 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 20 Apr 2015 14:58:47 +0200 Subject: [PATCH 42/48] Alertsummary: Add dashboard action refs #7876 --- .../application/controllers/AlertsummaryController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/application/controllers/AlertsummaryController.php b/modules/monitoring/application/controllers/AlertsummaryController.php index aea8def93..dcc805286 100644 --- a/modules/monitoring/application/controllers/AlertsummaryController.php +++ b/modules/monitoring/application/controllers/AlertsummaryController.php @@ -6,6 +6,7 @@ use Icinga\Chart\Unit\LinearUnit; use Icinga\Chart\Unit\StaticAxis; use Icinga\Module\Monitoring\Controller; use Icinga\Module\Monitoring\Web\Widget\SelectBox; +use Icinga\Web\Widget\Tabextension\DashboardAction; use Icinga\Web\Url; class Monitoring_AlertsummaryController extends Controller @@ -44,7 +45,7 @@ class Monitoring_AlertsummaryController extends Controller 'label' => $this->translate('Alert Summary'), 'url' => Url::fromRequest() ) - )->activate('alertsummary'); + )->extend(new DashboardAction())->activate('alertsummary'); $this->view->title = $this->translate('Alert Summary'); $this->view->intervalBox = $this->createIntervalBox(); From 4e27ff962cfaaa35cd62f8d505020070e9c623ae Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 20 Apr 2015 14:59:05 +0200 Subject: [PATCH 43/48] Host multiselection view: Add dashboard action refs #7876 --- modules/monitoring/application/controllers/HostsController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/application/controllers/HostsController.php b/modules/monitoring/application/controllers/HostsController.php index 7ffd02394..e208da312 100644 --- a/modules/monitoring/application/controllers/HostsController.php +++ b/modules/monitoring/application/controllers/HostsController.php @@ -15,6 +15,7 @@ use Icinga\Module\Monitoring\Object\Host; use Icinga\Module\Monitoring\Object\HostList; use Icinga\Web\Url; use Icinga\Web\Widget\Chart\InlinePie; +use Icinga\Web\Widget\Tabextension\DashboardAction; class Monitoring_HostsController extends Controller { @@ -80,7 +81,7 @@ class Monitoring_HostsController extends Controller 'label' => $this->translate('Hosts'), 'url' => Url::fromRequest() ) - )->activate('show'); + )->extend(new DashboardAction())->activate('show'); $this->setAutorefreshInterval(15); $checkNowForm = new CheckNowCommandForm(); $checkNowForm From 41222fd34ebe1301b9853335598dc10f32a0f9a9 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 20 Apr 2015 14:59:20 +0200 Subject: [PATCH 44/48] Service multiselection view: Add dashboard action refs #7876 --- .../monitoring/application/controllers/ServicesController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/application/controllers/ServicesController.php b/modules/monitoring/application/controllers/ServicesController.php index 0f94e91aa..8aa27272a 100644 --- a/modules/monitoring/application/controllers/ServicesController.php +++ b/modules/monitoring/application/controllers/ServicesController.php @@ -16,6 +16,7 @@ use Icinga\Module\Monitoring\Object\Service; use Icinga\Module\Monitoring\Object\ServiceList; use Icinga\Web\Url; use Icinga\Web\Widget\Chart\InlinePie; +use Icinga\Web\Widget\Tabextension\DashboardAction; class Monitoring_ServicesController extends Controller { @@ -103,7 +104,7 @@ class Monitoring_ServicesController extends Controller 'label' => $this->translate('Services'), 'url' => Url::fromRequest() ) - )->activate('show'); + )->extend(new DashboardAction())->activate('show'); $this->setAutorefreshInterval(15); $checkNowForm = new CheckNowCommandForm(); $checkNowForm From a4f08067e4b8da9e85d872d610d76c90011f2c24 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 20 Apr 2015 14:59:32 +0200 Subject: [PATCH 45/48] Applicationlog: : Add dashboard action refs #7876 --- .../application/controllers/ListController.php | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/modules/monitoring/application/controllers/ListController.php b/modules/monitoring/application/controllers/ListController.php index 78c88dabc..9eb014421 100644 --- a/modules/monitoring/application/controllers/ListController.php +++ b/modules/monitoring/application/controllers/ListController.php @@ -728,15 +728,6 @@ class Monitoring_ListController extends Controller */ private function createTabs() { - $tabs = $this->getTabs(); - if (in_array($this->_request->getActionName(), array( - 'hosts', - 'services', - 'eventhistory', - 'eventgrid', - 'notifications' - ))) { - $tabs->extend(new OutputFormat())->extend(new DashboardAction()); - } + $this->getTabs()->extend(new OutputFormat())->extend(new DashboardAction()); } } From 48f9cf61e7ce785a439ec42e13b020bcc841a476 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 20 Apr 2015 14:59:44 +0200 Subject: [PATCH 46/48] Monitoring health view: Add dashboard action refs #7876 --- .../monitoring/application/controllers/ProcessController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/application/controllers/ProcessController.php b/modules/monitoring/application/controllers/ProcessController.php index b20bd7576..a07ac5f3a 100644 --- a/modules/monitoring/application/controllers/ProcessController.php +++ b/modules/monitoring/application/controllers/ProcessController.php @@ -1,6 +1,7 @@ $this->translate('Monitoring Health'), 'url' =>'monitoring/process/info' ) - ); + )->extend(new DashboardAction()); } /** From a3eb6e37f294df32fabff10920268ec808acf685 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 20 Apr 2015 14:59:54 +0200 Subject: [PATCH 47/48] Tactical overview: Add dashboard action refs #7876 --- .../monitoring/application/controllers/TacticalController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/application/controllers/TacticalController.php b/modules/monitoring/application/controllers/TacticalController.php index 33681528c..d9da6d3d5 100644 --- a/modules/monitoring/application/controllers/TacticalController.php +++ b/modules/monitoring/application/controllers/TacticalController.php @@ -2,6 +2,7 @@ /* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ use Icinga\Module\Monitoring\Controller as MonitoringController; +use Icinga\Web\Widget\Tabextension\DashboardAction; use Icinga\Web\Url; class Monitoring_TacticalController extends MonitoringController @@ -18,7 +19,7 @@ class Monitoring_TacticalController extends MonitoringController 'label' => $this->translate('Tactical Overview'), 'url' => Url::fromRequest() ) - )->activate('tactical_overview'); + )->extend(new DashboardAction())->activate('tactical_overview'); $this->view->statusSummary = $this->backend->select()->from( 'statusSummary', From b68fd935295a9cede0f405e78f7339a997524846 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 20 Apr 2015 15:00:01 +0200 Subject: [PATCH 48/48] Timeline: Add dashboard action refs #7876 --- .../monitoring/application/controllers/TimelineController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/monitoring/application/controllers/TimelineController.php b/modules/monitoring/application/controllers/TimelineController.php index f1ef32592..25827c766 100644 --- a/modules/monitoring/application/controllers/TimelineController.php +++ b/modules/monitoring/application/controllers/TimelineController.php @@ -10,6 +10,7 @@ use Icinga\Module\Monitoring\Controller; use Icinga\Module\Monitoring\Timeline\TimeLine; use Icinga\Module\Monitoring\Timeline\TimeRange; use Icinga\Module\Monitoring\Web\Widget\SelectBox; +use Icinga\Web\Widget\Tabextension\DashboardAction; class Monitoring_TimelineController extends Controller { @@ -22,7 +23,7 @@ class Monitoring_TimelineController extends Controller 'label' => $this->translate('Timeline'), 'url' => Url::fromRequest() ) - )->activate('timeline'); + )->extend(new DashboardAction())->activate('timeline'); $this->view->title = $this->translate('Timeline'); // TODO: filter for hard_states (precedence adjustments necessary!)