Merge branch 'bugfix/pagination-floating-11145'

fixes #11145
This commit is contained in:
Eric Lippmann 2016-03-31 12:43:34 +02:00
commit f8891a96ce
19 changed files with 819 additions and 810 deletions

View File

@ -5,16 +5,14 @@ use Icinga\Data\Reducible;
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls separated"> <div class="controls separated">
<?= $tabs; ?> <?= $this->tabs ?>
<div class="grid"> <?= $this->paginator ?>
<?= $this->sortBox ?> <div class="sort-controls-container">
<?= $this->limiter ?> <?= $this->limiter ?>
<?= $this->paginator ?> <?= $this->sortBox ?>
</div>
<div>
<?= $this->backendSelection; ?>
<?= $this->filterEditor; ?>
</div> </div>
<?= $this->backendSelection ?>
<?= $this->filterEditor ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">

View File

@ -5,16 +5,14 @@ use Icinga\Data\Reducible;
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls separated"> <div class="controls separated">
<?= $tabs ?> <?= $this->tabs ?>
<div class="grid"> <?= $this->paginator ?>
<?= $this->sortBox ?> <div class="sort-controls-container">
<?= $this->limiter ?> <?= $this->limiter ?>
<?= $this->paginator ?> <?= $this->sortBox ?>
</div>
<div>
<?= $this->backendSelection ?>
<?= $this->filterEditor ?>
</div> </div>
<?= $this->backendSelection ?>
<?= $this->filterEditor ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">

View File

