mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
Merge ceb6c3109f into 4d3fcc513e
This commit is contained in:
commit
cf145f20a5
3 changed files with 32 additions and 0 deletions
|
|
@ -12,10 +12,14 @@ use Icinga\Module\Icingadb\Web\Control\SearchBar\ObjectSuggestions;
|
|||
use Icinga\Module\Icingadb\Web\Control\ViewModeSwitcher;
|
||||
use Icinga\Module\Icingadb\Web\Controller;
|
||||
use Icinga\Module\Icingadb\Widget\ItemList\LoadMoreObjectList;
|
||||
use ipl\Html\Attributes;
|
||||
use ipl\Html\HtmlElement;
|
||||
use ipl\Stdlib\Filter;
|
||||
use ipl\Web\Control\LimitControl;
|
||||
use ipl\Web\Control\SortControl;
|
||||
use ipl\Web\Url;
|
||||
use ipl\Web\Widget\ActionLink;
|
||||
use ipl\Web\Widget\ButtonLink;
|
||||
|
||||
class HistoryController extends Controller
|
||||
{
|
||||
|
|
@ -93,6 +97,14 @@ class HistoryController extends Controller
|
|||
|
||||
yield $this->export($history);
|
||||
|
||||
$this->addControl(
|
||||
new ActionLink(
|
||||
'Scroll to top',
|
||||
$this->getRequest()->getUrl() . '#page-1',
|
||||
'angles-up',
|
||||
new Attributes(['class' => 'scroll-to-top'])
|
||||
)
|
||||
);
|
||||
$this->addControl($sortControl);
|
||||
$this->addControl($limitControl);
|
||||
$this->addControl($viewModeSwitcher);
|
||||
|
|
@ -113,6 +125,7 @@ class HistoryController extends Controller
|
|||
if ($compact && $page > 1) {
|
||||
$this->document->addFrom($historyList);
|
||||
} else {
|
||||
$this->addContent(new HtmlElement('span', new Attributes(['id' => 'page-1'])));
|
||||
$this->addContent($historyList);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -314,3 +314,21 @@ form[name="form_confirm_removal"] {
|
|||
opacity: .9;
|
||||
}
|
||||
}
|
||||
|
||||
.scroll-to-top {
|
||||
border-radius: .4em;
|
||||
padding: .25em;
|
||||
display: inline-flex;
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.scroll-to-top:hover {
|
||||
background: @control-hover-bg;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
#page-1 {
|
||||
display: block;
|
||||
width: 1px;
|
||||
margin: -1em 0 1em -1em;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -644,6 +644,7 @@
|
|||
|
||||
// Set data-icinga-url to make it available for Icinga.History.getCurrentState()
|
||||
req.$target.closest('.container').data('icingaUrl', url);
|
||||
req.$target.closest('.container').find('.controls .scroll-to-top').attr('href', url.split('#')[0] + '#page-1');
|
||||
|
||||
this.icinga.history.replaceCurrentState();
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue