Merge branch 'bugfix/make-all-views-dashboard-compliant-7876'

fixes #7876
This commit is contained in:
Johannes Meyer 2015-04-20 15:20:47 +02:00
commit cc573c1b3f
59 changed files with 545 additions and 459 deletions

View File

@ -11,14 +11,14 @@ use Icinga\Forms\Config\GeneralConfigForm;
use Icinga\Forms\Config\ResourceConfigForm; use Icinga\Forms\Config\ResourceConfigForm;
use Icinga\Forms\ConfirmRemovalForm; use Icinga\Forms\ConfirmRemovalForm;
use Icinga\Security\SecurityException; use Icinga\Security\SecurityException;
use Icinga\Web\Controller\ActionController; use Icinga\Web\Controller;
use Icinga\Web\Notification; use Icinga\Web\Notification;
use Icinga\Web\Widget; use Icinga\Web\Widget;
/** /**
* Application and module configuration * Application and module configuration
*/ */
class ConfigController extends ActionController class ConfigController extends Controller
{ {
/** /**
* The first allowed config action according to the user's permissions * The first allowed config action according to the user's permissions
@ -130,6 +130,14 @@ class ConfigController extends ActionController
->order('enabled', 'desc') ->order('enabled', 'desc')
->order('name') ->order('name')
->paginate(); ->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() public function moduleAction()

View File

@ -3,6 +3,8 @@
use Icinga\Module\Monitoring\Controller; use Icinga\Module\Monitoring\Controller;
use Icinga\Web\Url; use Icinga\Web\Url;
use Icinga\Web\Widget\Tabextension\DashboardAction;
use Icinga\Web\Widget\Tabextension\OutputFormat;
use Icinga\Application\Config; use Icinga\Application\Config;
use Icinga\Application\Logger; use Icinga\Application\Logger;
use Icinga\Data\ConfigObject; use Icinga\Data\ConfigObject;
@ -29,7 +31,7 @@ class ListController extends Controller
'list/' 'list/'
. str_replace(' ', '', $action) . str_replace(' ', '', $action)
) )
))->activate($action); ))->extend(new OutputFormat())->extend(new DashboardAction())->activate($action);
} }
/** /**
@ -52,5 +54,8 @@ class ListController extends Controller
'fields' => $pattern 'fields' => $pattern
))); )));
$this->view->logData = $resource->select()->order('DESC')->paginate(); $this->view->logData = $resource->select()->order('DESC')->paginate();
$this->setupLimitControl();
$this->setupPaginationControl($this->view->logData);
} }
} }

View File

@ -1,8 +1,12 @@
<?php if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs; ?>
<?= $this->paginationControl($modules) ?> <?= $this->sortBox; ?>
<?= $this->limiter; ?>
<?= $this->paginator; ?>
<?= $this->filterEditor; ?>
</div> </div>
<?php endif ?>
<div class="content"> <div class="content">
<table class="action" data-base-target="_next"> <table class="action" data-base-target="_next">
<tbody> <tbody>

View File

@ -1,9 +1,12 @@
<?php if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs->render($this) ?> <?= $this->tabs; ?>
<div style="margin-top: 1em"></div> <?= $this->sortBox; ?>
<?= $this->logData ?> <?= $this->limiter; ?>
<?= $this->paginator; ?>
<?= $this->filterEditor; ?>
</div> </div>
<?php endif ?>
<div class="content"> <div class="content">
<?php if ($this->logData !== null): ?> <?php if ($this->logData !== null): ?>
<table class="action"> <table class="action">

View File

@ -3,8 +3,10 @@
namespace Icinga\Web; namespace Icinga\Web;
use Zend_Paginator;
use Icinga\Web\Controller\ModuleActionController; use Icinga\Web\Controller\ModuleActionController;
use Icinga\Web\Widget\SortBox; use Icinga\Web\Widget\SortBox;
use Icinga\Web\Widget\Limiter;
/** /**
* This is the controller all modules should inherit from * This is the controller all modules should inherit from
@ -14,17 +16,77 @@ use Icinga\Web\Widget\SortBox;
class Controller extends ModuleActionController class Controller extends ModuleActionController
{ {
/** /**
* Create a sort control box at the 'sortControl' view parameter * 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 * @param array $columns An array containing the sort columns, with the
* submit value as the key and the label as the value * submit value as the key and the label as the value
*
* @return $this
*/ */
protected function setupSortControl(array $columns) protected function setupSortControl(array $columns)
{ {
if (! $this->view->compact) {
$req = $this->getRequest(); $req = $this->getRequest();
$this->view->sortControl = SortBox::create( $this->view->sortBox = SortBox::create(
'sortbox-' . $req->getActionName(), 'sortbox-' . $req->getActionName(),
$columns $columns
)->applyRequest($req); )->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;
}
} }

View File

@ -87,6 +87,7 @@ class ActionController extends Zend_Controller_Action
$this->_helper->layout()->isIframe = $request->getUrl()->shift('isIframe'); $this->_helper->layout()->isIframe = $request->getUrl()->shift('isIframe');
$this->_helper->layout()->moduleName = false; $this->_helper->layout()->moduleName = false;
$this->view->compact = $request->getParam('view') === 'compact';
if ($this->rerenderLayout = $request->getUrl()->shift('renderLayout')) { if ($this->rerenderLayout = $request->getUrl()->shift('renderLayout')) {
$this->xhrLayout = 'body'; $this->xhrLayout = 'body';
} }

View File

@ -26,7 +26,8 @@ class StyleSheet
'css/icinga/pagination.less', 'css/icinga/pagination.less',
'css/icinga/monitoring-colors.less', 'css/icinga/monitoring-colors.less',
'css/icinga/selection-toolbar.less', 'css/icinga/selection-toolbar.less',
'css/icinga/login.less' 'css/icinga/login.less',
'css/icinga/controls.less'
); );
public static function compileForPdf() public static function compileForPdf()

View File

@ -649,7 +649,7 @@ class FilterEditor extends AbstractWidget
public function renderSearch() public function renderSearch()
{ {
$html = ' <form method="post" class="inline dontprint" action="' $html = ' <form method="post" class="search inline dontprint" action="'
. $this->preservedUrl() . $this->preservedUrl()
. '"><input type="text" name="q" style="width: 8em" class="search" value="" placeholder="' . '"><input type="text" name="q" style="width: 8em" class="search" value="" placeholder="'
. t('Search...') . t('Search...')
@ -678,20 +678,22 @@ class FilterEditor extends AbstractWidget
public function render() public function render()
{ {
if (! $this->preservedUrl()->getParam('modifyFilter')) { if (! $this->preservedUrl()->getParam('modifyFilter')) {
return $this->renderSearch() . $this->shorten($this->filter, 50); return '<div class="filter">' . $this->renderSearch() . $this->shorten($this->filter, 50) . '</div>';
} }
return $this->renderSearch() return '<div class="filter">'
. $this->renderSearch()
. '<form action="' . '<form action="'
. Url::fromRequest() . Url::fromRequest()
. '" class="filterEditor" method="POST">' . '" class="editor" method="POST">'
. '<ul class="tree widgetFilter"><li>' . '<ul class="tree"><li>'
. $this->renderFilter($this->filter) . $this->renderFilter($this->filter)
. '</li></ul>' . '</li></ul>'
. '<div style="float: right">' . '<div class="buttons">'
. '<input type="submit" name="submit" value="Apply" />' . '<input type="submit" name="submit" value="Apply" />'
. '<input type="submit" name="cancel" value="Cancel" />' . '<input type="submit" name="cancel" value="Cancel" />'
. '</div>' . '</div>'
. '</form>'; . '</form>'
. '</div>';
} }
protected function shorten($string, $length) protected function shorten($string, $length)

View File

@ -3,20 +3,17 @@
namespace Icinga\Web\Widget; namespace Icinga\Web\Widget;
use Zend_Form_Element_Submit;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\Request; 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. * The "SortBox" Widget allows you to create a generic sort input for sortable views. It automatically creates a form
* It automatically creates a form containing a select box with all sort options and a * containing a select box with all sort options and a dropbox with the sort direction. It also handles automatic
* dropbox with the sort direction. It also handles automatic submission of sorting changes and draws an additional * submission of sorting changes and draws an additional submit button when JavaScript is disabled.
* 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 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 * 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. * to make sure the form is correctly populated when a request with a sort parameter is being made.
* *
@ -28,39 +25,35 @@ use Icinga\Web\Form\Decorator\ConditionalHidden;
* ); * );
* $this->view->sortControl->applyRequest($this->getRequest()); * $this->view->sortControl->applyRequest($this->getRequest());
* </code></pre> * </code></pre>
* By default the sortBox uses the GET parameter 'sort' for the sorting key and 'dir' for the sorting direction
*
*/ */
class SortBox extends AbstractWidget class SortBox extends AbstractWidget
{ {
/** /**
* An array containing all sort columns with their associated labels * An array containing all sort columns with their associated labels
* *
* @var array * @var array
*/ */
private $sortFields; protected $sortFields;
/** /**
* The name of the form that will be created * The name of the form that will be created
* *
* @var string * @var string
*/ */
private $name; protected $name;
/** /**
* A request object used for initial form population * 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 * Create a SortBox with the entries from $sortFields
* *
* @param string $name The name of the sort form * @param string $name The name for the SortBox
* @param array $sortFields An array containing the columns and their labels to be displayed * @param array $sortFields An array containing the columns and their labels to be displayed in the SortBox
* in the sort select box
*/ */
public function __construct($name, array $sortFields) 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 string $name The name for the SortBox
* @param array $sortFields An array containing the columns and their labels to be displayed * @param array $sortFields An array containing the columns and their labels to be displayed in the SortBox
* in the sort select box
* *
* @return static * @return SortBox
*/ */
public static function create($name, array $sortFields) public static function create($name, array $sortFields)
{ {
@ -96,60 +88,49 @@ class SortBox extends AbstractWidget
} }
/** /**
* Create a submit button that is hidden via the ConditionalDecorator * Render this SortBox as HTML
* 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
* *
* @return string * @return string
*/ */
public function render() public function render()
{ {
$form = new Form(); $form = new Form();
$form->setAttrib('class', 'inline');
$form->setMethod('POST');
$form->setTokenDisabled(); $form->setTokenDisabled();
$form->setName($this->name); $form->setName($this->name);
$form->addElement('select', 'sort', array( $form->setAttrib('class', 'sort-control inline');
'label' => 'Sort By',
'multiOptions' => $this->sortFields, $form->addElement(
'style' => 'width: 12em', 'select',
'autosubmit' => true '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( $form->addElement(
'select',
'dir',
array(
'autosubmit' => true,
'multiOptions' => array( 'multiOptions' => array(
'asc' => 'Asc', 'asc' => 'Asc',
'desc' => 'Desc', 'desc' => 'Desc',
), ),
'style' => 'width: 5em', 'decorators' => array(
'autosubmit' => true array('ViewHelper')
)); )
$sort = $form->getElement('sort')->setDecorators(array('ViewHelper')); )
$dir = $form->getElement('dir')->setDecorators(array('ViewHelper')); );
if ($this->request) { if ($this->request) {
$form->populate($this->request->getParams()); $form->populate($this->request->getParams());
} }
return $form; return $form;
} }
} }

