mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 08:14:03 +02:00
parent
74cf3cf375
commit
29648191e4
@ -205,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'),
|
||||||
@ -221,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',
|
||||||
@ -247,7 +240,6 @@ class Monitoring_ListController extends Controller
|
|||||||
'services_unknown_handled',
|
'services_unknown_handled',
|
||||||
'services_pending',
|
'services_pending',
|
||||||
))->getQuery()->fetchRow();
|
))->getQuery()->fetchRow();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -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(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user