Make use of the new controller by default

This commit is contained in:
Yonas Habteab 2022-03-11 16:45:07 +01:00
parent 2c795a5dbc
commit c71f3cd75d
4 changed files with 7 additions and 4 deletions

View File

@ -12,6 +12,7 @@ use Icinga\Authentication\User\ExternalBackend;
use Icinga\Common\Database; use Icinga\Common\Database;
use Icinga\Exception\Http\HttpBadRequestException; use Icinga\Exception\Http\HttpBadRequestException;
use Icinga\User; use Icinga\User;
use Icinga\Web\Dashboard\Dashboard;
use Icinga\Web\Form; use Icinga\Web\Form;
use Icinga\Web\RememberMe; use Icinga\Web\RememberMe;
use Icinga\Web\Url; use Icinga\Web\Url;
@ -28,7 +29,7 @@ class LoginForm extends Form
/** /**
* Redirect URL * Redirect URL
*/ */
const REDIRECT_URL = 'dashboard'; const REDIRECT_URL = Dashboard::BASE_ROUTE;
public static $defaultElementDecorators = [ public static $defaultElementDecorators = [
['ViewHelper', ['separator' => '']], ['ViewHelper', ['separator' => '']],

View File

@ -1,5 +1,6 @@
<?php <?php
use Icinga\Web\Dashboard\Dashboard;
use Icinga\Web\Url; use Icinga\Web\Url;
use Icinga\Web\Notification; use Icinga\Web\Notification;
use Icinga\Authentication\Auth; use Icinga\Authentication\Auth;
@ -36,7 +37,7 @@ if ($this->layout()->inlineLayout) {
<div id="header-logo-container"> <div id="header-logo-container">
<?= $this->qlink( <?= $this->qlink(
'', '',
Auth::getInstance()->isAuthenticated() ? 'dashboard' : '', Auth::getInstance()->isAuthenticated() ? Dashboard::BASE_ROUTE : '',
null, null,
array( array(
'aria-hidden' => 'true', 'aria-hidden' => 'true',

View File

@ -6,7 +6,7 @@ use Icinga\Web\Widget\SearchDashboard;
$searchDashboard = new SearchDashboard(); $searchDashboard = new SearchDashboard();
$searchDashboard->setUser($this->Auth()->getUser()); $searchDashboard->setUser($this->Auth()->getUser());
if ($searchDashboard->search('dummy')->getPane('search')->hasDashlets()): ?> if ($searchDashboard->search('dummy')->getActiveHome()->getPane('search')->hasDashlets()): ?>
<form action="<?= $this->href('search') ?>" method="get" role="search" class="search-control"> <form action="<?= $this->href('search') ?>" method="get" role="search" class="search-control">
<input type="text" name="q" id="search" class="search search-input" required <input type="text" name="q" id="search" class="search search-input" required
placeholder="<?= $this->translate('Search') ?> &hellip;" placeholder="<?= $this->translate('Search') ?> &hellip;"

View File

@ -6,6 +6,7 @@ namespace Icinga\Web;
use Icinga\Application\Logger; use Icinga\Application\Logger;
use Icinga\Authentication\Auth; use Icinga\Authentication\Auth;
use Icinga\Web\Navigation\Navigation; use Icinga\Web\Navigation\Navigation;
use Icinga\Web\Dashboard\Dashboard;
/** /**
* Main menu for Icinga Web 2 * Main menu for Icinga Web 2
@ -28,7 +29,7 @@ class Menu extends Navigation
{ {
$this->addItem('dashboard', [ $this->addItem('dashboard', [
'label' => t('Dashboard'), 'label' => t('Dashboard'),
'url' => 'dashboard', 'url' => Dashboard::BASE_ROUTE,
'icon' => 'dashboard', 'icon' => 'dashboard',
'priority' => 10 'priority' => 10
]); ]);