Header: Add header to event history
Add header to the following widgets: - FilterEditor - SortBox refs #7976
This commit is contained in:
parent
6f2d428254
commit
03160ef81a
|
@ -676,9 +676,9 @@ class FilterEditor extends AbstractWidget
|
|||
public function render()
|
||||
{
|
||||
if (! $this->preservedUrl()->getParam('modifyFilter')) {
|
||||
return $this->renderSearch() . $this->shorten($this->filter, 50);
|
||||
}
|
||||
return $this->renderSearch()
|
||||
$filterEditor = $this->renderSearch() . $this->shorten($this->filter, 50);
|
||||
} else {
|
||||
$filterEditor = $this->renderSearch()
|
||||
. '<form action="'
|
||||
. Url::fromRequest()
|
||||
. '" class="filterEditor" method="POST">'
|
||||
|
@ -692,6 +692,14 @@ class FilterEditor extends AbstractWidget
|
|||
. '</form>';
|
||||
}
|
||||
|
||||
return sprintf(
|
||||
'<div class="filter-editor dontprint">'
|
||||
. '<h2 tabindex="-1" class="sr-only">%s</h2>%s</div>',
|
||||
t('Filters'),
|
||||
$filterEditor
|
||||
);
|
||||
}
|
||||
|
||||
protected function shorten($string, $length)
|
||||
{
|
||||
if (strlen($string) > $length) {
|
||||
|
|
|
@ -133,6 +133,13 @@ class SortBox extends AbstractWidget
|
|||
if ($this->request) {
|
||||
$form->populate($this->request->getParams());
|
||||
}
|
||||
return $form;
|
||||
|
||||
return sprintf(
|
||||
'<div class="sort-box dontprint">'
|
||||
. '<h2 tabindex="-1" class="sr-only">%s</h2>%s%s</div>',
|
||||
t('Sort Criteria'),
|
||||
t('Sort by'),
|
||||
(string) $form
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,16 +4,10 @@ use Icinga\Module\Monitoring\Object\Host;
|
|||
use Icinga\Module\Monitoring\Object\Service;
|
||||
|
||||
?>
|
||||
|
||||
<?php if (false === $this->compact): ?>
|
||||
<div class="controls">
|
||||
<?= $this->tabs ?>
|
||||
<div style="margin: 1em" class="dontprint">
|
||||
<div style="float: right">
|
||||
<?= $this->translate('Sort by') ?> <?= $this->sortControl ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?= $this->sortControl ?>
|
||||
<?= $this->widget('limiter', array('url' => $this->url, 'max' => $this->history->count())); ?>
|
||||
<?= $this->paginationControl($history, null, null, array('preserve' => $this->preserve)); ?>
|
||||
|
||||
|
@ -22,6 +16,7 @@ use Icinga\Module\Monitoring\Object\Service;
|
|||
|
||||
<div class="content">
|
||||
<?= $this->filterEditor ?>
|
||||
<h1 tabindex="-1"><?= $this->translate('Event History') ?></h1>
|
||||
<?php if (empty($history)): ?>
|
||||
<?= $this->translate('No history events matching the filter') ?>
|
||||
</div>
|
||||
|
|
|
@ -198,3 +198,7 @@ hr.command-separator {
|
|||
border: none;
|
||||
border-bottom: 2px solid @colorPetrol;
|
||||
}
|
||||
|
||||
.sort-box {
|
||||
float: right;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue