loader.js: Allow to initiate a refresh with `__REFRESH__`

This commit is contained in:
Johannes Meyer 2023-09-06 14:56:02 +02:00
parent cdfe7e9aba
commit a3c04f9108
1 changed files with 9 additions and 0 deletions

View File

@ -597,6 +597,15 @@
$redirectTarget = $('#col1');
redirect = icinga.history.getCol1State();
} else if (redirect.match(/__REFRESH__/)) {
if (req.$redirectTarget.is('#col1')) {
redirect = icinga.history.getCol1State();
} else if (req.$redirectTarget.is('#col2')) {
redirect = icinga.history.getCol2State().replace(/^#!/, '');
} else {
icinga.logger.error('Unable to refresh. Not a primary column: ', req.$redirectTarget);
return false;
}
}
var useHttp = req.getResponseHeader('X-Icinga-Redirect-Http');