File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 11// ==UserScript==
22// @name Auto-Tail CodePipeline Logs
33// @namespace http://softwareengineerprogrammer.github.io
4- // @version 0.1
4+ // @version 0.2
55// @description un-papercut tail logs
66// @author softwareengineerprogrammer
77// @match https://*.console.aws.amazon.com/codesuite/codepipeline/pipelines/*/debug*
1313( function ( ) {
1414 'use strict' ;
1515
16- let maxTries = 10 ;
16+ function isHidden ( el ) {
17+ return el && ( el . offsetParent === null ) ;
18+ }
19+
20+ const maxTries = 50 ;
1721 let loop = function ( tries ) {
1822 let elt = document . querySelector ( '.dx-LogTab__header > awsui-button:nth-child(2) > button:nth-child(1) > span:nth-child(1)' ) ;
1923 if ( elt ) {
2226 setTimeout ( function ( ) {
2327 elt . click ( ) ;
2428 console . debug ( 'Clicked Tail Logs button.' ) ;
29+
30+ setTimeout ( function ( ) {
31+ if ( isHidden ( document . querySelector ( 'div.dx-StatusIndicator:nth-child(1)' ) ) ) {
32+ console . debug ( 'Tail Logs pane not showing, resuming search-n-click...' ) ;
33+ loop ( tries ) ;
34+ }
35+ } , 1000 ) ;
36+
2537 } , 1000 ) ;
2638 } else if ( tries < maxTries ) {
2739 console . debug ( 'Didn\'t find Tail Logs button, will try again...' ) ;
You can’t perform that action at this time.
0 commit comments