diff --git a/awx/ui/client/features/output/constants.js b/awx/ui/client/features/output/constants.js index 4bab4ca1bb..5d3b29aab8 100644 --- a/awx/ui/client/features/output/constants.js +++ b/awx/ui/client/features/output/constants.js @@ -15,6 +15,7 @@ export const JOB_STATUS_FINISHED = JOB_STATUS_COMPLETE.concat(JOB_STATUS_INCOMPL export const OUTPUT_ELEMENT_CONTAINER = '.at-Stdout-container'; export const OUTPUT_ELEMENT_TBODY = '#atStdoutResultTable'; +export const OUTPUT_ELEMENT_LAST = '#atStdoutMenuLast'; export const OUTPUT_MAX_LAG = 120; export const OUTPUT_ORDER_BY = 'counter'; export const OUTPUT_PAGE_CACHE = true; diff --git a/awx/ui/client/features/output/index.controller.js b/awx/ui/client/features/output/index.controller.js index 88d86ca91b..2be373476e 100644 --- a/awx/ui/client/features/output/index.controller.js +++ b/awx/ui/client/features/output/index.controller.js @@ -2,6 +2,7 @@ import { EVENT_START_PLAY, EVENT_START_TASK, + OUTPUT_ELEMENT_LAST, OUTPUT_PAGE_SIZE, } from './constants'; @@ -234,6 +235,9 @@ function stopFollowing () { return; } + scroll.unlock(); + scroll.unhide(); + vm.isFollowing = false; vm.followTooltip = vm.strings.get('tooltips.MENU_LAST'); } @@ -482,10 +486,31 @@ function OutputIndexController ( }, }); + let showFollowTip = true; + const rates = []; stream.init({ bufferAdd, bufferEmpty, onFrames, + onFrameRate (rate) { + rates.push(rate); + rates.splice(0, rates.length - 5); + + if (rates.every(value => value === 1)) { + scroll.unlock(); + scroll.unhide(); + } + + if (rate > 1 && vm.isFollowing) { + scroll.lock(); + scroll.hide(); + + if (showFollowTip) { + showFollowTip = false; + $(OUTPUT_ELEMENT_LAST).trigger('mouseenter'); + } + } + }, onStop () { lockFollow = true; stopFollowing(); @@ -493,7 +518,8 @@ function OutputIndexController ( status.updateStats(); status.dispatch(); status.sync(); - scroll.stop(); + scroll.unlock(); + scroll.unhide(); } }); @@ -533,3 +559,4 @@ OutputIndexController.$inject = [ ]; module.exports = OutputIndexController; + diff --git a/awx/ui/client/features/output/index.view.html b/awx/ui/client/features/output/index.view.html index 08df5f714a..738b7a0ae5 100644 --- a/awx/ui/client/features/output/index.view.html +++ b/awx/ui/client/features/output/index.view.html @@ -28,6 +28,7 @@