= $this->partial('list/notifications.phtml', array(
'notifications' => $this->recentAlerts,
- 'compact' => true,
- 'inline' => true
+ 'compact' => true
)); ?>
@@ -71,8 +70,7 @@
= $this->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 041/298] 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 042/298] 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 @@
-= $this->render('list/notifications.phtml') ?>
+= $this->partial('list/notifications.phtml', array(
+ 'notifications' => $notifications,
+ 'compact' => true
+)); ?>
= $this->translate('No notifications have been sent for this contact') ?>
From aa409bda72b86da27edc7db14f34ab9af3d8802a Mon Sep 17 00:00:00 2001
From: Matthias Jentsch
Date: Thu, 16 Apr 2015 12:13:31 +0200
Subject: [PATCH 043/298] Fix formatting of js error log entries generated from
responses
Replace multiple whitespace characters with a single one and remove linebreaks.
refs #8711
---
public/js/icinga/loader.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/js/icinga/loader.js b/public/js/icinga/loader.js
index 1c674b947..535e414a9 100644
--- a/public/js/icinga/loader.js
+++ b/public/js/icinga/loader.js
@@ -640,7 +640,7 @@
this.icinga.logger.error(
req.status,
errorThrown + ':',
- $(req.responseText).text().slice(0, 100)
+ $(req.responseText).text().replace(/\s+/g, ' ').slice(0, 100)
);
this.renderContentToContainer(
req.responseText,
From 36726560ddd3b76b88c079f556f8044ab12e1e1b Mon Sep 17 00:00:00 2001
From: Eric Lippmann
Date: Thu, 16 Apr 2015 13:59:17 +0200
Subject: [PATCH 044/298] Document how to install Icinga Web 2 from Package
---
doc/installation.md | 148 +++++++++++++++++++++++++++++++++++++++-----
1 file changed, 131 insertions(+), 17 deletions(-)
diff --git a/doc/installation.md b/doc/installation.md
index ef968974a..133f6cb98 100644
--- a/doc/installation.md
+++ b/doc/installation.md
@@ -3,21 +3,133 @@
The preferred way of installing Icinga Web 2 is to use the official package repositories depending on which operating
system and distribution you are running. But it is also possible to install Icinga Web 2 directly from source.
-## Installing Requirements
+## Installing Requirements
* A web server, e.g. Apache or nginx
-* PHP >= 5.3.0 w/ gettext and OpenSSL support
-* MySQL or PostgreSQL PHP libraries when using a database for authentication or storing user preferences into a database
+* PHP >= 5.3.0 w/ gettext, intl and OpenSSL support
+* MySQL or PostgreSQL PHP libraries when using a database for authentication or for storing preferences into a database
* LDAP PHP library when using Active Directory or LDAP for authentication
-* Icinga 1.x w/ Livestatus or IDO, Icinga 2 w/ Livestatus or IDO feature enabled
+* Icinga 1.x w/ Livestatus or IDO; Icinga 2.x w/ Livestatus or IDO feature enabled
+* MySQL or PostgreSQL PHP libraries when using IDO
-## Installing Icinga Web 2 from Package
+## Installing Icinga Web 2 from Package
-A guide on how to install Icinga Web 2 from package will follow shortly.
+Below is a list of official package repositories for installing Icinga Web 2 for various operating systems.
-## Installing Icinga Web 2 from Source
+Distribution | Repository
+------------------------|---------------------------
+Debian | [debmon](http://debmon.org/packages/debmon-wheezy/icingaweb2), [Icinga Repository](http://packages.icinga.org/debian/)
+Ubuntu | [Icinga Repository](http://packages.icinga.org/ubuntu/)
+RHEL/CentOS | [Icinga Repository](http://packages.icinga.org/epel/)
+openSUSE | [Icinga Repository](http://packages.icinga.org/openSUSE/)
+SLES | [Icinga Repository](http://packages.icinga.org/SUSE/)
+Gentoo | -
+FreeBSD | -
+ArchLinux | [Upstream](https://aur.archlinux.org/packages/icingaweb2)
-**Step 1: Getting the Source**
+Packages for distributions other than the ones listed above may also be available.
+Please contact your distribution packagers.
+
+### Setting up Package Repositories
+
+You need to add the Icinga repository to your package management configuration for installing Icinga Web 2.
+Below is a list with examples for various distributions.
+
+Debian (debmon):
+````
+wget -O - http://debmon.org/debmon/repo.key 2>/dev/null | apt-key add -
+echo 'deb http://debmon.org/debmon debmon-wheezy main' >/etc/apt/sources.list.d/debmon.list
+apt-get update
+````
+
+Ubuntu Trusty:
+````
+wget -O - http://packages.icinga.org/icinga.key | apt-key add -
+add-apt-repository 'deb http://packages.icinga.org/ubuntu icinga-trusty main'
+apt-get update
+````
+
+For other Ubuntu versions just replace trusty with your distribution's code name.
+
+RHEL and CentOS:
+````
+rpm --import http://packages.icinga.org/icinga.key
+curl -o /etc/yum.repos.d/ICINGA-release.repo http://packages.icinga.org/epel/ICINGA-release.repo
+yum makecache
+````
+
+Fedora:
+````
+rpm --import http://packages.icinga.org/icinga.key
+curl -o /etc/yum.repos.d/ICINGA-release.repo http://packages.icinga.org/fedora/ICINGA-release.repo
+yum makecache
+````
+
+SLES 11:
+````
+zypper ar http://packages.icinga.org/SUSE/ICINGA-release-11.repo
+zypper ref
+````
+
+SLES 12:
+````
+zypper ar http://packages.icinga.org/SUSE/ICINGA-release.repo
+zypper ref
+````
+
+openSUSE:
+````
+zypper ar http://packages.icinga.org/openSUSE/ICINGA-release.repo
+zypper ref
+````
+
+The packages for RHEL/CentOS depend on other packages which are distributed as part of the
+[EPEL repository](http://fedoraproject.org/wiki/EPEL). Please make sure to enable this repository by following
+[these instructions](http://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F).
+
+### Installing Icinga Web 2
+
+You can install Icinga Web 2 by using your distribution's package manager to install the `icingaweb2` package.
+Below is a list with examples for various distributions.
+
+Debian and Ubuntu:
+````
+apt-get install icingaweb2
+````
+
+RHEL, CentOS and Fedora:
+````
+yum install icingaweb2
+````
+
+SLES and openSUSE:
+````
+zypper install icingaweb2
+````
+
+### Preparing Web Setup
+
+You can set up Icinga Web 2 quickly and easily with the Icinga Web 2 setup wizard which is available the first time
+you visit Icinga Web 2 in your browser. When using the web setup you are required to authenticate using a token.
+In order to generate a token use the `icingacli`:
+````
+icingacli setup token create
+````
+
+In case you do not remember the token you can show it using the `icingacli`:
+````
+icingacli setup token show
+````
+
+Finally visit Icinga Web 2 in your browser to access the setup wizard and complete the installation:
+`/icingaweb2/setup`.
+
+## Installing Icinga Web 2 from Source
+
+Although the preferred way of installing Icinga Web 2 is to use packages, it is also possible to install Icinga Web 2
+directly from source.
+
+### Getting the Source
First of all, you need to download the sources. Icinga Web 2 is available through a Git repository. You can clone this
repository either via git or http protocol using the following URLs:
@@ -33,7 +145,7 @@ This version also offers snapshots for easy download which you can use if you do
git clone git://git.icinga.org/icingaweb2.git
````
-**Step 2: Install the Source**
+### Installing Icinga Web 2
Choose a target directory and move Icinga Web 2 there.
@@ -41,7 +153,7 @@ Choose a target directory and move Icinga Web 2 there.
mv icingaweb2 /usr/share/icingaweb2
````
-**Step 3: Configuring the Web Server**
+### Configuring the Web Server
Use `icingacli` to generate web server configuration for either Apache or nginx.
@@ -57,13 +169,15 @@ nginx:
Save the output as new file in your webserver's configuration directory.
-Example for Apache on RHEL/CentOS:
+Example for Apache on RHEL or CentOS:
````
./bin/icingacli setup config webserver apache --document-root /usr/share/icingaweb2/public > /etc/httpd/conf.d/icingaweb2.conf
````
+### Preparing Web Setup
-**Step 4: Preparing Web Setup**
+You can set up Icinga Web 2 quickly and easily with the Icinga Web 2 setup wizard which is available the first time
+you visit Icinga Web 2 in your browser. Please follow the steps listed below for preparing the web setup.
Because both web and CLI must have access to configuration and logs, permissions will be managed using a special
system group. The web server user and CLI user have to be added to this system group.
@@ -102,6 +216,7 @@ Use `icingacli` to create the configuration directory which defaults to **/etc/i
./bin/icingacli setup config directory
````
+
When using the web setup you are required to authenticate using a token. In order to generate a token use the
`icingacli`:
````
@@ -113,11 +228,10 @@ In case you do not remember the token you can show it using the `icingacli`:
./bin/icingacli setup token show
````
-**Step 5: Web Setup**
+Finally visit Icinga Web 2 in your browser to access the setup wizard and complete the installation:
+`/icingaweb2/setup`.
-Visit Icinga Web 2 in your browser and complete installation using the web setup: /icingaweb2/setup
-
-## Upgrading to Icinga Web 2 Beta 2
+## Upgrading to Icinga Web 2 Beta 2
Icinga Web 2 Beta 2 introduces access control based on roles for secured actions. If you've already set up Icinga Web 2,
you are required to create the file **roles.ini** beneath Icinga Web 2's configuration directory with the following
@@ -134,7 +248,7 @@ If you delegated authentication to your web server using the `autologin` backend
authentication backend to be able to log in again. The new name better reflects what’s going on. A similar change
affects environments that opted for not storing preferences, your new backend is `none`.
-## Upgrading to Icinga Web 2 Beta 3
+## Upgrading to Icinga Web 2 Beta 3
Because Icinga Web 2 Beta 3 does not introduce any backward incompatible change you don't have to change your
configuration files after upgrading to Icinga Web 2 Beta 3.
From 3015028f5df2e4c5c81813fffb515c26043705e3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Tim=20Helfensd=C3=B6rfer?=
Date: Fri, 10 Apr 2015 13:20:09 +0200
Subject: [PATCH 045/298] Remove quotation marks in password example
Otherwise the quotation marks are included in the password.
Signed-off-by: Eric Lippmann
---
doc/authentication.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/doc/authentication.md b/doc/authentication.md
index 604c85a2e..13a821441 100644
--- a/doc/authentication.md
+++ b/doc/authentication.md
@@ -107,7 +107,7 @@ Icinga Web 2 uses the MD5 based BSD password algorithm. For generating a passwor
command:
````
-openssl passwd -1 "password"
+openssl passwd -1 password
````
> Note: The switch to `openssl passwd` is the **number one** (`-1`) for using the MD5 based BSD password algorithm.
From 168577ff336aec67d398109f47435df2babf8c31 Mon Sep 17 00:00:00 2001
From: Matthias Jentsch
Date: Thu, 16 Apr 2015 14:29:06 +0200
Subject: [PATCH 046/298] Use icon instead of the letter 'X' in close tab
---
library/Icinga/Web/Widget/Tabs.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/library/Icinga/Web/Widget/Tabs.php b/library/Icinga/Web/Widget/Tabs.php
index 770f5093f..aa5e7cda6 100644
--- a/library/Icinga/Web/Widget/Tabs.php
+++ b/library/Icinga/Web/Widget/Tabs.php
@@ -49,7 +49,7 @@ EOT;
*/
private $closeTpl = <<< 'EOT'
- X
+
EOT;
From f07c0d83e8c2be5a68d90385d6e17fe839303ed5 Mon Sep 17 00:00:00 2001
From: Matthias Jentsch
Date: Thu, 16 Apr 2015 18:25:23 +0200
Subject: [PATCH 047/298] Add option to change tooltip settings from data
attributes
refs #9025
---
public/js/icinga/behavior/tooltip.js | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/public/js/icinga/behavior/tooltip.js b/public/js/icinga/behavior/tooltip.js
index c9a64257f..a1a94b62b 100644
--- a/public/js/icinga/behavior/tooltip.js
+++ b/public/js/icinga/behavior/tooltip.js
@@ -30,7 +30,18 @@
$('svg .chart-data', el).tipsy({ gravity: 'se', html: true });
$('.historycolorgrid a[title]', el).tipsy({ gravity: 's', offset: 2 });
$('img.icon[title]', el).tipsy({ gravity: $.fn.tipsy.autoNS, offset: 2 });
- $('[title]', el).tipsy({ gravity: $.fn.tipsy.autoNS, delayIn: 500 });
+ $('[title]', el).each(function (i, el) {
+ var $el = $(el);
+ var delay = 500;
+ if ($el.data('tooltip-delay') !== undefined) {
+ delay = $el.data('tooltip-delay');
+ }
+ var gravity = $.fn.tipsy.autoNS;
+ if ($el.data('tooltip-gravity')) {
+ gravity = $el.data('tooltip-gravity');
+ }
+ $el.tipsy({ gravity: gravity, delayIn: delay });
+ });
// migrate or remove all orphaned tooltips
$('.tipsy').each(function () {
From 0974b70e0e2bde622670d1a4ad34752a03164e26 Mon Sep 17 00:00:00 2001
From: Matthias Jentsch
Date: Thu, 16 Apr 2015 18:27:47 +0200
Subject: [PATCH 048/298] Display service grid tooltips on the top
fixes #9025
---
.../application/views/scripts/list/servicegrid.phtml | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/modules/monitoring/application/views/scripts/list/servicegrid.phtml b/modules/monitoring/application/views/scripts/list/servicegrid.phtml
index a2e7502ea..9219e5dda 100644
--- a/modules/monitoring/application/views/scripts/list/servicegrid.phtml
+++ b/modules/monitoring/application/views/scripts/list/servicegrid.phtml
@@ -50,7 +50,8 @@ foreach ($serviceDescriptions as $service_description): ?>
'service_description' => $service_description
),
array(
- 'title' => sprintf($this->translate('List all services with the name "%s" on all reported hosts'), $service_description)
+ 'title' => sprintf($this->translate('List all services with the name "%s" on all reported hosts'), $service_description),
+ 'data-tooltip-gravity' => 's'
),
false
); ?>
From 6898a4e0d5d2594ffbf761a0cdf6d1f29c8c49cf Mon Sep 17 00:00:00 2001
From: Matthias Jentsch
Date: Thu, 16 Apr 2015 18:30:49 +0200
Subject: [PATCH 049/298] Display icon tooltips without delay
Original functionality was broken when changing the icon library.
---
library/Icinga/Web/Widget/Chart/HistoryColorGrid.php | 3 ++-
public/js/icinga/behavior/tooltip.js | 3 +--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/library/Icinga/Web/Widget/Chart/HistoryColorGrid.php b/library/Icinga/Web/Widget/Chart/HistoryColorGrid.php
index d1c9a677f..8ffd3ea00 100644
--- a/library/Icinga/Web/Widget/Chart/HistoryColorGrid.php
+++ b/library/Icinga/Web/Widget/Chart/HistoryColorGrid.php
@@ -127,7 +127,8 @@ class HistoryColorGrid extends AbstractWidget {
. ' opacity: ' . $this->opacity . ';" ' .
'aria-label="' . $entry['caption'] . '" ' .
'title="' . $entry['caption'] . '" ' .
- 'href="' . $entry['url'] . '"' .
+ 'href="' . $entry['url'] . '" ' .
+ 'data-tooltip-delay="0"' .
'>';
} else {
return '
Date: Thu, 16 Apr 2015 21:01:08 +0200
Subject: [PATCH 050/298] Revert "Do not destroy all global on mailto link
clicks"
This reverts commit 16b9c73436bab9318d1a09f5caaba8412fd168c2.
As I already mentioned, this re-introduces the problem that you'll
get ugly "lost connection to web server" notifications. Easiest way
to reproduce this: click your browsers reload button while a request
is pending - or just click reload a couple of times while showing the
dashboard.
refs #7759
---
public/js/icinga/events.js | 2 ++
1 file changed, 2 insertions(+)
diff --git a/public/js/icinga/events.js b/public/js/icinga/events.js
index 491ca82f2..7e87a8fb6 100644
--- a/public/js/icinga/events.js
+++ b/public/js/icinga/events.js
@@ -100,6 +100,7 @@
// Destroy Icinga, clean up and interrupt pending requests on unload
$( window ).on('unload', { self: this }, this.onUnload);
+ $( window ).on('beforeunload', { self: this }, this.onUnload);
// We catch scroll events in our containers
$('.container').on('scroll', { self: this }, this.icinga.events.onContainerScroll);
@@ -555,6 +556,7 @@
$(window).off('resize', this.onWindowResize);
$(window).off('load', this.onLoad);
$(window).off('unload', this.onUnload);
+ $(window).off('beforeunload', this.onUnload);
$(document).off('scroll', '.container', this.onContainerScroll);
$(document).off('click', 'a', this.linkClicked);
$(document).off('click', 'table.action tr[href]', this.rowSelected);
From 6d0870ad2e8b75cff9b61e1af2dbc04375c22ce8 Mon Sep 17 00:00:00 2001
From: Johannes Meyer
Date: Fri, 17 Apr 2015 10:04:24 +0200
Subject: [PATCH 051/298] 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 052/298] 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 = ' ';
+ return ''
+ . $this->renderSearch()
+ . '
'
+ . '
';
}
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 053/298] 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 054/298] 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 055/298] 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): ?>
- = $this->tabs->render($this) ?>
-
- = $this->logData ?>
+ = $this->tabs; ?>
+ = $this->sortBox; ?>
+ = $this->limiter; ?>
+ = $this->paginator; ?>
+ = $this->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 056/298] 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): ?>
-= $this->tabs ?>
-= $this->paginationControl($modules) ?>
+ = $this->tabs; ?>
+ = $this->sortBox; ?>
+ = $this->limiter; ?>
+ = $this->paginator; ?>
+ = $this->filterEditor; ?>
-
+
From 5f4a61f36e4e5dc3da7298a68dc03d008773146a Mon Sep 17 00:00:00 2001
From: Johannes Meyer
Date: Fri, 17 Apr 2015 16:09:50 +0200
Subject: [PATCH 057/298] 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): ?>
- = $this->tabs ?>
-
+ = $this->tabs; ?>
+
= $intervalBox; ?>
- = $this->widget('limiter') ?>
- = $this->paginationControl($notifications, null, null, array('preserve' => $this->preserve)) ?>
+ = $this->limiter; ?>
+ = $this->paginator; ?>
-
+
From 93889442834a464085fe3e7a36a7978ed9cf57c7 Mon Sep 17 00:00:00 2001
From: Johannes Meyer
Date: Fri, 17 Apr 2015 16:10:21 +0200
Subject: [PATCH 058/298] 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): ?>
-
+ = $this->tabs; ?>
+
= $this->render('partials/host/object-header.phtml'); ?>
-
+
= $this->render('partials/service/object-header.phtml'); ?>
-
+
= $this->translate('This Object\'s Event History'); ?>
- = $this->widget('limiter', array('url' => $url, 'max' => $history->count())); ?>
- = $this->paginationControl($history, null, null, array('preserve' => $this->preserve)); ?>
+ = $this->sortBox; ?>
+ = $this->limiter; ?>
+ = $this->paginator; ?>
+ = $this->filterEditor; ?>
-
+
-
- = $this->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 059/298] 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') ?>
- = $this->tabs ?>
+ compact): ?>
+ = $this->tabs; ?>
+
= $this->translate('Contact details') ?>
- = $this->tabs ?>
-
+ = $this->tabs; ?>
+
= $intervalBox; ?>
@@ -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 061/298] 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): ?>
- = $this->tabs ?>
-
- = $this->render('list/components/selectioninfo.phtml') ?>
- = $this->render('list/components/hostssummary.phtml') ?>
- = $this->translate('Sort by') ?> = $this->sortControl->render($this) ?>
+ = $this->tabs; ?>
+
+ = $this->render('list/components/selectioninfo.phtml'); ?>
+ = $this->render('list/components/hostssummary.phtml'); ?>
-
-= $this->widget('limiter')->setMaxLimit($this->hosts->count()) ?>
-= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?>
-= $this->selectionToolbar('multi', $this->href('monitoring/hosts/show?' . $this->filter->toQueryString())) ?>
+ = $this->sortBox; ?>
+ = $this->limiter; ?>
+ = $this->paginator; ?>
+ = $this->selectionToolbar('multi', $this->href('monitoring/hosts/show?' . $this->filter->toQueryString())); ?>
+ = $this->filterEditor; ?>
-
+
-= $this->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 062/298] 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): ?>
-= $this->tabs ?>
-
-= $this->render('list/components/selectioninfo.phtml') ?>
-= $this->render('list/components/servicesummary.phtml') ?>
-
-= $this->translate('Sort by') ?> = $this->sortControl ?>
+ = $this->tabs; ?>
+
+ = $this->render('list/components/selectioninfo.phtml'); ?>
+ = $this->render('list/components/servicesummary.phtml'); ?>
+
+ = $this->sortBox; ?>
+ = $this->limiter; ?>
+ = $this->paginator; ?>
+ = $this->filterEditor; ?>
-
-limit === 0): ?>
-= $this->widget('limiter') ?>
-
-= $this->widget('limiter')->setCurrentPageCount($this->services->count()) ?>
-= $this->paginationControl($services, null, null, array('preserve' => $this->preserve)) ?>
-
-
-= $this->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 063/298] 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): ?>
- = $this->tabs->render($this); ?>
-
- = $this->translate('Sort by'); ?> = $this->sortControl->render($this); ?>
- filterEditor): ?>
- = $this->filterPreview ?>
-
-
- = $this->widget('limiter', array('url' => $this->url, 'max' => $downtimes->count())); ?>
- = $this->paginationControl($downtimes, null, null, array('preserve' => $this->preserve)); ?>
+ = $this->tabs; ?>
+ = $this->sortBox; ?>
+ = $this->limiter; ?>
+ = $this->paginator; ?>
+ = $this->filterEditor; ?>
-
-= $this->filterEditor ?>
-
- = $this->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 064/298] 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): ?>
- = $this->tabs ?>
-
- = $this->translate('Sort by') ?> = $this->sortControl->render($this) ?>
-
- = $this->widget('limiter') ?>
- = $this->paginationControl($notifications, null, null, array('preserve' => $this->preserve)) ?>
+ = $this->tabs; ?>
+ = $this->sortBox; ?>
+ = $this->limiter; ?>
+ = $this->paginator; ?>
+ = $this->filterEditor; ?>
-
-
- = $this->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 065/298] 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): ?>
- = $this->tabs ?>
-
- = $this->sortControl->render($this); ?>
-
- = $this->paginationControl($contacts, null, null, array('preserve' => $this->preserve)); ?>
+ = $this->tabs; ?>
+ = $this->sortBox; ?>
+ = $this->limiter; ?>
+ = $this->paginator; ?>
+ = $this->filterEditor; ?>
-
+
- translate('No contacts matching the filter');
- return;
- }
- foreach ($contacts as $contact): ?>
+translate('No contacts found matching the filter') . '
';
+ return;
+}
+?>
+