mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-25 18:59:04 +02:00
DashboardsController: Check whether the pane has been moved before redirecting
We only need to construct a proper redirection when the current pane has been moved to another home.
This commit is contained in:
parent
c147341648
commit
303084e34a
@ -194,17 +194,17 @@ class DashboardsController extends CompatController
|
||||
$this->httpNotFound(t('Pane "%s" not found'), $pane);
|
||||
}
|
||||
|
||||
$paneForm = (new PaneForm($this->dashboard))
|
||||
->on(PaneForm::ON_SUCCESS, function () {
|
||||
if ($this->prevActive) {
|
||||
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings'));
|
||||
} else {
|
||||
$this->getResponse()->setHeader('X-Icinga-Container', 'modal-content', true);
|
||||
$paneForm = new PaneForm($this->dashboard);
|
||||
$paneForm->on(PaneForm::ON_SUCCESS, function () use ($paneForm, $home) {
|
||||
if ($this->prevActive && $home !== $paneForm->getPopulatedValue('home')) {
|
||||
$params = $this->params->without('pane');
|
||||
$this->redirectNow(Url::fromPath(Dashboard::BASE_ROUTE . '/settings')->setParams($params));
|
||||
} else {
|
||||
$this->getResponse()->setHeader('X-Icinga-Container', 'modal-content', true);
|
||||
|
||||
$this->redirectNow('__CLOSE__');
|
||||
}
|
||||
})
|
||||
->handleRequest($this->getServerRequest());
|
||||
$this->redirectNow('__CLOSE__');
|
||||
}
|
||||
})->handleRequest($this->getServerRequest());
|
||||
|
||||
$paneForm->load($this->dashboard->getActiveHome()->getEntry($pane));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user