@ -39,10 +39,18 @@ class ListController extends Controller
} }
/** /**
* Display host list * List hosts
*/ */
public function hostsAction() public function hostsAction()
{ {
$this->addTitleTab(
'hosts',
$this->translate('Hosts'),
$this->translate('List hosts')
);
$this->setAutorefreshInterval(10);
// Handle soft and hard states // Handle soft and hard states
if (strtolower($this->params->shift('stateType', 'soft')) === 'hard') { if (strtolower($this->params->shift('stateType', 'soft')) === 'hard') {
$stateColumn = 'host_hard_state'; $stateColumn = 'host_hard_state';
@ -51,9 +59,8 @@ class ListController extends Controller
$stateColumn = 'host_state'; $stateColumn = 'host_state';
$stateChangeColumn = 'host_last_state_change'; $stateChangeColumn = 'host_last_state_change';
} }
$this->addTitleTab('hosts', $this->translate('Hosts'), $this->translate('List hosts'));
$this->setAutorefreshInterval(10); $hosts = $this->backend->select()->from('hoststatus', array_merge(array(
$query = $this->backend->select()->from('hoststatus', array_merge(array(
'host_icon_image', 'host_icon_image',
'host_icon_image_alt', 'host_icon_image_alt',
'host_name', 'host_name',
@ -71,9 +78,20 @@ class ListController extends Controller
'host_active_checks_enabled', 'host_active_checks_enabled',
'host_passive_checks_enabled' 'host_passive_checks_enabled'
), $this->addColumns())); ), $this->addColumns()));
$this->applyRestriction('monitoring/filter/objects', $query); $this->applyRestriction('monitoring/filter/objects', $hosts);
$this->filterQuery($query); $this->filterQuery($hosts);
$this->view->hosts = $query;
$this->setupPaginationControl($hosts);
$this->setupLimitControl();
$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'),
'host_last_state_change' => $this->translate('Last State Change')
), $hosts);
$stats = $this->backend->select()->from('hoststatussummary', array( $stats = $this->backend->select()->from('hoststatussummary', array(
'hosts_total', 'hosts_total',
'hosts_up', 'hosts_up',
@ -86,28 +104,26 @@ class ListController extends Controller
'hosts_pending', 'hosts_pending',
)); ));
$this->applyRestriction('monitoring/filter/objects', $stats); $this->applyRestriction('monitoring/filter/objects', $stats);
$this->view->stats = $stats;
$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'),
'host_last_state_change' => $this->translate('Last State Change')
), $query);
$summary = $query->getQuery()->queryServiceProblemSummary(); $summary = $hosts->getQuery()->queryServiceProblemSummary();
$this->applyRestriction('monitoring/filter/objects', $summary); $this->applyRestriction('monitoring/filter/objects', $summary);
$this->view->hosts = $hosts;
$this->view->stats = $stats;
$this->view->summary = $summary->fetchPairs(); $this->view->summary = $summary->fetchPairs();
} }
/** /**
* Display service list * List services
*/ */
public function servicesAction() public function servicesAction()
{ {
$this->addTitleTab(
'services',
$this->translate('Services'),
$this->translate('List services')
);
// Handle soft and hard states // Handle soft and hard states
if (strtolower($this->params->shift('stateType', 'soft')) === 'hard') { if (strtolower($this->params->shift('stateType', 'soft')) === 'hard') {
$stateColumn = 'service_hard_state'; $stateColumn = 'service_hard_state';
@ -117,14 +133,9 @@ class ListController extends Controller
$stateChangeColumn = 'service_last_state_change'; $stateChangeColumn = 'service_last_state_change';
} }
$this->addTitleTab('services', $this->translate('Services'), $this->translate('List services'));
$this->view->showHost = true;
if (strpos($this->params->get('host_name', '*'), '*') === false) {
$this->view->showHost = false;
}
$this->setAutorefreshInterval(10); $this->setAutorefreshInterval(10);
$columns = array_merge(array( $services = $this->backend->select()->from('servicestatus', array_merge(array(
'host_name', 'host_name',
'host_display_name', 'host_display_name',
'host_state', 'host_state',
@ -147,14 +158,12 @@ class ListController extends Controller
'service_notifications_enabled', 'service_notifications_enabled',
'service_active_checks_enabled', 'service_active_checks_enabled',
'service_passive_checks_enabled' 'service_passive_checks_enabled'
), $this->addColumns()); ), $this->addColumns()));
$query = $this->backend->select()->from('servicestatus', $columns); $this->applyRestriction('monitoring/filter/objects', $services);
$this->applyRestriction('monitoring/filter/objects', $query); $this->filterQuery($services);
$this->filterQuery($query);
$this->view->services = $query;
$this->setupPaginationControl($services);
$this->setupLimitControl(); $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'),
@ -166,7 +175,7 @@ class ListController extends Controller
'host_display_name' => $this->translate('Hostname'), 'host_display_name' => $this->translate('Hostname'),
'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')
), $query); ), $services);
$stats = $this->backend->select()->from('servicestatussummary', array( $stats = $this->backend->select()->from('servicestatussummary', array(
'services_critical', 'services_critical',
@ -183,18 +192,30 @@ class ListController extends Controller
'services_warning_unhandled' 'services_warning_unhandled'
)); ));
$this->applyRestriction('monitoring/filter/objects', $stats); $this->applyRestriction('monitoring/filter/objects', $stats);
$this->view->services = $services;
$this->view->stats = $stats; $this->view->stats = $stats;
if (strpos($this->params->get('host_name', '*'), '*') === false) {
$this->view->showHost = false;
} else {
$this->view->showHost = true;
}
} }
/** /**
* Fetch the current downtimes and put them into the view property `downtimes` * List downtimes
*/ */
public function downtimesAction() public function downtimesAction()
{ {
$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( $downtimes = $this->backend->select()->from('downtime', array(
'id' => 'downtime_internal_id', 'id' => 'downtime_internal_id',
'objecttype' => 'object_type', 'objecttype' => 'object_type',
'comment' => 'downtime_comment', 'comment' => 'downtime_comment',
@ -215,13 +236,11 @@ class ListController extends Controller
'host_display_name', 'host_display_name',
'service_display_name' 'service_display_name'
)); ));
$this->applyRestriction('monitoring/filter/objects', $query); $this->applyRestriction('monitoring/filter/objects', $downtimes);
$this->filterQuery($query); $this->filterQuery($downtimes);
$this->view->downtimes = $query;
$this->setupPaginationControl($downtimes);
$this->setupLimitControl(); $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'),
@ -233,7 +252,9 @@ class ListController extends Controller
'downtime_scheduled_start' => $this->translate('Scheduled Start'), 'downtime_scheduled_start' => $this->translate('Scheduled Start'),
'downtime_scheduled_end' => $this->translate('Scheduled End'), 'downtime_scheduled_end' => $this->translate('Scheduled End'),
'downtime_duration' => $this->translate('Duration') 'downtime_duration' => $this->translate('Duration')
), $query); ), $downtimes);
$this->view->downtimes = $downtimes;
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();
@ -242,7 +263,7 @@ class ListController extends Controller
} }
/** /**
* Display notification overview * List notifications
*/ */
public function notificationsAction() public function notificationsAction()
{ {
@ -251,9 +272,10 @@ class ListController extends Controller
$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( $notifications = $this->backend->select()->from('notification', array(
'host_name', 'host_name',
'service_description', 'service_description',
'notification_output', 'notification_output',
@ -263,22 +285,30 @@ class ListController extends Controller
'host_display_name', 'host_display_name',
'service_display_name' 'service_display_name'
)); ));
$this->applyRestriction('monitoring/filter/objects', $query); $this->applyRestriction('monitoring/filter/objects', $notifications);
$this->filterQuery($query); $this->filterQuery($notifications);
$this->view->notifications = $query;
$this->setupPaginationControl($notifications);
$this->setupLimitControl(); $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')
), $query); ), $notifications);
$this->view->notifications = $notifications;
} }
/**
* List contacts
*/
public function contactsAction() public function contactsAction()
{ {
$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( $contacts = $this->backend->select()->from('contact', array(
'contact_name', 'contact_name',
'contact_alias', 'contact_alias',
'contact_email', 'contact_email',
@ -286,20 +316,19 @@ class ListController extends Controller
'contact_notify_service_timeperiod', 'contact_notify_service_timeperiod',
'contact_notify_host_timeperiod' 'contact_notify_host_timeperiod'
)); ));
$this->applyRestriction('monitoring/filter/objects', $query); $this->applyRestriction('monitoring/filter/objects', $contacts);
$this->filterQuery($query); $this->filterQuery($contacts);
$this->view->contacts = $query;
$this->setupPaginationControl($contacts);
$this->setupLimitControl(); $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'),
'contact_email' => $this->translate('Email'), 'contact_email' => $this->translate('Email'),
'contact_pager' => $this->translate('Pager Address / Number'), 'contact_pager' => $this->translate('Pager Address / Number')
'contact_notify_service_timeperiod' => $this->translate('Service Notification Timeperiod'), ), $contacts);
'contact_notify_host_timeperiod' => $this->translate('Host Notification Timeperiod')
), $query); $this->view->contacts = $contacts;
} }
public function eventgridAction() public function eventgridAction()
@ -342,6 +371,9 @@ class ListController extends Controller
$this->view->orientation = $orientation; $this->view->orientation = $orientation;
} }
/**
* List contact groups
*/
public function contactgroupsAction() public function contactgroupsAction()
{ {
$this->addTitleTab( $this->addTitleTab(
@ -350,47 +382,38 @@ class ListController extends Controller
$this->translate('List contact groups') $this->translate('List contact groups')
); );
$query = $this->backend->select()->from('contactgroup', array( $contactGroups = $this->backend->select()->from('contactgroup', array(
'contactgroup_name', 'contactgroup_name',
'contactgroup_alias', 'contactgroup_alias',
'contact_name', 'contact_count'
'contact_alias',
'contact_email',
'contact_pager'
)); ));
$this->applyRestriction('monitoring/filter/objects', $query); $this->applyRestriction('monitoring/filter/objects', $contactGroups);
$this->filterQuery($query); $this->filterQuery($contactGroups);
$this->setupPaginationControl($contactGroups);
$this->setupLimitControl();
$this->setupSortControl(array( $this->setupSortControl(array(
'contactgroup_name' => $this->translate('Contactgroup Name'), 'contactgroup_name' => $this->translate('Contactgroup Name'),
'contactgroup_alias' => $this->translate('Contactgroup Alias') 'contactgroup_alias' => $this->translate('Contactgroup Alias')
), $query); ), $contactGroups);
// Fetch and prepare all contact groups: $this->view->contactGroups = $contactGroups;
$contactgroups = $query->getQuery()->fetchAll();
$groupData = array();
foreach ($contactgroups as $c) {
if (!array_key_exists($c->contactgroup_name, $groupData)) {
$groupData[$c->contactgroup_name] = array(
'alias' => $c->contactgroup_alias,
'contacts' => array()
);
}
if (isset ($c->contact_name)) {
$groupData[$c->contactgroup_name]['contacts'][] = $c;
}
}
// TODO: Find a better naming
$this->view->groupData = $groupData;
} }
/**
* List all comments
*/
public function commentsAction() public function commentsAction()
{ {
$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( $comments = $this->backend->select()->from('comment', array(
'id' => 'comment_internal_id', 'id' => 'comment_internal_id',
'objecttype' => 'object_type', 'objecttype' => 'object_type',
'comment' => 'comment_data', 'comment' => 'comment_data',
@ -404,12 +427,11 @@ class ListController extends Controller
'host_display_name', 'host_display_name',
'service_display_name' 'service_display_name'
)); ));
$this->applyRestriction('monitoring/filter/objects', $query); $this->applyRestriction('monitoring/filter/objects', $comments);
$this->filterQuery($query); $this->filterQuery($comments);
$this->view->comments = $query;
$this->setupPaginationControl($comments);
$this->setupLimitControl(); $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'),
@ -418,15 +440,20 @@ class ListController extends Controller
'comment_type' => $this->translate('Comment Type'), 'comment_type' => $this->translate('Comment Type'),
'comment_expiration' => $this->translate('Expiration') 'comment_expiration' => $this->translate('Expiration')
), ),
$query $comments
); );
$this->view->comments = $comments;
if ($this->Auth()->hasPermission('monitoring/command/comment/delete')) { if ($this->Auth()->hasPermission('monitoring/command/comment/delete')) {
$this->view->delCommentForm = new DeleteCommentCommandForm(); $this->view->delCommentForm = new DeleteCommentCommandForm();
$this->view->delCommentForm->handleRequest(); $this->view->delCommentForm->handleRequest();
} }
} }
/**
* List service groups
*/
public function servicegroupsAction() public function servicegroupsAction()
{ {
$this->addTitleTab( $this->addTitleTab(
@ -434,9 +461,10 @@ class ListController extends Controller
$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('servicegroupsummary', array( $serviceGroups = $this->backend->select()->from('servicegroupsummary', array(
'servicegroup_alias', 'servicegroup_alias',
'servicegroup_name', 'servicegroup_name',
'services_critical_handled', 'services_critical_handled',
@ -449,25 +477,34 @@ class ListController extends Controller
'services_warning_handled', 'services_warning_handled',
'services_warning_unhandled' 'services_warning_unhandled'
)); ));
$this->applyRestriction('monitoring/filter/objects', $query); $this->applyRestriction('monitoring/filter/objects', $serviceGroups);
$this->filterQuery($query); $this->filterQuery($serviceGroups);
$this->view->servicegroups = $query;
$this->setupPaginationControl($serviceGroups);
$this->setupLimitControl(); $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'),
'services_total' => $this->translate('Total Services') 'services_total' => $this->translate('Total Services')
), $query); ), $serviceGroups);
$this->view->serviceGroups = $serviceGroups;
} }
/**
* List host groups
*/
public function hostgroupsAction() public function hostgroupsAction()
{ {
$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('hostgroupsummary', array( $hostGroups = $this->backend->select()->from('hostgroupsummary', array(
'hostgroup_alias', 'hostgroup_alias',
'hostgroup_name', 'hostgroup_name',
'hosts_down_handled', 'hosts_down_handled',
@ -487,18 +524,19 @@ class ListController extends Controller
'services_warning_handled', 'services_warning_handled',
'services_warning_unhandled' 'services_warning_unhandled'
)); ));
$this->applyRestriction('monitoring/filter/objects', $query); $this->applyRestriction('monitoring/filter/objects', $hostGroups);
$this->filterQuery($query); $this->filterQuery($hostGroups);
$this->view->hostgroups = $query;
$this->setupPaginationControl($hostGroups);
$this->setupLimitControl(); $this->setupLimitControl();
$this->setupPaginationControl($this->view->hostgroups);
$this->setupSortControl(array( $this->setupSortControl(array(
'hosts_severity' => $this->translate('Severity'), 'hosts_severity' => $this->translate('Severity'),
'hostgroup_alias' => $this->translate('Host Group Name'), 'hostgroup_alias' => $this->translate('Host Group Name'),
'hosts_total' => $this->translate('Total Hosts'), 'hosts_total' => $this->translate('Total Hosts'),
'services_total' => $this->translate('Total Services') 'services_total' => $this->translate('Total Services')
), $query); ), $hostGroups);
$this->view->hostGroups = $hostGroups;
} }
public function eventhistoryAction() public function eventhistoryAction()

View File

@ -1,11 +1,11 @@
<?php if (! $this->compact): ?> <?php if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $tabs ?> <?= $this->tabs ?>
<?= $this->render('list/components/selectioninfo.phtml') ?> <?= $this->render('list/components/selectioninfo.phtml') ?>
<div class="grid"> <?= $this->paginator ?>
<?= $this->sortBox ?> <div class="sort-controls-container">
<?= $this->limiter ?> <?= $this->limiter ?>
<?= $this->paginator ?> <?= $this->sortBox ?>
</div> </div>
<?= $this->filterEditor ?> <?= $this->filterEditor ?>
</div> </div>

