mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-30 01:04:09 +02:00
JS: Maintain auto-refresh interval over redirects
This is far from beautiful. But JS needs a revamp anyway. Request should be an object and should be passed from function to function in order to maintain state.
This commit is contained in:
parent
78c1e17c20
commit
41c942d197
@ -331,7 +331,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.redirectToUrl(redirect, req.$target, req.url, req.getResponseHeader('X-Icinga-Rerender-Layout'), req.forceFocus);
|
this.redirectToUrl(
|
||||||
|
redirect, req.$target, req.url, req.getResponseHeader('X-Icinga-Rerender-Layout'), req.forceFocus,
|
||||||
|
req.getResponseHeader('X-Icinga-Refresh')
|
||||||
|
);
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -343,7 +346,7 @@
|
|||||||
* @param {string} origin
|
* @param {string} origin
|
||||||
* @param {boolean} rerenderLayout
|
* @param {boolean} rerenderLayout
|
||||||
*/
|
*/
|
||||||
redirectToUrl: function (url, $target, origin, rerenderLayout, forceFocus) {
|
redirectToUrl: function (url, $target, origin, rerenderLayout, forceFocus, autoRefreshInterval) {
|
||||||
var icinga = this.icinga;
|
var icinga = this.icinga;
|
||||||
|
|
||||||
if (typeof rerenderLayout === 'undefined') {
|
if (typeof rerenderLayout === 'undefined') {
|
||||||
@ -394,6 +397,7 @@
|
|||||||
|
|
||||||
var req = this.loadUrl(url, $target);
|
var req = this.loadUrl(url, $target);
|
||||||
req.forceFocus = url === origin ? forceFocus : null;
|
req.forceFocus = url === origin ? forceFocus : null;
|
||||||
|
req.autoRefreshInterval = autoRefreshInterval;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -496,7 +500,7 @@
|
|||||||
this.icinga.ui.setTitle(decodeURIComponent(title));
|
this.icinga.ui.setTitle(decodeURIComponent(title));
|
||||||
}
|
}
|
||||||
|
|
||||||
var refresh = req.getResponseHeader('X-Icinga-Refresh');
|
var refresh = req.autoRefreshInterval || req.getResponseHeader('X-Icinga-Refresh');
|
||||||
if (refresh) {
|
if (refresh) {
|
||||||
req.$target.data('icingaRefresh', refresh);
|
req.$target.data('icingaRefresh', refresh);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user