Refresh container if X-Icinga-Extra-Updates with length 1 is defined (#3970)
* Refresh container if X-Icinga-Extra-Updates with length 1 is defined
This commit is contained in:
parent
d6677bfb66
commit
5edd267f2a
|
@ -840,18 +840,30 @@
|
||||||
if (!! extraUpdates && req.getResponseHeader('X-Icinga-Redirect-Http') !== 'yes') {
|
if (!! extraUpdates && req.getResponseHeader('X-Icinga-Redirect-Http') !== 'yes') {
|
||||||
$.each(extraUpdates.split(','), function (idx, el) {
|
$.each(extraUpdates.split(','), function (idx, el) {
|
||||||
var parts = el.trim().split(';');
|
var parts = el.trim().split(';');
|
||||||
if (parts.length !== 2) {
|
var $target;
|
||||||
|
var url;
|
||||||
|
if (parts.length === 2) {
|
||||||
|
$target = $('#' + parts[0]);
|
||||||
|
if (! $target.length) {
|
||||||
|
_this.icinga.logger.warn('Invalid target ID. Cannot load extra URL', el);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
url = parts[1];
|
||||||
|
} else if (parts.length === 1) {
|
||||||
|
$target = $(parts[0]).closest(".container").not(req.$target);
|
||||||
|
if (! $target.length) {
|
||||||
|
_this.icinga.logger.warn('Invalid target ID. Cannot load extra URL', el);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
url = $target.data('icingaUrl');
|
||||||
|
} else {
|
||||||
_this.icinga.logger.error('Invalid extra update', el);
|
_this.icinga.logger.error('Invalid extra update', el);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var $target = $('#' + parts[0]);
|
_this.loadUrl(url, $target).addToHistory = false;
|
||||||
if (! $target.length) {
|
|
||||||
_this.icinga.logger.warn('Invalid target ID. Cannot load extra URL', el);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_this.loadUrl(parts[1], $target).addToHistory = false;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue