Fix: Scheme and hostname prepended to col2 url in the address bar (#4777)
This commit is contained in:
parent
2a80e8bca6
commit
707775fe26
|
@ -806,9 +806,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
var autoSubmit = false;
|
var autoSubmit = false;
|
||||||
|
var currentUrl = this.icinga.utils.parseUrl(req.$target.data('icingaUrl'));
|
||||||
if (referrer.method === 'POST') {
|
if (referrer.method === 'POST') {
|
||||||
var newUrl = this.icinga.utils.parseUrl(req.url);
|
var newUrl = this.icinga.utils.parseUrl(req.url);
|
||||||
var currentUrl = this.icinga.utils.parseUrl(req.$target.data('icingaUrl'));
|
|
||||||
if (newUrl.path === currentUrl.path && this.icinga.utils.arraysEqual(newUrl.params, currentUrl.params)) {
|
if (newUrl.path === currentUrl.path && this.icinga.utils.arraysEqual(newUrl.params, currentUrl.params)) {
|
||||||
autoSubmit = true;
|
autoSubmit = true;
|
||||||
}
|
}
|
||||||
|
@ -828,9 +828,7 @@
|
||||||
if (!! contentSeparator) {
|
if (!! contentSeparator) {
|
||||||
var locationQuery = req.getResponseHeader('X-Icinga-Location-Query');
|
var locationQuery = req.getResponseHeader('X-Icinga-Location-Query');
|
||||||
if (locationQuery !== null) {
|
if (locationQuery !== null) {
|
||||||
var a = this.icinga.utils.getUrlHelper().cloneNode(true);
|
let url = currentUrl.path + (locationQuery ? '?' + locationQuery : '');
|
||||||
a.search = locationQuery ? '?' + locationQuery : '';
|
|
||||||
|
|
||||||
if (req.autosubmit || autoSubmit) {
|
if (req.autosubmit || autoSubmit) {
|
||||||
// Also update a form's action if it doesn't differ from the container's url
|
// Also update a form's action if it doesn't differ from the container's url
|
||||||
var $form = $(referrer.forceFocus).closest('form');
|
var $form = $(referrer.forceFocus).closest('form');
|
||||||
|
@ -840,12 +838,12 @@
|
||||||
if (formAction.path === currentUrl.path
|
if (formAction.path === currentUrl.path
|
||||||
&& this.icinga.utils.arraysEqual(formAction.params, currentUrl.params)
|
&& this.icinga.utils.arraysEqual(formAction.params, currentUrl.params)
|
||||||
) {
|
) {
|
||||||
$form.attr('action', a.href);
|
$form.attr('action', url);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
req.$target.data('icingaUrl', a.href);
|
req.$target.data('icingaUrl', url);
|
||||||
this.icinga.history.replaceCurrentState();
|
this.icinga.history.replaceCurrentState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue