2016-10-31 04:34:26 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Icinga\Module\Director\Controllers;
|
|
|
|
|
|
|
|
|
|
use Exception;
|
2017-07-13 01:23:20 -04:00
|
|
|
use Icinga\Module\Director\Forms\KickstartForm;
|
2021-10-05 16:39:55 -04:00
|
|
|
use Icinga\Module\Director\Web\Controller\BranchHelper;
|
2016-10-31 04:34:26 -04:00
|
|
|
|
|
|
|
|
class KickstartController extends DashboardController
|
|
|
|
|
{
|
2021-10-05 16:39:55 -04:00
|
|
|
use BranchHelper;
|
|
|
|
|
|
2016-10-31 04:34:26 -04:00
|
|
|
public function indexAction()
|
|
|
|
|
{
|
2017-07-13 09:22:14 -04:00
|
|
|
$this->addSingleTab($this->translate('Kickstart'))
|
|
|
|
|
->addTitle($this->translate('Director Kickstart Wizard'));
|
2021-10-05 16:39:55 -04:00
|
|
|
if ($this->showNotInBranch($this->translate('Kickstart'))) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2017-07-13 01:23:20 -04:00
|
|
|
$form = KickstartForm::load();
|
2017-01-16 05:01:17 -05:00
|
|
|
try {
|
|
|
|
|
$form->setEndpoint($this->db()->getDeploymentEndpoint());
|
|
|
|
|
} catch (Exception $e) {
|
|
|
|
|
// Silently ignore DB errors
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$form->handleRequest();
|
2017-07-13 01:23:20 -04:00
|
|
|
$this->content()->add($form);
|
2016-10-31 04:34:26 -04:00
|
|
|
}
|
|
|
|
|
}
|