View File

@ -1,6 +1,7 @@
<div class="controls"></div> <div class="controls">
<?= /** @var \Icinga\Web\Widget\Tabs $tabs */ $tabs->showOnlyCloseButton(); ?> <?= /** @var \Icinga\Web\Widget\Tabs $tabs */ $tabs->showOnlyCloseButton(); ?>
<h1><?= $this->translate('Available documentations'); ?></h1> <h1><?= $this->translate('Available documentations'); ?></h1>
</div>
<div class="content"> <div class="content">
<ul> <ul>
<li><?= $this->qlink( <li><?= $this->qlink(

View File

@ -6,6 +6,7 @@ use Icinga\Chart\Unit\LinearUnit;
use Icinga\Chart\Unit\StaticAxis; use Icinga\Chart\Unit\StaticAxis;
use Icinga\Module\Monitoring\Controller; use Icinga\Module\Monitoring\Controller;
use Icinga\Module\Monitoring\Web\Widget\SelectBox; use Icinga\Module\Monitoring\Web\Widget\SelectBox;
use Icinga\Web\Widget\Tabextension\DashboardAction;
use Icinga\Web\Url; use Icinga\Web\Url;
class Monitoring_AlertsummaryController extends Controller class Monitoring_AlertsummaryController extends Controller
@ -44,7 +45,7 @@ class Monitoring_AlertsummaryController extends Controller
'label' => $this->translate('Alert Summary'), 'label' => $this->translate('Alert Summary'),
'url' => Url::fromRequest() 'url' => Url::fromRequest()
) )
)->activate('alertsummary'); )->extend(new DashboardAction())->activate('alertsummary');
$this->view->title = $this->translate('Alert Summary'); $this->view->title = $this->translate('Alert Summary');
$this->view->intervalBox = $this->createIntervalBox(); $this->view->intervalBox = $this->createIntervalBox();
@ -69,8 +70,10 @@ class Monitoring_AlertsummaryController extends Controller
'notification_state' 'notification_state'
) )
); );
$this->view->notifications = $query->paginate(); $this->view->notifications = $query->paginate();
$this->setupLimitControl();
$this->setupPaginationControl($this->view->notifications);
} }
/** /**

View File

@ -16,11 +16,6 @@ use Icinga\Chart\Unit\LinearUnit;
class Monitoring_ChartController extends Controller class Monitoring_ChartController extends Controller
{ {
public function init()
{
$this->view->compact = $this->_request->getParam('view') === 'compact';
}
private function drawLogChart1() private function drawLogChart1()
{ {
$chart = new GridChart(); $chart = new GridChart();

View File

@ -15,6 +15,7 @@ use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\HostList; use Icinga\Module\Monitoring\Object\HostList;
use Icinga\Web\Url; use Icinga\Web\Url;
use Icinga\Web\Widget\Chart\InlinePie; use Icinga\Web\Widget\Chart\InlinePie;
use Icinga\Web\Widget\Tabextension\DashboardAction;
class Monitoring_HostsController extends Controller class Monitoring_HostsController extends Controller
{ {
@ -26,7 +27,7 @@ class Monitoring_HostsController extends Controller
public function init() public function init()
{ {
$hostList = new HostList($this->backend); $hostList = new HostList($this->backend);
$hostList->setFilter(Filter::fromQueryString((string) $this->params)); $hostList->setFilter(Filter::fromQueryString((string) $this->params->without('view')));
$this->hostList = $hostList; $this->hostList = $hostList;
} }
@ -80,7 +81,7 @@ class Monitoring_HostsController extends Controller
'label' => $this->translate('Hosts'), 'label' => $this->translate('Hosts'),
'url' => Url::fromRequest() 'url' => Url::fromRequest()
) )
)->activate('show'); )->extend(new DashboardAction())->activate('show');
$this->setAutorefreshInterval(15); $this->setAutorefreshInterval(15);
$checkNowForm = new CheckNowCommandForm(); $checkNowForm = new CheckNowCommandForm();
$checkNowForm $checkNowForm

View File

@ -21,11 +21,6 @@ class Monitoring_ListController extends Controller
public function init() public function init()
{ {
$this->createTabs(); $this->createTabs();
$this->view->compact = $this->_request->getParam('view') === 'compact';
if ($this->_request->getParam('view') === 'inline') {
$this->view->compact = true;
$this->view->inline = true;
}
} }
/** /**
@ -122,18 +117,8 @@ class Monitoring_ListController extends Controller
'host_current_check_attempt', 'host_current_check_attempt',
'host_max_check_attempts' 'host_max_check_attempts'
), $this->extraColumns())); ), $this->extraColumns()));
$this->filterQuery($query); $this->filterQuery($query);
$this->applyRestriction('monitoring/hosts/filter', $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->hosts = $query->paginate();
$this->view->stats = $this->backend->select()->from('statusSummary', array( $this->view->stats = $this->backend->select()->from('statusSummary', array(
@ -147,6 +132,16 @@ class Monitoring_ListController extends Controller
'hosts_unreachable_unhandled', 'hosts_unreachable_unhandled',
'hosts_pending', 'hosts_pending',
))->getQuery()->fetchRow(); ))->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')
));
} }
/** /**
@ -210,11 +205,12 @@ class Monitoring_ListController extends Controller
'max_check_attempts' => 'service_max_check_attempts' 'max_check_attempts' => 'service_max_check_attempts'
), $this->extraColumns()); ), $this->extraColumns());
$query = $this->backend->select()->from('serviceStatus', $columns); $query = $this->backend->select()->from('serviceStatus', $columns);
$this->filterQuery($query); $this->filterQuery($query);
$this->applyRestriction('monitoring/services/filter', $query); $this->applyRestriction('monitoring/services/filter', $query);
$this->view->services = $query->paginate();
$this->setupLimitControl();
$this->setupPaginationControl($this->view->services);
$this->setupSortControl(array( $this->setupSortControl(array(
'service_severity' => $this->translate('Service Severity'), 'service_severity' => $this->translate('Service Severity'),
'service_state' => $this->translate('Current Service State'), 'service_state' => $this->translate('Current Service State'),
@ -226,14 +222,6 @@ class Monitoring_ListController extends Controller
'host_address' => $this->translate('Host Address'), 'host_address' => $this->translate('Host Address'),
'host_last_check' => $this->translate('Last Host Check') '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( $this->view->stats = $this->backend->select()->from('statusSummary', array(
'services_total', 'services_total',
@ -252,7 +240,6 @@ class Monitoring_ListController extends Controller
'services_unknown_handled', 'services_unknown_handled',
'services_pending', 'services_pending',
))->getQuery()->fetchRow(); ))->getQuery()->fetchRow();
} }
/** /**
@ -263,8 +250,10 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab('downtimes', $this->translate('Downtimes'), $this->translate('List downtimes')); $this->addTitleTab('downtimes', $this->translate('Downtimes'), $this->translate('List downtimes'));
$this->setAutorefreshInterval(12); $this->setAutorefreshInterval(12);
$query = $this->backend->select()->from('downtime', array( $query = $this->backend->select()->from('downtime', array(
'id' => 'downtime_internal_id', 'id' => 'downtime_internal_id',
'objecttype' => 'downtime_objecttype', 'objecttype' => 'downtime_objecttype',
@ -286,9 +275,11 @@ class Monitoring_ListController extends Controller
'host_display_name', 'host_display_name',
'service_display_name' 'service_display_name'
)); ));
$this->filterQuery($query); $this->filterQuery($query);
$this->view->downtimes = $query->paginate();
$this->setupLimitControl();
$this->setupPaginationControl($this->view->downtimes);
$this->setupSortControl(array( $this->setupSortControl(array(
'downtime_is_in_effect' => $this->translate('Is In Effect'), 'downtime_is_in_effect' => $this->translate('Is In Effect'),
'host_display_name' => $this->translate('Host'), 'host_display_name' => $this->translate('Host'),
@ -302,8 +293,6 @@ class Monitoring_ListController extends Controller
'downtime_duration' => $this->translate('Duration') 'downtime_duration' => $this->translate('Duration')
)); ));
$this->view->downtimes = $query->paginate();
if ($this->Auth()->hasPermission('monitoring/command/downtime/delete')) { if ($this->Auth()->hasPermission('monitoring/command/downtime/delete')) {
$this->view->delDowntimeForm = new DeleteDowntimeCommandForm(); $this->view->delDowntimeForm = new DeleteDowntimeCommandForm();
} }
@ -317,12 +306,14 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab( $this->addTitleTab(
'notifications', 'notifications',
$this->translate('Notifications'), $this->translate('Notifications'),
$this->translate('List notifications') $this->translate('List notifications')
); );
$this->setAutorefreshInterval(15); $this->setAutorefreshInterval(15);
$query = $this->backend->select()->from('notification', array( $query = $this->backend->select()->from('notification', array(
'host_name', 'host_name',
'service_description', 'service_description',
@ -335,6 +326,9 @@ class Monitoring_ListController extends Controller
)); ));
$this->filterQuery($query); $this->filterQuery($query);
$this->view->notifications = $query->paginate(); $this->view->notifications = $query->paginate();
$this->setupLimitControl();
$this->setupPaginationControl($this->view->notifications);
$this->setupSortControl(array( $this->setupSortControl(array(
'notification_start_time' => $this->translate('Notification Start') 'notification_start_time' => $this->translate('Notification Start')
)); ));
@ -345,7 +339,9 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab('contacts', $this->translate('Contacts'), $this->translate('List contacts')); $this->addTitleTab('contacts', $this->translate('Contacts'), $this->translate('List contacts'));
$query = $this->backend->select()->from('contact', array( $query = $this->backend->select()->from('contact', array(
'contact_name', 'contact_name',
'contact_id', 'contact_id',
@ -369,6 +365,8 @@ class Monitoring_ListController extends Controller
$this->filterQuery($query); $this->filterQuery($query);
$this->view->contacts = $query->paginate(); $this->view->contacts = $query->paginate();
$this->setupLimitControl();
$this->setupPaginationControl($this->view->contacts);
$this->setupSortControl(array( $this->setupSortControl(array(
'contact_name' => $this->translate('Name'), 'contact_name' => $this->translate('Name'),
'contact_alias' => $this->translate('Alias'), 'contact_alias' => $this->translate('Alias'),
@ -426,11 +424,13 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab( $this->addTitleTab(
'contactgroups', 'contactgroups',
$this->translate('Contact Groups'), $this->translate('Contact Groups'),
$this->translate('List contact groups') $this->translate('List contact groups')
); );
$query = $this->backend->select()->from('contactgroup', array( $query = $this->backend->select()->from('contactgroup', array(
'contactgroup_name', 'contactgroup_name',
'contactgroup_alias', 'contactgroup_alias',
@ -438,7 +438,7 @@ class Monitoring_ListController extends Controller
'contact_alias', 'contact_alias',
'contact_email', 'contact_email',
'contact_pager', 'contact_pager',
))->order('contactgroup_alias'); ));
$this->filterQuery($query); $this->filterQuery($query);
// Fetch and prepare all contact groups: // Fetch and prepare all contact groups:
@ -455,6 +455,11 @@ class Monitoring_ListController extends Controller
} }
// TODO: Find a better naming // TODO: Find a better naming
$this->view->groupData = $groupData; $this->view->groupData = $groupData;
$this->setupSortControl(array(
'contactgroup_name' => $this->translate('Contactgroup Name'),
'contactgroup_alias' => $this->translate('Contactgroup Alias')
));
} }
public function commentsAction() public function commentsAction()
@ -462,8 +467,10 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab('comments', $this->translate('Comments'), $this->translate('List comments')); $this->addTitleTab('comments', $this->translate('Comments'), $this->translate('List comments'));
$this->setAutorefreshInterval(12); $this->setAutorefreshInterval(12);
$query = $this->backend->select()->from('comment', array( $query = $this->backend->select()->from('comment', array(
'id' => 'comment_internal_id', 'id' => 'comment_internal_id',
'objecttype' => 'comment_objecttype', 'objecttype' => 'comment_objecttype',
@ -481,6 +488,8 @@ class Monitoring_ListController extends Controller
$this->filterQuery($query); $this->filterQuery($query);
$this->view->comments = $query->paginate(); $this->view->comments = $query->paginate();
$this->setupLimitControl();
$this->setupPaginationControl($this->view->comments);
$this->setupSortControl( $this->setupSortControl(
array( array(
'comment_timestamp' => $this->translate('Comment Timestamp'), 'comment_timestamp' => $this->translate('Comment Timestamp'),
@ -501,12 +510,14 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab( $this->addTitleTab(
'servicegroups', 'servicegroups',
$this->translate('Service Groups'), $this->translate('Service Groups'),
$this->translate('List service groups') $this->translate('List service groups')
); );
$this->setAutorefreshInterval(12); $this->setAutorefreshInterval(12);
$query = $this->backend->select()->from('groupsummary', array( $query = $this->backend->select()->from('groupsummary', array(
'servicegroup_name', 'servicegroup_name',
'servicegroup_alias', 'servicegroup_alias',
@ -538,6 +549,9 @@ class Monitoring_ListController extends Controller
// service groups. We should separate them. // service groups. We should separate them.
$this->filterQuery($query); $this->filterQuery($query);
$this->view->servicegroups = $query->paginate(); $this->view->servicegroups = $query->paginate();
$this->setupLimitControl();
$this->setupPaginationControl($this->view->servicegroups);
$this->setupSortControl(array( $this->setupSortControl(array(
'services_severity' => $this->translate('Severity'), 'services_severity' => $this->translate('Severity'),
'servicegroup_alias' => $this->translate('Service Group Name'), 'servicegroup_alias' => $this->translate('Service Group Name'),
@ -555,8 +569,10 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab('hostgroups', $this->translate('Host Groups'), $this->translate('List host groups')); $this->addTitleTab('hostgroups', $this->translate('Host Groups'), $this->translate('List host groups'));
$this->setAutorefreshInterval(12); $this->setAutorefreshInterval(12);
$query = $this->backend->select()->from('groupsummary', array( $query = $this->backend->select()->from('groupsummary', array(
'hostgroup_name', 'hostgroup_name',
'hostgroup_alias', 'hostgroup_alias',
@ -588,6 +604,9 @@ class Monitoring_ListController extends Controller
// service groups. We should separate them. // service groups. We should separate them.
$this->filterQuery($query); $this->filterQuery($query);
$this->view->hostgroups = $query->paginate(); $this->view->hostgroups = $query->paginate();
$this->setupLimitControl();
$this->setupPaginationControl($this->view->hostgroups);
$this->setupSortControl(array( $this->setupSortControl(array(
'services_severity' => $this->translate('Severity'), 'services_severity' => $this->translate('Severity'),
'hostgroup_alias' => $this->translate('Host Group Name'), 'hostgroup_alias' => $this->translate('Host Group Name'),
@ -605,6 +624,7 @@ class Monitoring_ListController extends Controller
if ($url = $this->hasBetterUrl()) { if ($url = $this->hasBetterUrl()) {
return $this->redirectNow($url); return $this->redirectNow($url);
} }
$this->addTitleTab( $this->addTitleTab(
'eventhistory', 'eventhistory',
$this->translate('Event Overview'), $this->translate('Event Overview'),
@ -626,11 +646,13 @@ class Monitoring_ListController extends Controller
)); ));
$this->filterQuery($query); $this->filterQuery($query);
$this->view->history = $query->paginate();
$this->setupLimitControl();
$this->setupPaginationControl($this->view->history);
$this->setupSortControl(array( $this->setupSortControl(array(
'timestamp' => $this->translate('Occurence') 'timestamp' => $this->translate('Occurence')
)); ));
$this->view->history = $query->paginate();
} }
public function servicegridAction() public function servicegridAction()
@ -667,7 +689,7 @@ class Monitoring_ListController extends Controller
->handleRequest($this->getRequest()); ->handleRequest($this->getRequest());
$query->applyFilter($editor->getFilter()); $query->applyFilter($editor->getFilter());
$this->view->filterEditor = $editor; $this->setupFilterControl($editor);
$this->view->filter = $editor->getFilter(); $this->view->filter = $editor->getFilter();
if ($sort = $this->params->get('sort')) { if ($sort = $this->params->get('sort')) {
@ -706,15 +728,6 @@ class Monitoring_ListController extends Controller
*/ */
private function createTabs() private function createTabs()
{ {
$tabs = $this->getTabs(); $this->getTabs()->extend(new OutputFormat())->extend(new DashboardAction());
if (in_array($this->_request->getActionName(), array(
'hosts',
'services',
'eventhistory',
'eventgrid',
'notifications'
))) {
$tabs->extend(new OutputFormat())->extend(new DashboardAction());
}
} }
} }

