mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-31 01:34:12 +02:00
IndexController: unify setup tabs/titles
This commit is contained in:
parent
1e8adb8586
commit
60f915a024
@ -20,7 +20,7 @@ class IndexController extends DashboardController
|
|||||||
|
|
||||||
if ($migrations->hasSchema()) {
|
if ($migrations->hasSchema()) {
|
||||||
if (!$this->hasDeploymentEndpoint()) {
|
if (!$this->hasDeploymentEndpoint()) {
|
||||||
$this->showKickstartForm(false);
|
$this->showKickstartForm();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,18 +38,27 @@ class IndexController extends DashboardController
|
|||||||
), $migrations->getLastMigrationNumber())));
|
), $migrations->getLastMigrationNumber())));
|
||||||
}
|
}
|
||||||
|
|
||||||
parent::indexAction();
|
if ($migrations->hasSchema()) {
|
||||||
|
parent::indexAction();
|
||||||
|
} else {
|
||||||
|
$this->addTitle(sprintf(
|
||||||
|
$this->translate('Icinga Director Setup: %s'),
|
||||||
|
$this->translate('Create Schema')
|
||||||
|
));
|
||||||
|
$this->addSingleTab('Setup');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
|
$this->addTitle(sprintf(
|
||||||
|
$this->translate('Icinga Director Setup: %s'),
|
||||||
|
$this->translate('Choose DB Resource')
|
||||||
|
));
|
||||||
|
$this->addSingleTab('Setup');
|
||||||
$this->showKickstartForm();
|
$this->showKickstartForm();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function showKickstartForm($showTab = true)
|
protected function showKickstartForm()
|
||||||
{
|
{
|
||||||
if ($showTab) {
|
|
||||||
$this->addSingleTab($this->translate('Kickstart'));
|
|
||||||
}
|
|
||||||
|
|
||||||
$form = KickstartForm::load();
|
$form = KickstartForm::load();
|
||||||
if ($name = $this->getPreferredDbResourceName()) {
|
if ($name = $this->getPreferredDbResourceName()) {
|
||||||
$form->setDbResourceName($name);
|
$form->setDbResourceName($name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user