Don't ignore url params of the DM view when requesting Drag&Drop actions

This commit is contained in:
Yonas Habteab 2022-06-08 11:32:13 +02:00
parent 54c3b9e2c6
commit 4fc410c6e9
2 changed files with 14 additions and 1 deletions

View File

@ -272,7 +272,13 @@ class DashboardsController extends CompatController
$originals = $dashboards['originals'];
unset($dashboards['originals']);
$this->dashboard->load();
$highlightHome = $this->params->get('home');
$highlightPane = $this->params->get('pane');
if (! $highlightHome) {
$highlightHome = DashboardHome::DEFAULT_HOME;
}
$this->dashboard->load($highlightHome, $highlightPane, true);
$orgHome = null;
$orgPane = null;
@ -312,6 +318,8 @@ class DashboardsController extends CompatController
$pane = $home->hasEntry($pane) ? $home->getEntry($pane) : $orgHome->getEntry($pane);
/** @var Pane $pane */
$pane->loadDashboardEntries();
if (! is_array($indexOrValues)) {
if ($orgHome && $orgHome->hasEntry($pane->getName()) && $home->hasEntry($pane->getName())) {
Notification::error(sprintf(

View File

@ -122,6 +122,11 @@
data = { dashboardData : JSON.stringify(data) };
let url = _this.icinga.config.baseUrl + '/dashboards/reorder-widgets';
let urlParams = window.location.search;
if (!! urlParams) {
url += urlParams;
}
let req = _this.icinga.loader.loadUrl(url, $('#col1'), data, 'post');
req.addToHistory = false;