简体   繁体   中英

How to quickly navigate from to the "next page" when using numbered items (ie Jenkins logs)

I often view the log of a Jenkins run. The jobs are sequentially numbered and URLs look like http://{myJenkins-Instance}/job/{jobName}/{Number}/console

After looking at the result of one job, I'd like to easily see the next one (aka "increment the counter"). And after editing a URL for the 100th time I thought it would be nice if this could be automated.

Did not find browser plugins to do this - so I rolled my own. Well, it's not a plugin - it's a simple URL that you can add to your bookmarks (list or bar). I've put it into the bar, so it's always visible and allows me to easily switch one "page" forward:

javascript: t= window.location.href;console.log(t);n=t.replace(/\/(\d+)+(?:\/|$)/g, function(match, number) {return '/' + (parseInt(number)+1) + '/';});window.location.href=n;

I found it very useful, so I'm sharing it here - hopefully it'll help someone else;)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM