mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[6.8] [ML] Fix to automatically apply refresh settings set in URL (#47052)
This commit is contained in:
parent
bde180ddb1
commit
93d974a222
1 changed files with 17 additions and 10 deletions
|
@ -20,6 +20,23 @@ export function refreshIntervalWatcher($timeout) {
|
|||
if (refresher) {
|
||||
$timeout.cancel(refresher);
|
||||
}
|
||||
checkForStartRefresh();
|
||||
};
|
||||
|
||||
function init(listenerCallback) {
|
||||
listener = listenerCallback;
|
||||
timefilter.on('refreshIntervalUpdate', onRefreshIntervalChange);
|
||||
|
||||
// Apply any refresh values set on initialization e.g. in the URL.
|
||||
checkForStartRefresh();
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
$timeout.cancel(refresher);
|
||||
timefilter.off('refreshIntervalUpdate', onRefreshIntervalChange);
|
||||
}
|
||||
|
||||
function checkForStartRefresh() {
|
||||
const interval = timefilter.getRefreshInterval();
|
||||
if (interval.value > 0 && !interval.pause) {
|
||||
function startRefresh() {
|
||||
|
@ -30,16 +47,6 @@ export function refreshIntervalWatcher($timeout) {
|
|||
}
|
||||
startRefresh();
|
||||
}
|
||||
};
|
||||
|
||||
function init(listenerCallback) {
|
||||
listener = listenerCallback;
|
||||
timefilter.on('refreshIntervalUpdate', onRefreshIntervalChange);
|
||||
}
|
||||
|
||||
function cancel() {
|
||||
$timeout.cancel(refresher);
|
||||
timefilter.off('refreshIntervalUpdate', onRefreshIntervalChange);
|
||||
}
|
||||
|
||||
return {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue