mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-24 02:17:40 +02:00
WelcomeForm: Don't raise sys errors directly but use notifications to notify the user
This commit is contained in:
parent
2105541493
commit
9f7eba4cf8
@ -26,13 +26,13 @@ class DashletForm extends SetupNewDashboardForm
|
||||
public function load(BaseDashboard $dashboard)
|
||||
{
|
||||
/** @var Dashlet $dashboard */
|
||||
$this->populate(array(
|
||||
$this->populate([
|
||||
'org_home' => $this->requestUrl->getParam('home'),
|
||||
'org_pane' => $dashboard->getPane()->getName(),
|
||||
'org_dashlet' => $dashboard->getName(),
|
||||
'dashlet' => $dashboard->getTitle(),
|
||||
'url' => $dashboard->getUrl()->getRelativeUrl()
|
||||
));
|
||||
]);
|
||||
}
|
||||
|
||||
protected function assembleNextPageDashboardPart()
|
||||
|
@ -4,10 +4,12 @@
|
||||
|
||||
namespace Icinga\Forms\Dashboard;
|
||||
|
||||
use Icinga\Application\Logger;
|
||||
use Icinga\Application\Modules;
|
||||
use Icinga\Web\Dashboard\Dashboard;
|
||||
use Icinga\Web\Dashboard\DashboardHome;
|
||||
use Icinga\Util\DBUtils;
|
||||
use Icinga\Web\Notification;
|
||||
use ipl\Html\Form;
|
||||
use ipl\Web\Url;
|
||||
|
||||
@ -64,8 +66,15 @@ class WelcomeForm extends Form
|
||||
$conn->commitTransaction();
|
||||
} catch (\Exception $err) {
|
||||
$conn->rollBackTransaction();
|
||||
throw $err;
|
||||
}
|
||||
|
||||
Logger::error('Unable to apply the system defaults into the DB. An error occurred: %s', $err);
|
||||
|
||||
Notification::error(t('Failed to successfully save the data. Please check the logs for details.'));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Notification::success(t('Imported system defaults successfully.'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user