mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
IndexController: slight fixes, work with new tabs
This commit is contained in:
parent
4590fa1d73
commit
02c015d163
@ -7,18 +7,16 @@ use Icinga\Module\Director\Db\Migrations;
|
|||||||
|
|
||||||
class IndexController extends DashboardController
|
class IndexController extends DashboardController
|
||||||
{
|
{
|
||||||
|
protected $hasDeploymentEndpoint;
|
||||||
|
|
||||||
public function indexAction()
|
public function indexAction()
|
||||||
{
|
{
|
||||||
$this->view->dashboards = array();
|
|
||||||
|
|
||||||
$this->setViewScript('dashboard/index');
|
|
||||||
|
|
||||||
if ($this->Config()->get('db', 'resource')) {
|
if ($this->Config()->get('db', 'resource')) {
|
||||||
$migrations = new Migrations($this->db());
|
$migrations = new Migrations($this->db());
|
||||||
|
|
||||||
if ($migrations->hasSchema()) {
|
if ($migrations->hasSchema()) {
|
||||||
if (!$this->hasDeploymentEndpoint()) {
|
if (!$this->hasDeploymentEndpoint()) {
|
||||||
$this->showKickstartForm();
|
$this->showKickstartForm(false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$this->showKickstartForm();
|
$this->showKickstartForm();
|
||||||
@ -26,10 +24,11 @@ class IndexController extends DashboardController
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($migrations->hasPendingMigrations()) {
|
if ($migrations->hasPendingMigrations()) {
|
||||||
$this->view->form = $this
|
$this->content()->prepend($this
|
||||||
->loadForm('applyMigrations')
|
->loadForm('applyMigrations')
|
||||||
->setMigrations($migrations)
|
->setMigrations($migrations)
|
||||||
->handleRequest();
|
->handleRequest()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::indexAction();
|
parent::indexAction();
|
||||||
@ -38,20 +37,25 @@ class IndexController extends DashboardController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function showKickstartForm()
|
protected function showKickstartForm($showTab = true)
|
||||||
{
|
{
|
||||||
$this->singleTab($this->translate('Kickstart'));
|
if ($showTab) {
|
||||||
$this->view->form = $this->loadForm('kickstart')->handleRequest();
|
$this->addSingleTab($this->translate('Kickstart'));
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->content()->prepend(
|
||||||
|
$this->loadForm('kickstart')->handleRequest()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function hasDeploymentEndpoint()
|
protected function hasDeploymentEndpoint()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$this->view->hasDeploymentEndpoint = $this->db()->hasDeploymentEndpoint();
|
$this->hasDeploymentEndpoint = $this->db()->hasDeploymentEndpoint();
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->view->hasDeploymentEndpoint;
|
return $this->hasDeploymentEndpoint;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user