View File

@ -2,52 +2,49 @@
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $tabs ?> <?= $this->tabs ?>
<div class="grid"> <?= $this->paginator ?>
<?= $this->sortBox ?> <div class="sort-controls-container">
<?= $this->limiter ?> <?= $this->limiter ?>
<?= $this->paginator ?> <?= $this->sortBox ?>
</div> </div>
<?= $this->filterEditor ?> <?= $this->filterEditor ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<?php <?php if (! $contactGroups->hasResult()): ?>
if (count($groupData) === 0) { <p><?= $this->translate('No contact groups found matching the filter') ?></p>
echo $this->translate('No contactgroups found matching the filter') . '</div>'; </div>
return; <?php return; endif ?>
} <table class="common-table table-row-selectable" data-base-target="_next">
?>
<table class="action table-row-selectable common-table" data-base-target="_next">
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
<th><?= $this->translate('Contact Group ') ?></th> <th><?= $this->translate('Contact Group ') ?></th>
<th><?= $this->translate('Alias') ?></th> <th><?= $this->translate('Alias') ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($contactGroups as $contactGroup): ?>
<?php foreach ($groupData as $groupName => $groupInfo): ?> <tr>
<tr> <td class="count-col">
<td class="count-col"> <span class="badge"><?= $contactGroup->contact_count ?></span>
<span class="badge"><?= count($groupInfo['contacts']) ?></span> </td>
</td> <td>
<?= $this->qlink(
$contactGroup->contactgroup_name,
'monitoring/list/contacts',
array('contactgroup_name' => $contactGroup->contactgroup_name),
array('title' => sprintf(
$this->translate('Show detailed information about %s'),
$contactGroup->contactgroup_name
))
) ?>
</td>
<td> <td>
<?= $this->qlink( <?php if ($contactGroup->contactgroup_name !== $contactGroup->contactgroup_alias): ?>
$groupName, <?= $contactGroup->contactgroup_alias ?>
'monitoring/list/contacts', <?php endif ?>
array('contactgroup_name' => $groupName),
array('title' => sprintf(
$this->translate('Show detailed information about %s'),
$groupName
))
) ?>
</td>
<td>
<?php if ($groupInfo['alias'] !== $groupName): ?>
<?= $groupInfo['alias'] ?>
<?php endif ?>
</td> </td>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>

View File

@ -1,79 +1,83 @@
<?php if (! $this->compact): ?> <?php if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $tabs ?> <?= $this->tabs ?>
<div class="grid"> <?= $this->paginator ?>
<?= $this->sortBox ?> <div class="sort-controls-container">
<?= $this->limiter ?> <?= $this->limiter ?>
<?= $this->paginator ?> <?= $this->sortBox ?>
</div> </div>
<?= $this->filterEditor ?> <?= $this->filterEditor ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<?php if ($contacts->hasResult()): ?> <?php if (! $contacts->hasResult()): ?>
<table class="action table-row-selectable common-table" data-base-target="_next"> <p><?= $this->translate('No contacts found matching the filter') ?></p>
<thead> </div>
<?php return; endif ?>
<table class="common-table table-row-selectable" data-base-target="_next">
<thead>
<tr> <tr>
<th><?= $this->translate('Name') ?></th> <th><?= $this->translate('Name') ?></th>
<th><?= $this->translate('Email') ?></th> <th><?= $this->translate('Email') ?></th>
<th><?= $this->translate('Pager') ?></th> <th><?= $this->translate('Pager') ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($contacts->peekAhead($this->compact) as $contact): ?> <?php foreach ($contacts->peekAhead($this->compact) as $contact): ?>
<tr> <tr>
<td> <td>
<?= $this->qlink( <?= $this->qlink(
$contact->contact_name, $contact->contact_name,
'monitoring/show/contact', 'monitoring/show/contact',
array('contact_name' => $contact->contact_name), array('contact_name' => $contact->contact_name),
array('title' => sprintf( array(
'title' => sprintf(
$this->translate('Show detailed information about %s'), $this->translate('Show detailed information about %s'),
$contact->contact_alias $contact->contact_alias
), 'class' => 'rowaction') )
); ?> )
</td> ) ?>
</td>
<td>
<?= $this->translate('Email') ?>:
<a href="mailto:<?= $contact->contact_email ?>"
title="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias) ?>"
aria-label="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias) ?>">
<?= $this->escape($contact->contact_email) ?>
</a>
</td>
<td> <td>
<?= $this->translate('Email') ?>: <?php if ($contact->contact_pager): ?>
<a href="mailto:<?= $contact->contact_email; ?>" <?= $this->escape($contact->contact_pager) ?>
title="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias); ?>" <?php endif ?>
aria-label="<?= sprintf($this->translate('Send a mail to %s'), $contact->contact_alias); ?>">
<?= $this->escape($contact->contact_email); ?>
</a>
</td> </td>
<td>
<?php if ($contact->contact_pager): ?>
<?= $this->escape($contact->contact_pager) ?>
<?php endif; ?>
</td>
<?php if ($contact->contact_notify_service_timeperiod): ?> <?php if ($contact->contact_notify_service_timeperiod): ?>
<td> <td>
<?= $this->escape($contact->contact_notify_service_timeperiod) ?> <?= $this->escape($contact->contact_notify_service_timeperiod) ?>
</td> </td>
<?php endif; ?> <?php endif ?>
<?php if ($contact->contact_notify_host_timeperiod): ?> <?php if ($contact->contact_notify_host_timeperiod): ?>
<td> <td>
<?= $this->escape($contact->contact_notify_host_timeperiod) ?> <?= $this->escape($contact->contact_notify_host_timeperiod) ?>
</td> </td>
<?php endif; ?> <?php endif ?>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
<?php if ($contacts->hasMore()): ?> <?php if ($contacts->hasMore()): ?>
<div class="action-links">
<?= $this->qlink( <?= $this->qlink(
$this->translate('Show More'), $this->translate('Show More'),
$this->url()->without(array('view', 'limit')), $this->url()->without(array('view', 'limit')),
null, null,
array( array(
'data-base-target' => '_next', 'class' => 'action-link',
'class' => 'pull-right action-link' 'data-base-target' => '_next'
) )
); ?> ) ?>
<?php endif ?> </div>
<?php else: ?>
<?= $this->translate('No contacts found matching the filter'); ?>
<?php endif ?> <?php endif ?>
</div> </div>

View File

@ -3,51 +3,56 @@ use Icinga\Module\Monitoring\Object\Host;
use Icinga\Module\Monitoring\Object\Service; use Icinga\Module\Monitoring\Object\Service;
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls separated"> <div class="controls">
<?= $tabs ?> <?= $this->tabs ?>
<?= $this->render('list/components/selectioninfo.phtml') ?> <?= $this->render('list/components/selectioninfo.phtml') ?>
<div class="grid"> <?= $this->paginator ?>
<?= $this->sortBox ?> <div class="sort-controls-container">
<?= $this->limiter ?> <?= $this->limiter ?>
<?= $this->paginator ?> <?= $this->sortBox ?>
</div> </div>
<?= $this->filterEditor ?> <?= $this->filterEditor ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<table data-base-target="_next" <?php if (! $downtimes->hasResult()): ?>
class="table-row-selectable state-table multiselect common-table" <p><?= $this->translate('No downtimes found matching the filter.') ?></p>
data-icinga-multiselect-url="<?= $this->href('monitoring/downtimes/show'); ?>" </div>
data-icinga-multiselect-controllers="<?= $this->href("monitoring/downtimes") ?>" <?php return; endif ?>
data-icinga-multiselect-data="downtime_id"> <table class="common-table state-table table-row-selectable multiselect"
data-base-target="_next"
data-icinga-multiselect-url="<?= $this->href('monitoring/downtimes/show') ?>"
data-icinga-multiselect-controllers="<?= $this->href("monitoring/downtimes") ?>"
data-icinga-multiselect-data="downtime_id">
<tbody> <tbody>
<?php foreach ($downtimes->peekAhead($this->compact) as $downtime): <?php foreach ($downtimes->peekAhead($this->compact) as $downtime):
if (isset($downtime->service_description)) { if (isset($downtime->service_description)) {
$this->isService = true; $this->isService = true;
$this->stateName = Service::getStateText($downtime->service_state); $this->stateName = Service::getStateText($downtime->service_state);
} else { } else {
$this->isService = false; $this->isService = false;
$this->stateName = Host::getStateText($downtime->host_state); $this->stateName = Host::getStateText($downtime->host_state);
} }
$this->downtime = $downtime; // Set downtime for partials
?> $this->downtime = $downtime;
<tr href="<?= $this->href('monitoring/downtime/show', array('downtime_id' => $downtime->id)) ?>"> ?>
<?= $this->render('partials/downtime/downtime-header.phtml'); ?> <tr href="<?= $this->href('monitoring/downtime/show', array('downtime_id' => $downtime->id)) ?>">
</tr> <?= $this->render('partials/downtime/downtime-header.phtml') ?>
</tr>
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
<?php if (! $downtimes->hasResult()): ?> <?php if ($downtimes->hasMore()): ?>
<?= $this->translate('No downtimes found matching the filter, maybe the downtime already expired.'); ?> <div class="action-links">
<?php elseif ($downtimes->hasMore()): ?> <?= $this->qlink(
<?= $this->qlink( $this->translate('Show More'),
$this->translate('Show More'), $this->url()->without(array('view', 'limit')),
$this->url()->without(array('view', 'limit')), null,
null, array(
array( 'class' => 'action-link',
'data-base-target' => '_next', 'data-base-target' => '_next'
'class' => 'pull-right action-link' )
) ) ?>
); ?> </div>
<?php endif ?> <?php endif ?>
</div> </div>

