amir20 / dozzle

Realtime log viewer for docker containers.
https://dozzle.dev/
MIT License
5.02k stars 266 forks source link

Add option to instantly go to new container? #3036

Open YouveGotMeowxy opened 1 month ago

YouveGotMeowxy commented 1 month ago

I have the 'auto-redirect to new container w/matching name' option checked (works about half the time), and I'd also love to have it do so immediately w/out the delay it currently has. (the dialog showing there's a matching container, with the progress bar on the button).

When working on building images, and doing tweak after tweak with a million restarts, the delay slows the flow. :)

amir20 commented 1 month ago

Maybe the options should be instant, delayed, never.

works about half the time

I have seen this happen too. But I am not sure why. The redirect happens in javascript so the tab needs to be active. Can you help out and figure out when it doesn't work? The code is pretty simple.

https://github.com/amir20/dozzle/blob/513e51134b9e951191e15266229339561736addd/assets/components/LogViewer/ContainerEventLogItem.vue#L47-L58

It also only works with containers not swarm. I don't use this often so if you use it a lot then help make it better. ❤️

YouveGotMeowxy commented 4 weeks ago

Maybe the options should be instant, delayed, never.

Perfect :)

works about half the time

Maybe that's what it is. I'll have to pay closer attention, since I do a ton of tab switching. Maybe the js can keep checking if the tab is active and only do the switch when it is. That way even if tab isn't active during the container shutdown/restart it'll still switch once the js detects the tab is active no matter how much time elapses? I don't really know much js so I'm just thinking outloud.