icingaweb2-module-director/application/controllers/KickstartController.php

31 lines
808 B
PHP
Raw Permalink Normal View History

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