From 0b94489c7e3b00c6ce013f83e16a66fcf388fb58 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Thu, 15 Oct 2020 09:50:47 +0200 Subject: [PATCH] loader.js: Introduce new header `X-Icinga-Location-Query` This header is only used in case the response includes multipart content. It's meant to provide a new query string that replaces the one of the targeted container and the resulting change also replaces the current history entry. --- public/js/icinga/loader.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/public/js/icinga/loader.js b/public/js/icinga/loader.js index 62de425c8..8e8661e6a 100644 --- a/public/js/icinga/loader.js +++ b/public/js/icinga/loader.js @@ -762,6 +762,14 @@ var contentSeparator = req.getResponseHeader('X-Icinga-Multipart-Content'); if (!! contentSeparator) { + var locationQuery = req.getResponseHeader('X-Icinga-Location-Query'); + if (locationQuery !== null) { + var a = this.icinga.utils.getUrlHelper(); + a.search = locationQuery ? '?' + locationQuery : ''; + req.$target.data('icingaUrl', a.href); + this.icinga.history.replaceCurrentState(); + } + $.each(req.responseText.split(contentSeparator), function (idx, el) { var match = el.match(/for=(\S+)\s+(.*)/ms); if (!! match) {