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/controllers/ListController.php b/application/controllers/ListController.php index feaf13921..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); } /** @@ -52,5 +54,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/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; ?>
- +
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): ?>
diff --git a/library/Icinga/Web/Controller.php b/library/Icinga/Web/Controller.php index e7a1d51f5..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 @@ -14,17 +16,77 @@ 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 + * 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->sortControl = 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; } } 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/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/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() - . '' - . '' - . '
' - . '' - . '' - . '
' - . ''; + return '
' + . $this->renderSearch() + . '
' + . '' + . '
' + . '' + . '' + . '
' + . '' + . '
'; } protected function shorten($string, $length) 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/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'); ?>

+
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): ?>

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( 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; +} +?>
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; 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; +} +?>
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; +} +?>
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; } ?> 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; +} +?>
translate('Last Problem'); ?>
-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): ?> 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; +} +?>
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; +} +?>
translate('Last Problem'); ?>
" data-icinga-multiselect-data="service_description,host_name"> -href( 'monitoring/service/show', array( 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): ?> - -
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/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/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/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); 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") ?>

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( diff --git a/modules/monitoring/application/views/scripts/show/contact.phtml b/modules/monitoring/application/views/scripts/show/contact.phtml index c4142707a..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') ?>

translate('No notifications have been sent for this contact') ?>
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; +} +?> + compact): ?> + tabs; ?> + render('partials/host/object-header.phtml') ?> render('partials/host/servicesummary.phtml') ?>
diff --git a/modules/monitoring/application/views/scripts/timeline/index.phtml b/modules/monitoring/application/views/scripts/timeline/index.phtml index 6557b4a28..d0cc8d34c 100644 --- a/modules/monitoring/application/views/scripts/timeline/index.phtml +++ b/modules/monitoring/application/views/scripts/timeline/index.phtml @@ -3,13 +3,12 @@ use Icinga\Web\Url; use Icinga\Util\Color; $groupInfo = $timeline->getGroupInfo(); -$firstRow = !$beingExtended; +$firstRow = ! $beingExtended; -?> - +if (! $beingExtended && !$this->compact): ?>
- tabs ?> -
+ tabs; ?> +
@@ -21,6 +20,8 @@ $firstRow = !$beingExtended;
+ +
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()))
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/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,
diff --git a/public/css/icinga/controls.less b/public/css/icinga/controls.less
new file mode 100644
index 000000000..b8e82b795
--- /dev/null
+++ b/public/css/icinga/controls.less
@@ -0,0 +1,21 @@
+/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
+
+form.sort-control {
+  .dontprint;
+  float: right;
+
+  label {
+    width: auto;
+    margin-right: 0.5em;
+  }
+
+  select[name=sort] {
+    width: 12em;
+    margin-left: 0;
+  }
+
+  select[name=dir] {
+    width: 5em;
+    margin-left: 0;
+  }
+}
diff --git a/public/css/icinga/layout-structure.less b/public/css/icinga/layout-structure.less
index a1bf3682d..9d0d38def 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;
 }
@@ -167,7 +163,7 @@ html {
 }
 
 .dashboard .controls {
-  display: none;
+  padding: 0;
 }
 
 /* Not growing larger than 3840px at 1em=16px right now */
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/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;
diff --git a/public/css/icinga/tabs.less b/public/css/icinga/tabs.less
index 8d391b038..2c02bfb94 100644
--- a/public/css/icinga/tabs.less
+++ b/public/css/icinga/tabs.less
@@ -1,12 +1,13 @@
 /*! 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-right: -1em;
   margin-top: -3.54em;
   height: 2.6em;
   overflow: hidden;
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;
diff --git a/public/js/icinga/loader.js b/public/js/icinga/loader.js
index 535e414a9..99667ac1c 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);
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();