View File

@ -4,12 +4,8 @@ use Icinga\Web\Widget\Chart\HistoryColorGrid;
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs; ?> <?= $this->tabs ?>
<?= $this->sortBox; ?> <?= $this->form ?>
<?= $this->limiter; ?>
<?= $this->paginator; ?>
<?= $this->filterEditor; ?>
<?= $form; ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content" data-base-target="_next"> <div class="content" data-base-target="_next">

View File

@ -3,11 +3,11 @@
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs ?>
<div class="grid"> <div class="sort-controls-container">
<?= $this->sortBox ?>
<?= $this->limiter ?> <?= $this->limiter ?>
<?= $this->filterEditor ?> <?= $this->sortBox ?>
</div> </div>
<?= $this->filterEditor ?>
</div> </div>
<?php endif ?> <?php endif ?>
<?= $this->partial( <?= $this->partial(

View File

@ -1,278 +1,280 @@
<?php <?php
use Icinga\Module\Monitoring\Web\Widget\StateBadges; use Icinga\Module\Monitoring\Web\Widget\StateBadges;
/** @var \Icinga\Module\Monitoring\DataView\Hostgroup $hostgroups */
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $tabs ?> <?= $this->tabs ?>
<div class="grid"> <?= $this->paginator ?>
<?= $this->sortBox ?> <div class="sort-controls-container">
<?= $this->limiter ?> <?= $this->limiter ?>
<?= $this->paginator ?> <?= $this->sortBox ?>
</div> </div>
<?= $this->filterEditor ?> <?= $this->filterEditor ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<?php if (! $hostgroups->hasResult()): ?> <?php /** @var \Icinga\Module\Monitoring\DataView\Hostgroup $hostGroups */ if (! $hostGroups->hasResult()): ?>
<p><?= $this->translate('No host groups found matching the filter.') ?></p> <p><?= $this->translate('No host groups found matching the filter.') ?></p>
</div> </div>
<?php return; endif ?> <?php return; endif ?>
<table class="table-row-selectable common-table" data-base-target="_next"> <table class="common-table table-row-selectable" data-base-target="_next">
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
<th><?= $this->translate('Host Group') ?></th> <th><?= $this->translate('Host Group') ?></th>
<th><?= $this->translate('Host States') ?></th> <th><?= $this->translate('Host States') ?></th>
<th></th> <th></th>
<th><?= $this->translate('Service States') ?></th> <th><?= $this->translate('Service States') ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($hostgroups->peekAhead($this->compact) as $hostgroup): ?> <?php foreach ($hostGroups->peekAhead($this->compact) as $hostGroup): ?>
<tr> <tr>
<td class="count-col"> <td class="count-col">
<span class="badge"><?= $hostgroup->hosts_total ?></span> <span class="badge"><?= $hostGroup->hosts_total ?></span>
</td> </td>
<th> <th>
<?= $this->qlink( <?= $this->qlink(
$hostgroup->hostgroup_alias, $hostGroup->hostgroup_alias,
'monitoring/list/hosts', 'monitoring/list/hosts',
array('hostgroup_name' => $hostgroup->hostgroup_name), array('hostgroup_name' => $hostGroup->hostgroup_name),
array('title' => sprintf( array('title' => sprintf(
$this->translate('List all hosts in the group "%s"'), $this->translate('List all hosts in the group "%s"'),
$hostgroup->hostgroup_alias $hostGroup->hostgroup_alias
)) ))
) ?> ) ?>
</th> </th>
<td> <td>
<?php <?php
$stateBadges = new StateBadges(); $stateBadges = new StateBadges();
$stateBadges $stateBadges
->setUrl('monitoring/list/hosts') ->setUrl('monitoring/list/hosts')
->setBaseFilter($this->filterEditor->getFilter()) ->setBaseFilter($this->filterEditor->getFilter())
->add( ->add(
StateBadges::STATE_UP, StateBadges::STATE_UP,
$hostgroup->hosts_up, $hostGroup->hosts_up,
array( array(
'host_state' => 0, 'host_state' => 0,
'hostgroup_name' => $hostgroup->hostgroup_name, 'hostgroup_name' => $hostGroup->hostgroup_name,
'sort' => 'host_severity' 'sort' => 'host_severity'
), ),
'List %u host that is currently in state UP in the host group "%s"', 'List %u host that is currently in state UP in the host group "%s"',
'List %u hosts which are currently in state UP in the host group "%s"', 'List %u hosts which are currently in state UP in the host group "%s"',
array($hostgroup->hosts_up, $hostgroup->hostgroup_alias) array($hostGroup->hosts_up, $hostGroup->hostgroup_alias)
) )
->add( ->add(
StateBadges::STATE_DOWN, StateBadges::STATE_DOWN,
$hostgroup->hosts_down_unhandled, $hostGroup->hosts_down_unhandled,
array( array(
'host_state' => 1, 'host_state' => 1,
'host_acknowledged' => 0, 'host_acknowledged' => 0,
'host_in_downtime' => 0, 'host_in_downtime' => 0,
'hostgroup_name' => $hostgroup->hostgroup_name, 'hostgroup_name' => $hostGroup->hostgroup_name,
'sort' => 'host_severity' 'sort' => 'host_severity'
), ),
'List %u host that is currently in state DOWN in the host group "%s"', 'List %u host that is currently in state DOWN in the host group "%s"',
'List %u hosts which are currently in state DOWN in the host group "%s"', 'List %u hosts which are currently in state DOWN in the host group "%s"',
array($hostgroup->hosts_down_unhandled, $hostgroup->hostgroup_alias) array($hostGroup->hosts_down_unhandled, $hostGroup->hostgroup_alias)
) )
->add( ->add(
StateBadges::STATE_DOWN_HANDLED, StateBadges::STATE_DOWN_HANDLED,
$hostgroup->hosts_down_handled, $hostGroup->hosts_down_handled,
array( array(
'host_state' => 1, 'host_state' => 1,
'host_handled' => 1, 'host_handled' => 1,
'hostgroup_name' => $hostgroup->hostgroup_name, 'hostgroup_name' => $hostGroup->hostgroup_name,
'sort' => 'host_severity' 'sort' => 'host_severity'
), ),
'List %u host that is currently in state DOWN (Acknowledged) in the host group "%s"', 'List %u host that is currently in state DOWN (Acknowledged) in the host group "%s"',
'List %u hosts which are currently in state DOWN (Acknowledged) in the host group "%s"', 'List %u hosts which are currently in state DOWN (Acknowledged) in the host group "%s"',
array($hostgroup->hosts_down_handled, $hostgroup->hostgroup_alias) array($hostGroup->hosts_down_handled, $hostGroup->hostgroup_alias)
) )
->add( ->add(
StateBadges::STATE_UNREACHABLE, StateBadges::STATE_UNREACHABLE,
$hostgroup->hosts_unreachable_unhandled, $hostGroup->hosts_unreachable_unhandled,
array( array(
'host_state' => 2, 'host_state' => 2,
'host_acknowledged' => 0, 'host_acknowledged' => 0,
'host_in_downtime' => 0, 'host_in_downtime' => 0,
'hostgroup_name' => $hostgroup->hostgroup_name, 'hostgroup_name' => $hostGroup->hostgroup_name,
'sort' => 'host_severity' 'sort' => 'host_severity'
), ),
'List %u host that is currently in state UNREACHABLE in the host group "%s"', 'List %u host that is currently in state UNREACHABLE in the host group "%s"',
'List %u hosts which are currently in state UNREACHABLE in the host group "%s"', 'List %u hosts which are currently in state UNREACHABLE in the host group "%s"',
array($hostgroup->hosts_unreachable_unhandled, $hostgroup->hostgroup_alias) array($hostGroup->hosts_unreachable_unhandled, $hostGroup->hostgroup_alias)
) )
->add( ->add(
StateBadges::STATE_UNREACHABLE_HANDLED, StateBadges::STATE_UNREACHABLE_HANDLED,
$hostgroup->hosts_unreachable_handled, $hostGroup->hosts_unreachable_handled,
array( array(
'host_state' => 2, 'host_state' => 2,
'host_handled' => 1, 'host_handled' => 1,
'hostgroup_name' => $hostgroup->hostgroup_name, 'hostgroup_name' => $hostGroup->hostgroup_name,
'sort' => 'host_severity' 'sort' => 'host_severity'
), ),
'List %u host that is currently in state UNREACHABLE (Acknowledged) in the host group "%s"', 'List %u host that is currently in state UNREACHABLE (Acknowledged) in the host group "%s"',
'List %u hosts which are currently in state UNREACHABLE (Acknowledged) in the host group "%s"', 'List %u hosts which are currently in state UNREACHABLE (Acknowledged) in the host group "%s"',
array($hostgroup->hosts_unreachable_handled, $hostgroup->hostgroup_alias) array($hostGroup->hosts_unreachable_handled, $hostGroup->hostgroup_alias)
) )
->add( ->add(
StateBadges::STATE_PENDING, StateBadges::STATE_PENDING,
$hostgroup->hosts_pending, $hostGroup->hosts_pending,
array( array(
'host_state' => 99, 'host_state' => 99,
'hostgroup_name' => $hostgroup->hostgroup_name, 'hostgroup_name' => $hostGroup->hostgroup_name,
'sort' => 'host_severity' 'sort' => 'host_severity'
), ),
'List %u host that is currently in state PENDING in the host group "%s"', 'List %u host that is currently in state PENDING in the host group "%s"',
'List %u hosts which are currently in state PENDING in the host group "%s"', 'List %u hosts which are currently in state PENDING in the host group "%s"',
array($hostgroup->hosts_pending, $hostgroup->hostgroup_alias) array($hostGroup->hosts_pending, $hostGroup->hostgroup_alias)
); );
echo $stateBadges->render(); echo $stateBadges->render();
?> ?>
</td> </td>
<td class="count-col"> <td class="count-col">
<?= $this->qlink( <?= $this->qlink(
$hostgroup->services_total, $hostGroup->services_total,
'monitoring/list/services', 'monitoring/list/services',
array('hostgroup_name' => $hostgroup->hostgroup_name), array('hostgroup_name' => $hostGroup->hostgroup_name),
array('title' => sprintf( array('title' => sprintf(
$this->translate('List all services of all hosts in host group "%s"'), $this->translate('List all services of all hosts in host group "%s"'),
$hostgroup->hostgroup_alias $hostGroup->hostgroup_alias
), 'class' => 'badge') ), 'class' => 'badge')
) ?> ) ?>
</td> </td>
<td> <td>
<?php <?php
$stateBadges = new StateBadges(); $stateBadges = new StateBadges();
$stateBadges $stateBadges
->setUrl('monitoring/list/services') ->setUrl('monitoring/list/services')
->add( ->add(
StateBadges::STATE_OK, StateBadges::STATE_OK,
$hostgroup->services_ok, $hostGroup->services_ok,
array( array(
'service_state' => 0, 'service_state' => 0,
'hostgroup_name' => $hostgroup->hostgroup_name, 'hostgroup_name' => $hostGroup->hostgroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %u service that is currently in state OK on hosts in the host group "%s"', 'List %u service that is currently in state OK on hosts in the host group "%s"',
'List %u services which are currently in state OK on hosts in the host group "%s"', 'List %u services which are currently in state OK on hosts in the host group "%s"',
array($hostgroup->services_ok, $hostgroup->hostgroup_alias) array($hostGroup->services_ok, $hostGroup->hostgroup_alias)
) )
->add( ->add(
StateBadges::STATE_CRITICAL, StateBadges::STATE_CRITICAL,
$hostgroup->services_critical_unhandled, $hostGroup->services_critical_unhandled,
array( array(
'service_state' => 2, 'service_state' => 2,
'service_acknowledged' => 0, 'service_acknowledged' => 0,
'service_in_downtime' => 0, 'service_in_downtime' => 0,
'host_problem' => 0, 'host_problem' => 0,
'hostgroup_name' => $hostgroup->hostgroup_name, 'hostgroup_name' => $hostGroup->hostgroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %u service that is currently in state CRITICAL on hosts in the host group "%s"', 'List %u service that is currently in state CRITICAL on hosts in the host group "%s"',
'List %u services which are currently in state CRITICAL on hosts in the host group "%s"', 'List %u services which are currently in state CRITICAL on hosts in the host group "%s"',
array($hostgroup->services_critical_unhandled, $hostgroup->hostgroup_alias) array($hostGroup->services_critical_unhandled, $hostGroup->hostgroup_alias)
) )
->add( ->add(
StateBadges::STATE_CRITICAL_HANDLED, StateBadges::STATE_CRITICAL_HANDLED,
$hostgroup->services_critical_handled, $hostGroup->services_critical_handled,
array( array(
'service_state' => 2, 'service_state' => 2,
'service_handled' => 1, 'service_handled' => 1,
'hostgroup_name' => $hostgroup->hostgroup_name, 'hostgroup_name' => $hostGroup->hostgroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %u service that is currently in state CRITICAL (Acknowledged) on hosts in the host group "%s"', 'List %u service that is currently in state CRITICAL (Acknowledged) on hosts in the host group "%s"',
'List %u services which are currently in state CRITICAL (Acknowledged) on hosts in the host group "%s"', 'List %u services which are currently in state CRITICAL (Acknowledged) on hosts in the host group "%s"',
array($hostgroup->services_critical_unhandled, $hostgroup->hostgroup_alias) array($hostGroup->services_critical_unhandled, $hostGroup->hostgroup_alias)
) )
->add( ->add(
StateBadges::STATE_UNKNOWN, StateBadges::STATE_UNKNOWN,
$hostgroup->services_unknown_unhandled, $hostGroup->services_unknown_unhandled,
array( array(
'service_state' => 3, 'service_state' => 3,
'service_acknowledged' => 0, 'service_acknowledged' => 0,
'service_in_downtime' => 0, 'service_in_downtime' => 0,
'host_problem' => 0, 'host_problem' => 0,
'hostgroup_name' => $hostgroup->hostgroup_name, 'hostgroup_name' => $hostGroup->hostgroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %u service that is currently in state UNKNOWN on hosts in the host group "%s"', 'List %u service that is currently in state UNKNOWN on hosts in the host group "%s"',
'List %u services which are currently in state UNKNOWN on hosts in the host group "%s"', 'List %u services which are currently in state UNKNOWN on hosts in the host group "%s"',
array($hostgroup->services_unknown_unhandled, $hostgroup->hostgroup_alias) array($hostGroup->services_unknown_unhandled, $hostGroup->hostgroup_alias)
) )
->add( ->add(
StateBadges::STATE_UNKNOWN_HANDLED, StateBadges::STATE_UNKNOWN_HANDLED,
$hostgroup->services_unknown_handled, $hostGroup->services_unknown_handled,
array( array(
'service_state' => 3, 'service_state' => 3,
'service_handled' => 1, 'service_handled' => 1,
'hostgroup_name' => $hostgroup->hostgroup_name, 'hostgroup_name' => $hostGroup->hostgroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %u service that is currently in state UNKNOWN (Acknowledged) on hosts in the host group "%s"', 'List %u service that is currently in state UNKNOWN (Acknowledged) on hosts in the host group "%s"',
'List %u services which are currently in state UNKNOWN (Acknowledged) on hosts in the host group "%s"', 'List %u services which are currently in state UNKNOWN (Acknowledged) on hosts in the host group "%s"',
array($hostgroup->services_unknown_handled, $hostgroup->hostgroup_alias) array($hostGroup->services_unknown_handled, $hostGroup->hostgroup_alias)
) )
->add( ->add(
StateBadges::STATE_WARNING, StateBadges::STATE_WARNING,
$hostgroup->services_warning_unhandled, $hostGroup->services_warning_unhandled,
array( array(
'service_state' => 1, 'service_state' => 1,
'service_acknowledged' => 0, 'service_acknowledged' => 0,
'service_in_downtime' => 0, 'service_in_downtime' => 0,
'host_problem' => 0, 'host_problem' => 0,
'hostgroup_name' => $hostgroup->hostgroup_name, 'hostgroup_name' => $hostGroup->hostgroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %u service that is currently in state WARNING on hosts in the host group "%s"', 'List %u service that is currently in state WARNING on hosts in the host group "%s"',
'List %u services which are currently in state WARNING on hosts in the host group "%s"', 'List %u services which are currently in state WARNING on hosts in the host group "%s"',
array($hostgroup->services_warning_unhandled, $hostgroup->hostgroup_alias) array($hostGroup->services_warning_unhandled, $hostGroup->hostgroup_alias)
) )
->add( ->add(
StateBadges::STATE_WARNING_HANDLED, StateBadges::STATE_WARNING_HANDLED,
$hostgroup->services_warning_handled, $hostGroup->services_warning_handled,
array( array(
'service_state' => 1, 'service_state' => 1,
'service_handled' => 1, 'service_handled' => 1,
'hostgroup_name' => $hostgroup->hostgroup_name, 'hostgroup_name' => $hostGroup->hostgroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %u service that is currently in state WARNING (Acknowledged) on hosts in the host group "%s"', 'List %u service that is currently in state WARNING (Acknowledged) on hosts in the host group "%s"',
'List %u services which are currently in state WARNING (Acknowledged) on hosts in the host group "%s"', 'List %u services which are currently in state WARNING (Acknowledged) on hosts in the host group "%s"',
array($hostgroup->services_warning_handled, $hostgroup->hostgroup_alias) array($hostGroup->services_warning_handled, $hostGroup->hostgroup_alias)
) )
->add( ->add(
StateBadges::STATE_PENDING, StateBadges::STATE_PENDING,
$hostgroup->services_pending, $hostGroup->services_pending,
array( array(
'service_state' => 99, 'service_state' => 99,
'hostgroup_name' => $hostgroup->hostgroup_name, 'hostgroup_name' => $hostGroup->hostgroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %u service that is currently in state PENDING on hosts in the host group "%s"', 'List %u service that is currently in state PENDING on hosts in the host group "%s"',
'List %u services which are currently in state PENDING on hosts in the host group "%s"', 'List %u services which are currently in state PENDING on hosts in the host group "%s"',
array($hostgroup->services_pending, $hostgroup->hostgroup_alias) array($hostGroup->services_pending, $hostGroup->hostgroup_alias)
); );
echo $stateBadges->render(); echo $stateBadges->render();
?> ?>
</td> </td>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
<?php if ($hostgroups->hasMore()): ?> <?php if ($hostGroups->hasMore()): ?>
<?= $this->qlink( <div class="action-links">
$this->translate('Show More'), <?= $this->qlink(
$this->url()->without(array('view', 'limit')), $this->translate('Show More'),
null, $this->url()->without(array('view', 'limit')),
array( null,
'data-base-target' => '_next', array(
'class' => 'pull-right action-link' 'class' => 'action-link',
) 'data-base-target' => '_next'
) ?> )
) ?>
</div>
<?php endif ?> <?php endif ?>
</div> </div>

View File

@ -4,14 +4,12 @@ use Icinga\Module\Monitoring\Object\Host;
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs ?>
<div class="grid"> <?= $this->render('list/components/hostssummary.phtml') ?>
<?= $this->render('list/components/hostssummary.phtml') ?> <?= $this->render('list/components/selectioninfo.phtml') ?>
<?= $this->render('list/components/selectioninfo.phtml') ?> <?= $this->paginator ?>
</div> <div class="sort-controls-container">
<div class="grid">
<?= $this->sortBox ?>
<?= $this->limiter ?> <?= $this->limiter ?>
<?= $this->paginator ?> <?= $this->sortBox ?>
</div> </div>
<?= $this->filterEditor ?> <?= $this->filterEditor ?>
</div> </div>
@ -19,7 +17,7 @@ if (! $this->compact): ?>
<div class="content"> <div class="content">
<?php if (! $hosts->hasResult()): ?> <?php if (! $hosts->hasResult()): ?>
<p><?= $this->translate('No hosts found matching the filter.') ?></p> <p><?= $this->translate('No hosts found matching the filter.') ?></p>
</div> </div>
<?php return; endif ?> <?php return; endif ?>
<table data-base-target="_next" <table data-base-target="_next"
class="table-row-selectable state-table multiselect" class="table-row-selectable state-table multiselect"
@ -96,14 +94,14 @@ if (! $this->compact): ?>
</tbody> </tbody>
</table> </table>
<?php if ($hosts->hasMore()): ?> <?php if ($hosts->hasMore()): ?>
<div class="text-right"> <div class="action-links">
<?= $this->qlink( <?= $this->qlink(
$this->translate('Show More'), $this->translate('Show More'),
$this->url()->without(array('view', 'limit')), $this->url()->without(array('view', 'limit')),
null, null,
array( array(
'data-base-target' => '_next', 'class' => 'action-link',
'class' => 'action-link' 'data-base-target' => '_next'
) )
) ?> ) ?>
</div> </div>

View File

@ -4,11 +4,11 @@ use Icinga\Module\Monitoring\Object\Service;
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $tabs ?> <?= $this->tabs ?>
<div class="grid"> <?= $this->paginator ?>
<?= $this->sortBox ?> <div class="sort-controls-container">
<?= $this->limiter ?> <?= $this->limiter ?>
<?= $this->paginator ?> <?= $this->sortBox ?>
</div> </div>
<?= $this->filterEditor ?> <?= $this->filterEditor ?>
</div> </div>
@ -77,7 +77,7 @@ if (! $this->compact): ?>
</tbody> </tbody>
</table> </table>
<?php if ($notifications->hasMore()): ?> <?php if ($notifications->hasMore()): ?>
<div class="text-right"> <div class="action-links">
<?= $this->qlink( <?= $this->qlink(
$this->translate('Show More'), $this->translate('Show More'),
$this->url(isset($notificationsUrl) ? $notificationsUrl : null)->without(array('view', 'limit')), $this->url(isset($notificationsUrl) ? $notificationsUrl : null)->without(array('view', 'limit')),

View File

@ -2,173 +2,175 @@
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $tabs ?> <?= $this->tabs ?>
<div class="grid"> <?= $this->paginator ?>
<?= $this->sortBox ?> <div class="sort-controls-container">
<?= $this->limiter ?> <?= $this->limiter ?>
<?= $this->paginator ?> <?= $this->sortBox ?>
</div> </div>
<?= $this->filterEditor ?> <?= $this->filterEditor ?>
</div> </div>
<?php endif ?> <?php endif ?>
<div class="content"> <div class="content">
<?php if (! $servicegroups->hasResult()): ?> <?php if (! $serviceGroups->hasResult()): ?>
<p><?= $this->translate('No service groups found matching the filter.') ?></p> <p><?= $this->translate('No service groups found matching the filter.') ?></p>
</div> </div>
<?php return; endif ?> <?php return; endif ?>
<table class="table-row-selectable common-table" data-base-target="_next"> <table class="table-row-selectable common-table" data-base-target="_next">
<thead> <thead>
<tr> <tr>
<th></th> <th></th>
<th><?= $this->translate('Service Group') ?></th> <th><?= $this->translate('Service Group') ?></th>
<th><?= $this->translate('Service States') ?></th> <th><?= $this->translate('Service States') ?></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php foreach ($servicegroups->peekAhead($this->compact) as $serviceGroup): ?> <?php foreach ($serviceGroups->peekAhead($this->compact) as $serviceGroup): ?>
<tr> <tr>
<td class="count-col"> <td class="count-col">
<span class="badge"><?= $serviceGroup->services_total ?></span> <span class="badge"><?= $serviceGroup->services_total ?></span>
</td> </td>
<th> <th>
<?= $this->qlink( <?= $this->qlink(
$serviceGroup->servicegroup_alias, $serviceGroup->servicegroup_alias,
'monitoring/list/services', 'monitoring/list/services',
array('servicegroup_name' => $serviceGroup->servicegroup_name), array('servicegroup_name' => $serviceGroup->servicegroup_name),
array('title' => sprintf($this->translate('List all services in the group "%s"'), $serviceGroup->servicegroup_alias)) array('title' => sprintf($this->translate('List all services in the group "%s"'), $serviceGroup->servicegroup_alias))
) ?> ) ?>
</th> </th>
<td> <td>
<?php <?php
$stateBadges = new StateBadges(); $stateBadges = new StateBadges();
$stateBadges $stateBadges
->setUrl('monitoring/list/services') ->setUrl('monitoring/list/services')
->setBaseFilter($this->filterEditor->getFilter()) ->setBaseFilter($this->filterEditor->getFilter())
->add( ->add(
StateBadges::STATE_OK, StateBadges::STATE_OK,
$serviceGroup->services_ok, $serviceGroup->services_ok,
array( array(
'service_state' => 0, 'service_state' => 0,
'servicegroup_name' => $serviceGroup->servicegroup_name, 'servicegroup_name' => $serviceGroup->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %s service that is currently in state OK in service group "%s"', 'List %s service that is currently in state OK in service group "%s"',
'List %s services which are currently in state OK in service group "%s"', 'List %s services which are currently in state OK in service group "%s"',
array($serviceGroup->services_ok, $serviceGroup->servicegroup_alias) array($serviceGroup->services_ok, $serviceGroup->servicegroup_alias)
) )
->add( ->add(
StateBadges::STATE_CRITICAL, StateBadges::STATE_CRITICAL,
$serviceGroup->services_critical_unhandled, $serviceGroup->services_critical_unhandled,
array( array(
'service_state' => 2, 'service_state' => 2,
'service_acknowledged' => 0, 'service_acknowledged' => 0,
'service_in_downtime' => 0, 'service_in_downtime' => 0,
'host_problem' => 0, 'host_problem' => 0,
'servicegroup_name' => $serviceGroup->servicegroup_name, 'servicegroup_name' => $serviceGroup->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %s service that is currently in state CRITICAL in service group "%s"', 'List %s service that is currently in state CRITICAL in service group "%s"',
'List %s services which are currently in state CRITICAL in service group "%s"', 'List %s services which are currently in state CRITICAL in service group "%s"',
array($serviceGroup->services_critical_unhandled, $serviceGroup->servicegroup_alias) array($serviceGroup->services_critical_unhandled, $serviceGroup->servicegroup_alias)
) )
->add( ->add(
StateBadges::STATE_CRITICAL_HANDLED, StateBadges::STATE_CRITICAL_HANDLED,
$serviceGroup->services_critical_handled, $serviceGroup->services_critical_handled,
array( array(
'service_state' => 2, 'service_state' => 2,
'service_handled' => 1, 'service_handled' => 1,
'servicegroup_name' => $serviceGroup->servicegroup_name, 'servicegroup_name' => $serviceGroup->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %s service that is currently in state CRITICAL (Acknowledged) in service group "%s"', 'List %s service that is currently in state CRITICAL (Acknowledged) in service group "%s"',
'List %s services which are currently in state CRITICAL (Acknowledged) in service group "%s"', 'List %s services which are currently in state CRITICAL (Acknowledged) in service group "%s"',
array($serviceGroup->services_critical_unhandled, $serviceGroup->servicegroup_alias) array($serviceGroup->services_critical_unhandled, $serviceGroup->servicegroup_alias)
) )
->add( ->add(
StateBadges::STATE_UNKNOWN, StateBadges::STATE_UNKNOWN,
$serviceGroup->services_unknown_unhandled, $serviceGroup->services_unknown_unhandled,
array( array(
'service_state' => 3, 'service_state' => 3,
'service_acknowledged' => 0, 'service_acknowledged' => 0,
'service_in_downtime' => 0, 'service_in_downtime' => 0,
'host_problem' => 0, 'host_problem' => 0,
'servicegroup_name' => $serviceGroup->servicegroup_name, 'servicegroup_name' => $serviceGroup->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %s service that is currently in state UNKNOWN in service group "%s"', 'List %s service that is currently in state UNKNOWN in service group "%s"',
'List %s services which are currently in state UNKNOWN in service group "%s"', 'List %s services which are currently in state UNKNOWN in service group "%s"',
array($serviceGroup->services_unknown_unhandled, $serviceGroup->servicegroup_alias) array($serviceGroup->services_unknown_unhandled, $serviceGroup->servicegroup_alias)
) )
->add( ->add(
StateBadges::STATE_UNKNOWN_HANDLED, StateBadges::STATE_UNKNOWN_HANDLED,
$serviceGroup->services_unknown_handled, $serviceGroup->services_unknown_handled,
array( array(
'service_state' => 3, 'service_state' => 3,
'service_handled' => 1, 'service_handled' => 1,
'servicegroup_name' => $serviceGroup->servicegroup_name, 'servicegroup_name' => $serviceGroup->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %s service that is currently in state UNKNOWN (Acknowledged) in service group "%s"', 'List %s service that is currently in state UNKNOWN (Acknowledged) in service group "%s"',
'List %s services which are currently in state UNKNOWN (Acknowledged) in service group "%s"', 'List %s services which are currently in state UNKNOWN (Acknowledged) in service group "%s"',
array($serviceGroup->services_unknown_handled, $serviceGroup->servicegroup_alias) array($serviceGroup->services_unknown_handled, $serviceGroup->servicegroup_alias)
) )
->add( ->add(
StateBadges::STATE_WARNING, StateBadges::STATE_WARNING,
$serviceGroup->services_warning_unhandled, $serviceGroup->services_warning_unhandled,
array( array(
'service_state' => 1, 'service_state' => 1,
'service_acknowledged' => 0, 'service_acknowledged' => 0,
'service_in_downtime' => 0, 'service_in_downtime' => 0,
'host_problem' => 0, 'host_problem' => 0,
'servicegroup_name' => $serviceGroup->servicegroup_name, 'servicegroup_name' => $serviceGroup->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %s service that is currently in state WARNING in service group "%s"', 'List %s service that is currently in state WARNING in service group "%s"',
'List %s services which are currently in state WARNING in service group "%s"', 'List %s services which are currently in state WARNING in service group "%s"',
array($serviceGroup->services_warning_unhandled, $serviceGroup->servicegroup_alias) array($serviceGroup->services_warning_unhandled, $serviceGroup->servicegroup_alias)
) )
->add( ->add(
StateBadges::STATE_WARNING_HANDLED, StateBadges::STATE_WARNING_HANDLED,
$serviceGroup->services_warning_handled, $serviceGroup->services_warning_handled,
array( array(
'service_state' => 1, 'service_state' => 1,
'service_handled' => 1, 'service_handled' => 1,
'servicegroup_name' => $serviceGroup->servicegroup_name, 'servicegroup_name' => $serviceGroup->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %s service that is currently in state WARNING (Acknowledged) in service group "%s"', 'List %s service that is currently in state WARNING (Acknowledged) in service group "%s"',
'List %s services which are currently in state WARNING (Acknowledged) in service group "%s"', 'List %s services which are currently in state WARNING (Acknowledged) in service group "%s"',
array($serviceGroup->services_warning_handled, $serviceGroup->servicegroup_alias) array($serviceGroup->services_warning_handled, $serviceGroup->servicegroup_alias)
) )
->add( ->add(
StateBadges::STATE_PENDING, StateBadges::STATE_PENDING,
$serviceGroup->services_pending, $serviceGroup->services_pending,
array( array(
'service_state' => 99, 'service_state' => 99,
'servicegroup_name' => $serviceGroup->servicegroup_name, 'servicegroup_name' => $serviceGroup->servicegroup_name,
'sort' => 'service_severity' 'sort' => 'service_severity'
), ),
'List %s service that is currenlty in state PENDING in service group "%s"', 'List %s service that is currenlty in state PENDING in service group "%s"',
'List %s services which are currently in state PENDING in service group "%s"', 'List %s services which are currently in state PENDING in service group "%s"',
array($serviceGroup->services_pending, $serviceGroup->servicegroup_alias) array($serviceGroup->services_pending, $serviceGroup->servicegroup_alias)
); );
echo $stateBadges->render(); echo $stateBadges->render();
?> ?>
</td> </td>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
<?php if ($servicegroups->hasMore()): ?> <?php if ($serviceGroups->hasMore()): ?>
<?= $this->qlink( <div class="action-links">
$this->translate('Show More'), <?= $this->qlink(
$this->url()->without(array('view', 'limit')), $this->translate('Show More'),
null, $this->url()->without(array('view', 'limit')),
array( null,
'data-base-target' => '_next', array(
'class' => 'pull-right action-link' 'class' => 'action-link',
) 'data-base-target' => '_next'
) ?> )
) ?>
</div>
<?php endif ?> <?php endif ?>
</div> </div>

View File

@ -5,14 +5,12 @@ use Icinga\Module\Monitoring\Object\Service;
if (! $this->compact): ?> if (! $this->compact): ?>
<div class="controls"> <div class="controls">
<?= $this->tabs ?> <?= $this->tabs ?>
<div class="grid"> <?= $this->render('list/components/servicesummary.phtml') ?>
<?= $this->render('list/components/servicesummary.phtml') ?> <?= $this->render('list/components/selectioninfo.phtml') ?>
<?= $this->render('list/components/selectioninfo.phtml') ?> <?= $this->paginator ?>
</div> <div class="sort-controls-container">
<div class="grid">
<?= $this->sortBox ?>
<?= $this->limiter ?> <?= $this->limiter ?>
<?= $this->paginator ?> <?= $this->sortBox ?>
</div> </div>
<?= $this->filterEditor ?> <?= $this->filterEditor ?>
</div> </div>
@ -101,16 +99,16 @@ if (! $this->compact): ?>
</tbody> </tbody>
</table> </table>
<?php if ($services->hasMore()): ?> <?php if ($services->hasMore()): ?>
<div class="text-right"> <div class="action-links">
<?= $this->qlink( <?= $this->qlink(
$this->translate('Show More'), $this->translate('Show More'),
$this->url()->without(array('view', 'limit')), $this->url()->without(array('view', 'limit')),
null, null,
array( array(
'data-base-target' => '_next', 'class' => 'action-link',
'class' => 'action-link' 'data-base-target' => '_next'
) )
) ?> ) ?>
</div> </div>
<?php endif ?> <?php endif ?>
</div> </div>

View File

@ -16,12 +16,12 @@ class ContactgroupQuery extends IdoQuery
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
protected $groupBase = array('contactgroups' => array('cg.contactgroup_id', 'cgo.object_id')); protected $groupBase = array('contactgroups' => array('cg.contactgroup_id'));
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
protected $groupOrigin = array('contacts', 'hosts', 'services'); protected $groupOrigin = array('hosts', 'members', 'services');
/** /**
* {@inheritdoc} * {@inheritdoc}
@ -32,28 +32,8 @@ class ContactgroupQuery extends IdoQuery
'contactgroup_name' => 'cgo.name1', 'contactgroup_name' => 'cgo.name1',
'contactgroup_alias' => 'cg.alias COLLATE latin1_general_ci' 'contactgroup_alias' => 'cg.alias COLLATE latin1_general_ci'
), ),
'contacts' => array( 'members' => array(
'contact_id' => 'c.contact_id', 'contact_count' => 'COUNT(cgm.contactgroup_member_id)'
'contact' => 'co.name1 COLLATE latin1_general_ci',
'contact_name' => 'co.name1',
'contact_alias' => 'c.alias COLLATE latin1_general_ci',
'contact_email' => 'c.email_address COLLATE latin1_general_ci',
'contact_pager' => 'c.pager_address',
'contact_object_id' => 'c.contact_object_id',
'contact_has_host_notfications' => 'c.host_notifications_enabled',
'contact_has_service_notfications' => 'c.service_notifications_enabled',
'contact_can_submit_commands' => 'c.can_submit_commands',
'contact_notify_service_recovery' => 'c.notify_service_recovery',
'contact_notify_service_warning' => 'c.notify_service_warning',
'contact_notify_service_critical' => 'c.notify_service_critical',
'contact_notify_service_unknown' => 'c.notify_service_unknown',
'contact_notify_service_flapping' => 'c.notify_service_flapping',
'contact_notify_service_downtime' => 'c.notify_service_recovery',
'contact_notify_host_recovery' => 'c.notify_host_recovery',
'contact_notify_host_down' => 'c.notify_host_down',
'contact_notify_host_unreachable' => 'c.notify_host_unreachable',
'contact_notify_host_flapping' => 'c.notify_host_flapping',
'contact_notify_host_downtime' => 'c.notify_host_downtime'
), ),
'hostgroups' => array( 'hostgroups' => array(
'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci', 'hostgroup' => 'hgo.name1 COLLATE latin1_general_ci',
@ -99,22 +79,18 @@ class ContactgroupQuery extends IdoQuery
} }
/** /**
* Join contacts * Join contact group members
*/ */
protected function joinContacts() protected function joinMembers()
{ {
$this->select->joinLeft( $this->select->joinLeft(
array('cgm' => $this->prefix . 'contactgroup_members'), array('cgm' => $this->prefix . 'contactgroup_members'),
'cgm.contactgroup_id = cg.contactgroup_id', 'cgm.contactgroup_id = cg.contactgroup_id',
array() array()
)->joinLeft( )->join(
array('co' => $this->prefix . 'objects'), array('co' => $this->prefix . 'objects'),
'co.object_id = cgm.contact_object_id AND co.is_active = 1 AND co.objecttype_id = 10', 'co.object_id = cgm.contact_object_id AND co.is_active = 1 AND co.objecttype_id = 10',
array() array()
)->joinLeft(
array('c' => $this->prefix . 'contacts'),
'c.contact_object_id = co.object_id',
array()
); );
} }

View File

@ -11,31 +11,9 @@ class Contactgroup extends DataView
public function getColumns() public function getColumns()
{ {
return array( return array(
'instance_name',
'contactgroup_name', 'contactgroup_name',
'contactgroup_alias', 'contactgroup_alias',
'contact_object_id', 'contact_count'
'contact_id',
'contact_name',
'contact_alias',
'contact_email',
'contact_pager',
'contact_has_host_notfications',
'contact_has_service_notfications',
'contact_can_submit_commands',
'contact_notify_service_recovery',
'contact_notify_service_warning',
'contact_notify_service_critical',
'contact_notify_service_unknown',
'contact_notify_service_flapping',
'contact_notify_service_downtime',
'contact_notify_host_recovery',
'contact_notify_host_down',
'contact_notify_host_unreachable',
'contact_notify_host_flapping',
'contact_notify_host_downtime',
'contact_notify_host_timeperiod',
'contact_notify_service_timeperiod'
); );
} }
@ -60,9 +38,10 @@ class Contactgroup extends DataView
public function getStaticFilterColumns() public function getStaticFilterColumns()
{ {
return array( return array(
'contactgroup', 'contact', 'contactgroup',
'host', 'host_name', 'host_display_name', 'host_alias', 'host', 'host_name', 'host_display_name', 'host_alias',
'hostgroup', 'hostgroup_alias', 'hostgroup_name', 'hostgroup', 'hostgroup_alias', 'hostgroup_name',
'instance_name',
'service', 'service_description', 'service_display_name', 'service', 'service_description', 'service_display_name',
'servicegroup', 'servicegroup_alias', 'servicegroup_name' 'servicegroup', 'servicegroup_alias', 'servicegroup_name'
); );

View File

@ -47,17 +47,6 @@
} }
} }
// Multi-selection info
.selection-info {
float: right;
font-size: @font-size-small;
padding: @vertical-padding / 2 0;
&:hover {
cursor: help;
}
}
// Performance data pie charts // Performance data pie charts
.sparkline { .sparkline {
height: 1em; height: 1em;
@ -79,6 +68,11 @@
} }
} }
.controls > .hosts-summary,
.controls > .services-summary {
float: left;
}
// State table in the host and service multi-selection and detail views // State table in the host and service multi-selection and detail views
.host-detail-state, .host-detail-state,
.service-detail-state { .service-detail-state {

View File

@ -1,7 +1,34 @@
/*! Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */ /*! Icinga Web 2 | (c) 2015 Icinga Development Team | GPLv2+ */
// TODO(el): Rename .filter to .filter-control
// Backend selection control in user and group list views
.backend-selection {
float: left;
}
.backend-selection,
.pagination-control,
.selection-info,
.sort-controls-container {
margin-bottom: 0.5em;
}
.backend-selection,
.pagination-control,
.sort-controls-container {
// Select controls may not respect font-size thus leading to improperly vertical alignment w/o big enough line-height
line-height: 2em;
}
.filter {
// Display filter control on a new line
clear: both;
}
.limiter-control > .control-group { .limiter-control > .control-group {
padding: 0; padding: 0;
// Note that the sort-control form does not have padding as it's utilizing different decorators
> .control-label-group { > .control-label-group {
text-align: left; text-align: left;
@ -18,7 +45,17 @@
} }
} }
.limiter-control,
.sort-control {
// Display limiter and sort control both on the same line; floating could be used here too to achieve the same
display: inline-block;
}
.pagination-control { .pagination-control {
// Display the pagination-control on a new line
clear: both;
float: left;
li { li {
&.active { &.active {
> a, > a,
@ -57,7 +94,19 @@
} }
} }
// Multi-selection info
.selection-info {
float: right;
font-size: @font-size-small;
&:hover {
cursor: help;
}
}
.sort-control { .sort-control {
margin-left: 0.25em;
label { label {
width: auto; width: auto;
margin-right: 0.5em; margin-right: 0.5em;
@ -78,6 +127,16 @@
} }
} }
.sort-controls-container {
clear: right;
float: right;
}
.sort-direction-control {
margin-left: 0.25em;
width: 1em;
}
html.no-js .sort-control form { html.no-js .sort-control form {
display: table; display: table;
margin-left: auto; margin-left: auto;

View File

@ -177,41 +177,6 @@ a:hover > .icon-cancel {
width: @name-value-table-name-width; width: @name-value-table-name-width;
} }
// TODO(el): Fix
.controls {
.limiter-control {
float: right;
padding: @vertical-padding / 2 0;
margin-bottom: 0.25em;
}
.pagination-control {
padding: @vertical-padding / 2 0;
margin-bottom: 0.25em;
}
.sort-control {
float: right;
padding: @vertical-padding / 2 0;
margin-bottom: 0.25em;
margin-left: 0.5em;
}
.sort-direction-control {
margin-bottom: 0.5em;
margin-left: 0.5em;
width: 1em;
}
.filter {
margin-bottom: 0.5em;
}
.selection-info {
margin-left: 0.5em;
}
}
/* Styles for centering content of unknown width and height both horizontally and vertically /* Styles for centering content of unknown width and height both horizontally and vertically
* *
* Example markup: * Example markup: