mirror of
https://github.com/Icinga/icingadb-web.git
synced 2026-05-28 04:36:06 -04:00
HostsController: Don't show statussummary in compact view
This commit is contained in:
parent
61b2c7f52f
commit
ee2f4d436e
1 changed files with 16 additions and 7 deletions
|
|
@ -17,7 +17,11 @@ class HostsController extends Controller
|
|||
$db = $this->getDb();
|
||||
|
||||
$hosts = Host::on($db)->with('state');
|
||||
$summary = HoststateSummary::on($db)->with('state');
|
||||
|
||||
$summary = null;
|
||||
if (! $this->view->compact) {
|
||||
$summary = HoststateSummary::on($db)->with('state');
|
||||
}
|
||||
|
||||
$limitControl = $this->createLimitControl();
|
||||
$paginationControl = $this->createPaginationControl($hosts);
|
||||
|
|
@ -37,9 +41,12 @@ class HostsController extends Controller
|
|||
->setViewMode($viewModeSwitcher->getViewMode());
|
||||
|
||||
$this->filter($hosts);
|
||||
$this->filter($summary);
|
||||
|
||||
yield $this->export($hosts, $summary);
|
||||
if (isset($summary)) {
|
||||
$this->filter($summary);
|
||||
yield $this->export($hosts, $summary);
|
||||
} else {
|
||||
yield $this->export($hosts);
|
||||
}
|
||||
|
||||
$this->addControl($paginationControl);
|
||||
$this->addControl($sortControl);
|
||||
|
|
@ -49,9 +56,11 @@ class HostsController extends Controller
|
|||
|
||||
$this->addContent($hostList);
|
||||
|
||||
$this->addFooter(
|
||||
(new HostStatusBar($summary->first()))->setBaseFilter($this->getFilter())
|
||||
);
|
||||
if (isset($summary)) {
|
||||
$this->addFooter(
|
||||
(new HostStatusBar($summary->first()))->setBaseFilter($this->getFilter())
|
||||
);
|
||||
}
|
||||
|
||||
$this->setAutorefreshInterval(10);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue