mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-26 03:09:10 +02:00
Render also the cog icon when there is more than 1 home
This commit is contained in:
parent
23de575782
commit
3be596641f
@ -48,8 +48,6 @@ class DashboardsController extends CompatController
|
||||
$pane = $this->getParam('pane');
|
||||
$this->dashboard->load(DashboardHome::DEFAULT_HOME, $pane);
|
||||
|
||||
$this->createTabs();
|
||||
|
||||
$activeHome = $this->dashboard->getActiveHome();
|
||||
if (! $activeHome || ! $activeHome->hasEntries()) {
|
||||
$this->addTitleTab(t('Welcome'));
|
||||
@ -64,6 +62,8 @@ class DashboardsController extends CompatController
|
||||
$this->dashboard->addHtml($welcomeForm);
|
||||
}
|
||||
|
||||
$this->createTabs();
|
||||
|
||||
$this->addContent($this->dashboard);
|
||||
}
|
||||
|
||||
@ -472,9 +472,15 @@ class DashboardsController extends CompatController
|
||||
{
|
||||
$tabs = $this->dashboard->getTabs();
|
||||
$activeHome = $this->dashboard->getActiveHome();
|
||||
if ($activeHome && ($activeHome->getName() !== DashboardHome::DEFAULT_HOME || $activeHome->hasEntries())) {
|
||||
if ($activeHome
|
||||
&& (
|
||||
! $activeHome->isDefaultHome()
|
||||
|| $activeHome->hasEntries()
|
||||
|| count($this->dashboard->getEntries()) > 1
|
||||
)
|
||||
) {
|
||||
$params = [];
|
||||
if ($activeHome->getName() !== DashboardHome::DEFAULT_HOME) {
|
||||
if (! $activeHome->isDefaultHome()) {
|
||||
$params['home'] = $activeHome->getName();
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ trait DashboardManager
|
||||
$home = $home instanceof DashboardHome ? $home : $this->getEntry($home);
|
||||
$home->removeEntries();
|
||||
|
||||
if ($home->getName() !== DashboardHome::DEFAULT_HOME) {
|
||||
if (! $home->isDefaultHome()) {
|
||||
DBUtils::getConn()->delete(DashboardHome::TABLE, ['id = ?' => $home->getUuid()]);
|
||||
} elseif (! $home->isDisabled()) {
|
||||
DBUtils::getConn()->update(DashboardHome::TABLE, ['disabled' => DBUtils::bool2BoolEnum(true)], [
|
||||
|
@ -114,7 +114,7 @@ class Dashboard extends BaseHtmlElement implements DashboardEntry
|
||||
public function getTabs()
|
||||
{
|
||||
$activeHome = $this->getActiveHome();
|
||||
if ($activeHome && $activeHome->getName() !== DashboardHome::DEFAULT_HOME) {
|
||||
if ($activeHome && ! $activeHome->isDefaultHome()) {
|
||||
$url = Url::fromPath(self::BASE_ROUTE . '/home')->getUrlWithout(['home', $this->tabParam]);
|
||||
$url->addParams(['home' => $activeHome->getName()]);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user