View File

@ -1,6 +1,7 @@
<?php <?php
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ /* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
use Icinga\Web\Widget\Tabextension\DashboardAction;
use Icinga\Module\Monitoring\Controller; use Icinga\Module\Monitoring\Controller;
use Icinga\Module\Monitoring\Forms\Command\Instance\DisableNotificationsExpireCommandForm; use Icinga\Module\Monitoring\Forms\Command\Instance\DisableNotificationsExpireCommandForm;
use Icinga\Module\Monitoring\Forms\Command\Instance\ToggleInstanceFeaturesCommandForm; use Icinga\Module\Monitoring\Forms\Command\Instance\ToggleInstanceFeaturesCommandForm;
@ -29,7 +30,7 @@ class Monitoring_ProcessController extends Controller
'label' => $this->translate('Monitoring Health'), 'label' => $this->translate('Monitoring Health'),
'url' =>'monitoring/process/info' 'url' =>'monitoring/process/info'
) )
); )->extend(new DashboardAction());
} }
/** /**

View File

@ -16,6 +16,7 @@ use Icinga\Module\Monitoring\Object\Service;
use Icinga\Module\Monitoring\Object\ServiceList; use Icinga\Module\Monitoring\Object\ServiceList;
use Icinga\Web\Url; use Icinga\Web\Url;
use Icinga\Web\Widget\Chart\InlinePie; use Icinga\Web\Widget\Chart\InlinePie;
use Icinga\Web\Widget\Tabextension\DashboardAction;
class Monitoring_ServicesController extends Controller class Monitoring_ServicesController extends Controller
{ {
@ -27,7 +28,9 @@ class Monitoring_ServicesController extends Controller
public function init() public function init()
{ {
$serviceList = new ServiceList($this->backend); $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(array('service_problem', 'service_handled', 'view'))
));
$this->serviceList = $serviceList; $this->serviceList = $serviceList;
} }
@ -101,7 +104,7 @@ class Monitoring_ServicesController extends Controller
'label' => $this->translate('Services'), 'label' => $this->translate('Services'),
'url' => Url::fromRequest() 'url' => Url::fromRequest()
) )
)->activate('show'); )->extend(new DashboardAction())->activate('show');
$this->setAutorefreshInterval(15); $this->setAutorefreshInterval(15);
$checkNowForm = new CheckNowCommandForm(); $checkNowForm = new CheckNowCommandForm();
$checkNowForm $checkNowForm

View File

@ -73,6 +73,9 @@ class Monitoring_ShowController extends Controller
$this->view->history = $this->view->object->eventhistory->getQuery()->paginate($this->params->get('limit', 50)); $this->view->history = $this->view->object->eventhistory->getQuery()->paginate($this->params->get('limit', 50));
$this->handleFormatRequest($this->view->object->eventhistory); $this->handleFormatRequest($this->view->object->eventhistory);
$this->fetchHostStats(); $this->fetchHostStats();
$this->setupLimitControl();
$this->setupPaginationControl($this->view->history);
} }
public function servicesAction() public function servicesAction()
@ -142,9 +145,7 @@ class Monitoring_ShowController extends Controller
'contact_notify_host_flapping', 'contact_notify_host_flapping',
'contact_notify_host_downtime', 'contact_notify_host_downtime',
)); ));
$query->where('contact_name', $contactName); $query->where('contact_name', $contactName);
$contact = $query->getQuery()->fetchRow(); $contact = $query->getQuery()->fetchRow();
if ($contact) { if ($contact) {
@ -167,9 +168,9 @@ class Monitoring_ShowController extends Controller
)); ));
$notifications->where('contact_object_id', $contact->contact_object_id); $notifications->where('contact_object_id', $contact->contact_object_id);
$this->view->compact = true;
$this->view->notifications = $notifications->paginate(); $this->view->notifications = $notifications->paginate();
$this->setupLimitControl();
$this->setupPaginationControl($this->view->notifications);
} }
$this->view->contact = $contact; $this->view->contact = $contact;

View File

@ -2,6 +2,7 @@
/* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ /* Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
use Icinga\Module\Monitoring\Controller as MonitoringController; use Icinga\Module\Monitoring\Controller as MonitoringController;
use Icinga\Web\Widget\Tabextension\DashboardAction;
use Icinga\Web\Url; use Icinga\Web\Url;
class Monitoring_TacticalController extends MonitoringController class Monitoring_TacticalController extends MonitoringController
@ -18,7 +19,7 @@ class Monitoring_TacticalController extends MonitoringController
'label' => $this->translate('Tactical Overview'), 'label' => $this->translate('Tactical Overview'),
'url' => Url::fromRequest() 'url' => Url::fromRequest()
) )
)->activate('tactical_overview'); )->extend(new DashboardAction())->activate('tactical_overview');
$this->view->statusSummary = $this->backend->select()->from( $this->view->statusSummary = $this->backend->select()->from(
'statusSummary', 'statusSummary',

View File

@ -10,6 +10,7 @@ use Icinga\Module\Monitoring\Controller;
use Icinga\Module\Monitoring\Timeline\TimeLine; use Icinga\Module\Monitoring\Timeline\TimeLine;
use Icinga\Module\Monitoring\Timeline\TimeRange; use Icinga\Module\Monitoring\Timeline\TimeRange;
use Icinga\Module\Monitoring\Web\Widget\SelectBox; use Icinga\Module\Monitoring\Web\Widget\SelectBox;
use Icinga\Web\Widget\Tabextension\DashboardAction;
class Monitoring_TimelineController extends Controller class Monitoring_TimelineController extends Controller
{ {
@ -22,7 +23,7 @@ class Monitoring_TimelineController extends Controller
'label' => $this->translate('Timeline'), 'label' => $this->translate('Timeline'),
'url' => Url::fromRequest() 'url' => Url::fromRequest()
) )
)->activate('timeline'); )->extend(new DashboardAction())->activate('timeline');
$this->view->title = $this->translate('Timeline'); $this->view->title = $this->translate('Timeline');
// TODO: filter for hard_states (precedence adjustments necessary!) // TODO: filter for hard_states (precedence adjustments necessary!)

View File

@ -1,12 +1,13 @@
<?php if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs; ?>
<div style="margin: 1em;" class="dontprint"> <div style="float: right;" class="dontprint">
<?= $intervalBox; ?> <?= $intervalBox; ?>
</div> </div>
<?= $this->widget('limiter') ?> <?= $this->limiter; ?>
<?= $this->paginationControl($notifications, null, null, array('preserve' => $this->preserve)) ?> <?= $this->paginator; ?>
</div> </div>
<?php endif ?>
<div class="content alertsummary"> <div class="content alertsummary">
<!-- <h1><?= $this->translate('Alert summary'); ?></h1> --> <!-- <h1><?= $this->translate('Alert summary'); ?></h1> -->
@ -59,8 +60,7 @@
<div class="alertsummary-flex"> <div class="alertsummary-flex">
<?= $this->partial('list/notifications.phtml', array( <?= $this->partial('list/notifications.phtml', array(
'notifications' => $this->recentAlerts, 'notifications' => $this->recentAlerts,
'compact' => true, 'compact' => true
'inline' => true
)); ?> )); ?>
</div> </div>
</div> </div>
@ -71,8 +71,7 @@
<div class="alertsummary-flex"> <div class="alertsummary-flex">
<?= $this->partial('list/notifications.phtml', array( <?= $this->partial('list/notifications.phtml', array(
'notifications' => $this->notifications, 'notifications' => $this->notifications,
'compact' => true, 'compact' => true
'inline' => true
)); ?> )); ?>
</div> </div>
</div> </div>

View File

@ -1,4 +1,7 @@
<div class="controls"> <div class="controls">
<?php if (! $this->compact): ?>
<?= $this->tabs; ?>
<?php endif ?>
<?= $this->render('partials/host/object-header.phtml') ?> <?= $this->render('partials/host/object-header.phtml') ?>
<?= $this->render('partials/host/servicesummary.phtml') ?> <?= $this->render('partials/host/servicesummary.phtml') ?>
</div> </div>

View File

@ -1,9 +1,12 @@
<div class="controls"> <div class="controls">
<?php if (! $this->compact): ?>
<?= $tabs; ?>
<?php endif ?>
<?= $this->render('partials/host/objects-header.phtml'); ?> <?= $this->render('partials/host/objects-header.phtml'); ?>
</div> </div>
<div class="content"> <div class="content">
<?php if (($hostCount = count($objects)) === 0): ?> <?php if (($hostCount = count($objects)) === 0): ?>
<?= $this->translate('No hosts matching the filter'); ?> <?= $this->translate('No hosts found matching the filter'); ?>
<?php else: ?> <?php else: ?>
<h3><?= sprintf($this->translatePlural('%u Host', '%u Hosts', $hostCount), $hostCount); ?></h3> <h3><?= sprintf($this->translatePlural('%u Host', '%u Hosts', $hostCount), $hostCount); ?></h3>
<div><?= $this->qlink( <div><?= $this->qlink(

View File

@ -1,20 +1,20 @@
<?php if (false === $this->compact): ?> <?php if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs->render($this); ?> <?= $this->tabs; ?>
<div style="margin: 1em" class="dontprint"> <?= $this->sortBox; ?>
<?= $this->translate('Sort by'); ?> <?= $this->sortControl->render($this); ?> <?= $this->limiter; ?>
</div> <?= $this->paginator; ?>
<?= $this->widget('limiter', array('url' => $this->url, 'max' => $comments->count())); ?> <?= $this->filterEditor; ?>
<?= $this->paginationControl($comments, null, null, array('preserve' => $this->preserve)); ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<?php if (count($comments) === 0): ?> <?php
<?= $this->translate('No comments matching the filter'); ?>
</div>
<?php return; endif ?>
if (count($comments) === 0) {
echo $this->translate('No comments found matching the filter') . '</div>';
return;
}
?>
<table data-base-target="_next" class="action comments"> <table data-base-target="_next" class="action comments">
<tbody> <tbody>
<?php foreach ($comments as $comment): ?> <?php foreach ($comments as $comment): ?>

View File

@ -1,17 +1,22 @@
<?php if (! $this->compact): ?> <?php if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs; ?>
<?= $this->sortBox; ?>
<?= $this->limiter; ?>
<?= $this->paginator; ?>
<?= $this->filterEditor; ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<div class="boxview" data-base-target="_next">
<?php <?php
if (count($groupData) === 0) {
echo mt('monitoring', 'No contacts matching the filter');
}
foreach ($groupData as $groupName => $groupInfo): ?> if (count($groupData) === 0) {
echo $this->translate('No contactgroups found matching the filter') . '</div>';
return;
}
?>
<div class="boxview" data-base-target="_next">
<?php foreach ($groupData as $groupName => $groupInfo): ?>
<div class="box contactgroup"> <div class="box contactgroup">
<h2><?= $groupInfo['alias']; ?></h2> <h2><?= $groupInfo['alias']; ?></h2>
<?php if ($groupInfo['alias'] !== $groupName): ?> <?php if ($groupInfo['alias'] !== $groupName): ?>

View File

@ -1,18 +1,21 @@
<?php if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs; ?>
<div style="margin: 1em"> <?= $this->sortBox; ?>
<?= $this->sortControl->render($this); ?> <?= $this->limiter; ?>
<?= $this->paginator; ?>
<?= $this->filterEditor; ?>
</div> </div>
<?= $this->paginationControl($contacts, null, null, array('preserve' => $this->preserve)); ?> <?php endif ?>
</div>
<div data-base-target="_next" class="content contacts"> <div data-base-target="_next" class="content contacts">
<?php <?php
if (count($contacts) === 0) { if (count($contacts) === 0) {
echo $this->translate('No contacts matching the filter'); echo $this->translate('No contacts found matching the filter') . '</div>';
return; return;
} }
foreach ($contacts as $contact): ?> ?>
<?php foreach ($contacts as $contact): ?>
<div class="contact"> <div class="contact">
<?= $this->img('/static/gravatar', array('email' => $contact->contact_email)); ?> <?= $this->img('/static/gravatar', array('email' => $contact->contact_email)); ?>
<strong><?= $this->qlink( <strong><?= $this->qlink(

View File

@ -1,30 +1,24 @@
<?php <?php
use Icinga\Module\Monitoring\Object\Host; use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service; use Icinga\Module\Monitoring\Object\Service;
?> if (! $this->compact): ?>
<?php if (false === $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs->render($this); ?> <?= $this->tabs; ?>
<div style="margin: 1em" class="dontprint"> <?= $this->sortBox; ?>
<?= $this->translate('Sort by'); ?> <?= $this->sortControl->render($this); ?> <?= $this->limiter; ?>
<?php if (! $this->filterEditor): ?> <?= $this->paginator; ?>
<?= $this->filterPreview ?> <?= $this->filterEditor; ?>
<?php endif; ?>
</div>
<?= $this->widget('limiter', array('url' => $this->url, 'max' => $downtimes->count())); ?>
<?= $this->paginationControl($downtimes, null, null, array('preserve' => $this->preserve)); ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<?= $this->filterEditor ?> <?php
<?php if (count($downtimes) === 0): ?>
<?= $this->translate('No active downtimes'); ?> if (count($downtimes) === 0) {
</div> echo $this->translate('No downtimes found matching the filter') . '</div>';
<?php return; endif ?> return;
}
?>
<table data-base-target="_next" class="action"> <table data-base-target="_next" class="action">
<tbody> <tbody>

View File

@ -1,21 +1,25 @@
<?php <?php
use Icinga\Data\Filter\Filter; use Icinga\Data\Filter\Filter;
use Icinga\Web\Widget\Chart\HistoryColorGrid; use Icinga\Web\Widget\Chart\HistoryColorGrid;
?>
if (! $this->compact): ?>
<? if (! $compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs->render($this); ?> <?= $this->tabs; ?>
<div class="fake-controls"> <?= $this->sortBox; ?>
<?= $form ?> <?= $this->limiter; ?>
<?= $this->paginator; ?>
<?= $this->filterEditor; ?>
<?= $form; ?>
</div> </div>
</div> <?php endif ?>
<? endif; ?>
<div class="content" data-base-target="_next"> <div class="content" data-base-target="_next">
<?php <?php
if (count($summary) === 0) {
echo $this->translate('No state changes in the selected time period.') . '</div>';
return;
}
$settings = array( $settings = array(
'cnt_up' => array( 'cnt_up' => array(
'tooltip' => $this->translate('%d hosts ok on %s'), 'tooltip' => $this->translate('%d hosts ok on %s'),
@ -63,11 +67,8 @@ $to = intval($form->getValue('to', time()));
if ($to - $from > 315360000) { if ($to - $from > 315360000) {
$from = $to - 315360000; $from = $to - 315360000;
} }
$data = array();
if (count($summary) === 0) { $data = array();
echo $this->translate('No state changes in the selected time period.');
}
foreach ($summary as $entry) { foreach ($summary as $entry) {
$day = $entry->day; $day = $entry->day;
$value = $entry->$column; $value = $entry->$column;

View File

@ -1,32 +1,23 @@
<?php <?php
use Icinga\Module\Monitoring\Object\Host; use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service; use Icinga\Module\Monitoring\Object\Service;
?> if (! $this->compact): ?>
<?php if (false === $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs; ?>
<div style="margin: 1em" class="dontprint"> <?= $this->sortBox; ?>
<div style="float: right"> <?= $this->limiter; ?>
<?= $this->translate('Sort by') ?> <?= $this->sortControl ?> <?= $this->paginator; ?>
</div> <?= $this->filterEditor; ?>
</div>
<?= $this->widget('limiter', array('url' => $this->url, 'max' => $this->history->count())); ?>
<?= $this->paginationControl($history, null, null, array('preserve' => $this->preserve)); ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<?= $this->filterEditor ?> <?php
<?php if (count($history) === 0): ?> if (count($history) === 0) {
<?= $this->translate('No history events matching the filter') ?> echo $this->translate('No history events found matching the filter') . '</div>';
</div> return;
<?php return; endif ?> }
?>
<table data-base-target="_next" class="action"> <table data-base-target="_next" class="action">
<tbody> <tbody>
<?php foreach ($history as $event): ?> <?php foreach ($history as $event): ?>

View File

@ -1,21 +1,17 @@
<?php if ($this->compact): ?> <?php if (! $this->compact): ?>
<div class="content">
<?php else: ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs; ?>
<div style="margin: 1em;" class="dontprint"> <?= $this->sortBox; ?>
<?= $this->translate('Sort by'); ?> <?= $this->sortControl->render($this); ?> <?= $this->limiter; ?>
</div> <?= $this->paginator; ?>
<?= $this->widget('limiter')->setMaxLimit(count($hostgroups)); ?>
<?= $this->paginationControl($hostgroups, null, null, array('preserve' => $this->preserve)); ?>
</div>
<div class="content">
<?= $this->filterEditor; ?> <?= $this->filterEditor; ?>
</div>
<?php endif ?> <?php endif ?>
<div class="content">
<?php <?php
if (count($hostgroups) === 0) { if (count($hostgroups) === 0) {
echo $this->translate('No host groups matching the filter'); echo $this->translate('No hostgroups found matching the filter') . '</div>';
echo '</div>';
return; return;
} }
?> ?>

View File

@ -1,33 +1,25 @@
<?php <?php
use Icinga\Module\Monitoring\Object\Host; use Icinga\Module\Monitoring\Object\Host;
if ($this->compact): ?> if (! $this->compact): ?>
<div class="content">
<?php else: ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs; ?>
<div style="margin: 1em;" class="dontprint"> <div class="dontprint">
<?= $this->render('list/components/selectioninfo.phtml') ?> <?= $this->render('list/components/selectioninfo.phtml'); ?>
<?= $this->render('list/components/hostssummary.phtml') ?> <?= $this->render('list/components/hostssummary.phtml'); ?>
<?= $this->translate('Sort by') ?> <?= $this->sortControl->render($this) ?>
</div> </div>
<?= $this->sortBox; ?>
<?= $this->widget('limiter')->setMaxLimit($this->hosts->count()) ?> <?= $this->limiter; ?>
<?= $this->paginationControl($hosts, null, null, array('preserve' => $this->preserve)) ?> <?= $this->paginator; ?>
<?= $this->selectionToolbar('multi', $this->href('monitoring/hosts/show?' . $this->filter->toQueryString())) ?> <?= $this->selectionToolbar('multi', $this->href('monitoring/hosts/show?' . $this->filter->toQueryString())); ?>
<?= $this->filterEditor; ?>
</div> </div>
<?php endif ?>
<div class="content"> <div class="content">
<?= $this->filterEditor ?>
<?php <?php
endif; if (count($hosts) === 0) {
echo $this->translate('No hosts found matching the filter') . '</div>';
if ($hosts->count() === 0) {
echo $this->translate('No hosts matching the filter');
if (! $this->compact) {
echo '</div>';
}
return; return;
} }
?> ?>

View File

@ -1,26 +1,24 @@
<?php <?php
use Icinga\Module\Monitoring\Object\Host; use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service; use Icinga\Module\Monitoring\Object\Service;
?> if (! $this->compact): ?>
<?php if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs; ?>
<div class="dontprint" style="margin: 1em;"> <?= $this->sortBox; ?>
<?= $this->translate('Sort by') ?> <?= $this->sortControl->render($this) ?> <?= $this->limiter; ?>
</div> <?= $this->paginator; ?>
<?= $this->widget('limiter') ?> <?= $this->filterEditor; ?>
<?= $this->paginationControl($notifications, null, null, array('preserve' => $this->preserve)) ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<?php if (count($notifications) === 0): ?> <?php
<?= $this->translate('No notifications matching the filter') ?>
<?php return; endif ?>
if (count($notifications) === 0) {
echo $this->translate('No notifications found matching the filter') . '</div>';
return;
}
?>
<table data-base-target="_next" class="action"> <table data-base-target="_next" class="action">
<tbody> <tbody>
<?php foreach ($notifications as $notification): <?php foreach ($notifications as $notification):

View File

@ -1,28 +1,28 @@
<?php <?php
use Icinga\Module\Monitoring\Object\Service; use Icinga\Module\Monitoring\Object\Service;
?> if (! $this->compact): ?>
<?php if (!$this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs; ?> <?= $this->tabs; ?>
<div style="margin: 1em;" class="dontprint"> <?= $this->sortBox; ?>
<?= $this->translate('Sort by'); ?> <?= $this->sortControl; ?> <?= $this->limiter; ?>
</div> <?= $this->paginator; ?>
<?= $this->filterEditor; ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content" data-base-target="_next"> <div class="content" data-base-target="_next">
<table class="pivot servicestates">
<?php <?php
$hasHeader = false; $hasHeader = false;
$pivotData = $this->pivot->toArray(); $pivotData = $this->pivot->toArray();
if (count($pivotData) === 0) {
echo $this->translate('No services found matching the filter') . '</div>';
return;
}
$hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . ')'; $hostFilter = '(host_name=' . implode('|host_name=', array_keys($pivotData)) . ')';
?> ?>
<table class="pivot servicestates">
<?php if (count($pivotData) === 0): ?>
<?= $this->translate('No Services matching the filter'); ?>
<?php endif ?>
<?php foreach ($pivotData as $host_name => $serviceStates): ?> <?php foreach ($pivotData as $host_name => $serviceStates): ?>
<?php if (!$hasHeader): ?> <?php if (!$hasHeader): ?>
<thead> <thead>

View File

@ -1,21 +1,17 @@
<?php if ($this->compact): ?> <?php if (! $this->compact): ?>
<div class="content">
<?php else: ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs; ?>
<div style="margin: 1em;" class="dontprint"> <?= $this->sortBox; ?>
<?= $this->translate('Sort by'); ?> <?= $this->sortControl->render($this); ?> <?= $this->limiter; ?>
</div> <?= $this->paginator; ?>
<?= $this->widget('limiter')->setMaxLimit(count($servicegroups)); ?>
<?= $this->paginationControl($servicegroups, null, null, array('preserve' => $this->preserve)); ?>
</div>
<div class="content">
<?= $this->filterEditor; ?> <?= $this->filterEditor; ?>
</div>
<?php endif ?> <?php endif ?>
<div class="content">
<?php <?php
if (count($servicegroups) === 0) { if (count($servicegroups) === 0) {
echo $this->translate('No service groups matching the filter'); echo $this->translate('No servicegroups found matching the filter') . '</div>';
echo '</div>';
return; return;
} }
?> ?>

View File

@ -6,39 +6,31 @@ $selfUrl = 'monitoring/list/services';
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs; ?>
<div style="margin: 1em;" class="dontprint"> <div class="dontprint">
<?= $this->render('list/components/selectioninfo.phtml') ?> <?= $this->render('list/components/selectioninfo.phtml'); ?>
<?= $this->render('list/components/servicesummary.phtml') ?> <?= $this->render('list/components/servicesummary.phtml'); ?>
<div style="float: right">
<?= $this->translate('Sort by') ?> <?= $this->sortControl ?>
</div> </div>
<?= $this->sortBox; ?>
<?= $this->limiter; ?>
<?= $this->paginator; ?>
<?= $this->filterEditor; ?>
</div> </div>
<?php if ($this->limit === 0): ?>
<?= $this->widget('limiter') ?>
<?php else: ?>
<?= $this->widget('limiter')->setCurrentPageCount($this->services->count()) ?>
<?= $this->paginationControl($services, null, null, array('preserve' => $this->preserve)) ?>
<?php endif ?> <?php endif ?>
</div>
<div class="content"> <div class="content">
<?= $this->filterEditor ?> <?php
<?php else: ?>
<div class="content"> if (count($services) === 0) {
<?php endif ?> echo $this->translate('No services found matching the filter') . '</div>';
return;
}
?>
<table data-base-target="_next" <table data-base-target="_next"
class="action multiselect <?php if ($this->compact): ?> compact<?php endif ?>" style="table-layout: auto;" class="action multiselect <?php if ($this->compact): ?> compact<?php endif ?>" style="table-layout: auto;"
data-icinga-multiselect-url="<?= $this->href("monitoring/services/show") ?>" data-icinga-multiselect-url="<?= $this->href("monitoring/services/show") ?>"
data-icinga-multiselect-data="service_description,host_name"> data-icinga-multiselect-data="service_description,host_name">
<tbody> <tbody>
<?php <?php foreach ($services as $service):
if (count($services) === 0) {
echo mt('monitoring', 'No services matching the filter');
}
foreach ($services as $service):
$serviceLink = $this->href( $serviceLink = $this->href(
'monitoring/service/show', 'monitoring/service/show',
array( array(

View File

@ -1,11 +1,7 @@
<?php <?php
use Icinga\Module\Monitoring\Object\Host; use Icinga\Module\Monitoring\Object\Host;
?> ?>
<?php if (! $this->compact): ?>
<?= $tabs; ?>
<?php endif ?>
<table class="objectstate"> <table class="objectstate">
<tr class="state <?= Host::getStateText($object->host_state); ?><?= $object->host_handled ? ' handled' : ''; ?>"> <tr class="state <?= Host::getStateText($object->host_state); ?><?= $object->host_handled ? ' handled' : ''; ?>">
<td class="state"> <td class="state">

View File

@ -1,6 +1,3 @@
<?php if (! $this->compact): ?>
<?= $tabs; ?>
<?php endif ?>
<?php if (($hostCount = count($objects)) > 0): ?> <?php if (($hostCount = count($objects)) > 0): ?>
<div class="hbox-item"> <div class="hbox-item">
<strong><?= sprintf($this->translatePlural('Host (%u)', 'Hosts (%u)', $hostCount), $hostCount); ?></strong> <strong><?= sprintf($this->translatePlural('Host (%u)', 'Hosts (%u)', $hostCount), $hostCount); ?></strong>

View File

@ -1,12 +1,8 @@
<?php <?php
use Icinga\Module\Monitoring\Object\Host; use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service; use Icinga\Module\Monitoring\Object\Service;
?> ?>
<?php if (! $this->compact): ?>
<?= $tabs; ?>
<?php endif ?>
<table class="objectstate"> <table class="objectstate">
<tr class="state <?= Host::getStateText($object->host_state); ?><?= $object->host_handled ? ' handled' : ''; ?>"> <tr class="state <?= Host::getStateText($object->host_state); ?><?= $object->host_handled ? ' handled' : ''; ?>">
<td class="state"> <td class="state">

View File

@ -1,6 +1,3 @@
<?php if (! $this->compact): ?>
<?= $tabs; ?>
<?php endif ?>
<?php if (($serviceCount = count($objects)) > 0): ?> <?php if (($serviceCount = count($objects)) > 0): ?>
<div class="hbox"> <div class="hbox">
<div class="hbox-item" style="width: 6em;"> <div class="hbox-item" style="width: 6em;">

View File

@ -1,6 +1,8 @@
<?php if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs->showOnlyCloseButton() ?> <?= $this->tabs->showOnlyCloseButton(); ?>
</div> </div>
<?php endif ?>
<div class="content"> <div class="content">
<h1><?= $title; ?></h1> <h1><?= $title; ?></h1>
<?php if ((bool) $programStatus->notifications_enabled === false): ?> <?php if ((bool) $programStatus->notifications_enabled === false): ?>

View File

@ -1,12 +1,12 @@
<?php <?php
$rv = $this->runtimeVariables()->create($this->runtimevariables); $rv = $this->runtimeVariables()->create($this->runtimevariables);
$cp = $this->checkPerformance()->create($this->checkperformance); $cp = $this->checkPerformance()->create($this->checkperformance);
?> if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs; ?>
</div> </div>
<?php endif ?>
<div class="content processinfo"> <div class="content processinfo">
<div class="boxview"> <div class="boxview">

View File

@ -1,6 +1,8 @@
<?php if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs; ?>
</div> </div>
<?php endif ?>
<div class="content"> <div class="content">
<?= sprintf($this->translate('%s is currently not up and running'), $this->backendName) ?> <?= sprintf($this->translate('%s is currently not up and running'), $this->backendName) ?>
</div> </div>

View File

@ -1,7 +1,8 @@
<?php if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs; ?>
</div> </div>
<?php <?php endif;
$rv = $this->runtimeVariables()->create($this->runtimevariables); $rv = $this->runtimeVariables()->create($this->runtimevariables);
$cp = $this->checkPerformance()->create($this->checkperformance); $cp = $this->checkPerformance()->create($this->checkperformance);

View File

@ -1,4 +1,7 @@
<div class="controls"> <div class="controls">
<?php if (! $this->compact): ?>
<?= $this->tabs; ?>
<?php endif ?>
<?= $this->render('partials/service/object-header.phtml') ?> <?= $this->render('partials/service/object-header.phtml') ?>
<h1><?= $this->translate("Service detail information") ?></h1> <h1><?= $this->translate("Service detail information") ?></h1>
</div> </div>

View File

@ -1,9 +1,12 @@
<div class="controls"> <div class="controls">
<?php if (! $this->compact): ?>
<?= $tabs; ?>
<?php endif ?>
<?= $this->render('partials/service/objects-header.phtml'); ?> <?= $this->render('partials/service/objects-header.phtml'); ?>
</div> </div>
<div class="content"> <div class="content">
<?php if (($serviceCount = count($objects)) === 0): ?> <?php if (($serviceCount = count($objects)) === 0): ?>
<?= $this->translate('No services matching the filter'); ?> <?= $this->translate('No services found matching the filter'); ?>
<?php else: ?> <?php else: ?>
<h3><?= sprintf($this->translatePlural('%u Service', '%u Services', $serviceCount), $serviceCount); ?></h3> <h3><?= sprintf($this->translatePlural('%u Service', '%u Services', $serviceCount), $serviceCount); ?></h3>
<div><?= $this->qlink( <div><?= $this->qlink(

View File

@ -1,6 +1,8 @@
<?php $contactHelper = $this->getHelper('ContactFlags') ?> <?php $contactHelper = $this->getHelper('ContactFlags') ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?php if (! $this->compact): ?>
<?= $this->tabs; ?>
<?php endif ?>
<h1><?= $this->translate('Contact details') ?></h1> <h1><?= $this->translate('Contact details') ?></h1>
<div class="circular" style="background-image: url('<?= <div class="circular" style="background-image: url('<?=
$this->href('static/gravatar', array('email' => $contact->contact_email)) $this->href('static/gravatar', array('email' => $contact->contact_email))
@ -54,10 +56,15 @@
</ul> </ul>
<?php endif ?> <?php endif ?>
<h1><?= $this->translate('Notifications sent to this contact') ?></h1> <h1><?= $this->translate('Notifications sent to this contact') ?></h1>
<?= $this->limiter; ?>
<?= $this->paginator; ?>
</div> </div>
<?php if (count($notifications)): ?> <?php if (count($notifications)): ?>
<?= $this->render('list/notifications.phtml') ?> <?= $this->partial('list/notifications.phtml', array(
'notifications' => $notifications,
'compact' => true
)); ?>
<?php else: ?> <?php else: ?>
<div class="content"><?= $this->translate('No notifications have been sent for this contact') ?></div> <div class="content"><?= $this->translate('No notifications have been sent for this contact') ?></div>
<?php endif ?> <?php endif ?>

View File

@ -1,29 +1,33 @@
<?php <?php
use Icinga\Module\Monitoring\Object\Host; use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service; use Icinga\Module\Monitoring\Object\Service;
$self = $this; $self = $this;
$hostContext = $object->getType() === 'host'; $hostContext = $object->getType() === 'host';
?> if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs; ?>
<?php if ($hostContext): ?> <?php if ($hostContext): ?>
<?= $this->render('partials/host/object-header.phtml'); ?> <?= $this->render('partials/host/object-header.phtml'); ?>
<?php else: ?> <?php else: ?>
<?= $this->render('partials/service/object-header.phtml'); ?> <?= $this->render('partials/service/object-header.phtml'); ?>
<?php endif ?> <?php endif ?>
<h1><?= $this->translate('This Object\'s Event History'); ?></h1> <h1><?= $this->translate('This Object\'s Event History'); ?></h1>
<?= $this->widget('limiter', array('url' => $url, 'max' => $history->count())); ?> <?= $this->sortBox; ?>
<?= $this->paginationControl($history, null, null, array('preserve' => $this->preserve)); ?> <?= $this->limiter; ?>
<?= $this->paginator; ?>
<?= $this->filterEditor; ?>
</div> </div>
<?php endif ?>
<div class="content"> <div class="content">
<?php if (count($history) === 0): ?> <?php
<?= $this->translate('No history available for this object'); ?>
</div> if (count($history) === 0) {
<?php return; endif ?> echo $this->translate('No history available for this object') . '</div>';
return;
}
?>
<?php <?php
function contactsLink($match, $view) { function contactsLink($match, $view) {

View File

@ -1,4 +1,7 @@
<div class="controls"> <div class="controls">
<?php if (! $this->compact): ?>
<?= $this->tabs; ?>
<?php endif ?>
<?= $this->render('partials/host/object-header.phtml') ?> <?= $this->render('partials/host/object-header.phtml') ?>
<?= $this->render('partials/host/servicesummary.phtml') ?> <?= $this->render('partials/host/servicesummary.phtml') ?>
</div> </div>

View File

@ -5,11 +5,10 @@ use Icinga\Util\Color;
$groupInfo = $timeline->getGroupInfo(); $groupInfo = $timeline->getGroupInfo();
$firstRow = ! $beingExtended; $firstRow = ! $beingExtended;
?> if (! $beingExtended && !$this->compact): ?>
<?php if (!$beingExtended): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs; ?>
<div style="margin: 1em;" class="dontprint"> <div style="float: right;" class="dontprint">
<?= $intervalBox; ?> <?= $intervalBox; ?>
</div> </div>
<div style="margin: 1em;" class="timeline-legend"> <div style="margin: 1em;" class="timeline-legend">
@ -21,6 +20,8 @@ $firstRow = !$beingExtended;
<?php endforeach ?> <?php endforeach ?>
</div> </div>
</div> </div>
<?php endif ?>
<?php if (! $beingExtended): ?>
<div class="content" data-base-target="_next"> <div class="content" data-base-target="_next">
<div class="timeline"> <div class="timeline">
<?php endif ?> <?php endif ?>

View File

@ -21,16 +21,6 @@ class Controller extends IcingaWebController
*/ */
protected $backend; 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() protected function moduleInit()
{ {
$this->backend = Backend::createBackend($this->_getParam('backend')); $this->backend = Backend::createBackend($this->_getParam('backend'));
@ -39,10 +29,6 @@ class Controller extends IcingaWebController
protected function handleFormatRequest($query) protected function handleFormatRequest($query)
{ {
if ($this->compactView !== null && ($this->_getParam('view', false) === 'compact')) {
$this->_helper->viewRenderer($this->compactView);
}
if ($this->_getParam('format') === 'sql') { if ($this->_getParam('format') === 'sql') {
echo '<pre>' echo '<pre>'
. htmlspecialchars(wordwrap($query->dump())) . htmlspecialchars(wordwrap($query->dump()))

View File

@ -94,11 +94,14 @@ div.contacts div.notification-periods {
div.tinystatesummary { div.tinystatesummary {
.page-header(); .page-header();
font-size: 1em; font-size: 1em;
margin-bottom: 0.5em;
.badges { .badges {
display: inline-block; display: inline-block;
margin-bottom: 4px; margin-bottom: 4px;
margin-left: 1em; margin-left: 1em;
} }
.state > a { .state > a {
color: white; color: white;
font-size: 0.8em; font-size: 0.8em;

View File

@ -44,7 +44,8 @@
/** /**
* Prepare the timer to handle the timeline's infinite loading * 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) { if (this.scrollCheckTimer === null) {
this.scrollCheckTimer = this.module.icinga.timer.register( this.scrollCheckTimer = this.module.icinga.timer.register(
this.checkTimelinePosition, this.checkTimelinePosition,

View File

@ -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;
}
}

View File

@ -119,12 +119,12 @@ html {
.container .controls { .container .controls {
top: 0; top: 0;
background-color: white; background-color: white;
padding: 0; padding: 1em 1em 0;
z-index: 100; z-index: 100;
} }
.container .fake-controls { .container .fake-controls {
padding: 0; padding: 1em 1em 0;
} }
.container .controls .pagination { .container .controls .pagination {
@ -149,10 +149,6 @@ html {
font-size: 0.9em; font-size: 0.9em;
} }
.container .controls > * {
margin-left: 1em;
}
.container .controls .pagination { .container .controls .pagination {
margin-left: 1.2em; margin-left: 1.2em;
} }
@ -167,7 +163,7 @@ html {
} }
.dashboard .controls { .dashboard .controls {
display: none; padding: 0;
} }
/* Not growing larger than 3840px at 1em=16px right now */ /* Not growing larger than 3840px at 1em=16px right now */

View File

@ -118,7 +118,6 @@ table.avp a:hover {
/* Definitively monitoring-only: */ /* Definitively monitoring-only: */
table.objectstate { table.objectstate {
margin: 1em;
border-collapse: separate; border-collapse: separate;
border-spacing: 1px; border-spacing: 1px;
} }
@ -194,11 +193,6 @@ table.benchmark {
color: inherit; color: inherit;
} }
/* controls have no padding as of tabs */
.controls > h1 {
margin-right: 1em;
}
[class^="icon-"]:before, [class*=" icon-"]:before { [class^="icon-"]:before, [class*=" icon-"]:before {
text-decoration: none; text-decoration: none;
} }

View File

@ -814,6 +814,10 @@ div.timeline {
/* Monitoring groupsummary styles */ /* Monitoring groupsummary styles */
.dashboard table.groupview {
margin-top: 0;
}
table.groupview { table.groupview {
width: 100%; width: 100%;
margin-top: 1em; margin-top: 1em;

View File

@ -1,12 +1,13 @@
/*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */ /*! Icinga Web 2 | (c) 2013-2015 Icinga Development Team | GPLv2+ */
ul.tabs { ul.tabs {
padding: 1em 0 0 0; padding: 0;
list-style-type: inside; list-style-type: inside;
} }
.controls ul.tabs { .controls ul.tabs {
margin-left: 0em; margin-left: -1em;
margin-right: -1em;
margin-top: -3.54em; margin-top: -3.54em;
height: 2.6em; height: 2.6em;
overflow: hidden; overflow: hidden;

View File

@ -48,10 +48,24 @@ table.multiselect tr[href] td {
-ms-user-select: none; -ms-user-select: none;
} }
#main form.filterEditor input[type=text], #main form.filterEditor select { #main div.filter {
margin-top: 1em;
form.editor {
input[type=text], select {
width: 12em; width: 12em;
} }
ul.tree li.active {
background-color: #eee;
}
div.buttons {
float: right;
}
}
}
ul.datafilter li { ul.datafilter li {
list-style-type: none; list-style-type: none;
margin: 0; margin: 0;
@ -281,10 +295,6 @@ li li .badge {
background-color: @colorUnknown; background-color: @colorUnknown;
} }
.widgetFilter li.active {
background-color: #eee;
}
.sparkline-box { .sparkline-box {
position: relative; position: relative;
top: -3px; top: -3px;

View File

@ -760,12 +760,8 @@
// $container.html(content); // $container.html(content);
} else { } else {
if ($container.closest('.dashboard').length if ($container.closest('.dashboard').length) {
) {
if (! $('h1', $content).length) {
var title = $('h1', $container).first().detach(); var title = $('h1', $container).first().detach();
$('h1', $content).first().detach();
}
$container.html(title).append(content); $container.html(title).append(content);
} else if (action === 'replace') { } else if (action === 'replace') {
$container.html(content); $container.html(content);

View File

@ -716,8 +716,6 @@
}, },
initializeControls: function (parent) { initializeControls: function (parent) {
var self = this;
if ($(parent).closest('.dashboard').length) { if ($(parent).closest('.dashboard').length) {
return; return;
} }
@ -747,7 +745,6 @@
}, },
fixControls: function ($parent) { fixControls: function ($parent) {
var self = this; var self = this;
if ('undefined' === typeof $parent) { if ('undefined' === typeof $parent) {
@ -773,6 +770,11 @@
$('.controls', $parent).each(function (idx, el) { $('.controls', $parent).each(function (idx, el) {
var $el = $(el); var $el = $(el);
if ($el.closest('.dashboard').length) {
return;
}
var $fake = $el.next('.fake-controls'); var $fake = $el.next('.fake-controls');
var y = $parent.scrollTop(); var y = $parent.scrollTop();