amir20 / dozzle

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

Swarm mode switch when viewing on mobile device #3126

Closed drmrbrewer closed 1 month ago

drmrbrewer commented 1 month ago

Describe the feature you would like to see

When opening dozzle in a desktop browser, I see a "swarm mode" switch... having this enabled is my preferred choice:

image

But opening dozzle in a mobile browser (Safari on iOS and Chrome on Android) there is no "swarm mode" switch, nor does it appear in any of the menus.

Looks like there is DOZZLE_MODE=swarm env var, which is documented here but not on the main page, but if I try that I just get:

2024-07-20T11:16:23.988013886Z time="2024-07-20T11:16:23Z" level=info msg="Dozzle version v8.0.5"
2024-07-20T11:16:24.016873133Z time="2024-07-20T11:16:24Z" level=info msg="Starting in Swarm mode"
2024-07-20T11:16:24.017968777Z time="2024-07-20T11:16:24Z" level=info msg="gRPC server listening on [::]:7007"
2024-07-20T11:16:24.017997097Z time="2024-07-20T11:16:24Z" level=info msg="Accepting connections on :8080"
2024-07-20T11:16:24.018548098Z time="2024-07-20T11:16:24Z" level=fatal msg="error looking up swarm services: lookup tasks.dozzle on 127.0.0.11:53: no such host"

I'm not that fussed about having it start in swarm mode, but it would be nice at least to be able to switch to swarm mode even on a mobile device.

amir20 commented 1 month ago

I think you are misunderstanding some things here.

But opening dozzle in a mobile browser

I haven't implemented Dozzle swarm UI in mobile yet. If someone wnats to help that would be great but it's a lot of work and I have a few other things I want to do instead in Dozzle.

Looks like there is DOZZLE_MODE=swarm env var

Swarm mode uses Docker Swarm to create a cluster in Swarm and connect all instances together. It has nothing to do with the UI. It has nothing to do with the Swarm UI toggle. Swarm UI only groups the containers together. Currently, it is only sticky in a session. But once the browser closes it is reset.

but it would be nice at least to be able to switch to swarm mode even on a mobile device

It sounds like you just Swarm UI in mobile. I don't have a lot of mobile users so I haven't really prioritized it. If more people ask for it then I think I could try some things but not many people have asked for this feature yet.

drmrbrewer commented 1 month ago

OK well the page already works pretty well on a mobile browser so I assumed that it was already built with a responsive framework of some kind to make it adapt to different screen sizes... and that the switch component had just bee overlooked. If it's a lot of bother to show the switch, then forget about it.

amir20 commented 1 month ago

It's not the switch that's a lot of work. It's the implementation as the menu on mobile is completely different than the menu on desktop. I was hoping to make it one layout and change it with CSS but I wasn't able so the menus are different implementation. 😅

I can come back to this if I have some time in the future.

drmrbrewer commented 1 month ago

So I guess you can tell from the analytics that there aren't many mobile users? For me I'm most likely to want to use dozzle on a mobile device. This is because when I have access to a desktop browser, I also have access to my full IDE, so I can view all of my logs (and more) via the IDE... I see little use for dozzle in this context. It's when I'm away from the desk that I really need dozzle, because it's almost impossible to do anything via the IDE on a tiny screen.

amir20 commented 1 month ago

Yup. I have analytics which is just a best guess.

Screenshot 2024-07-21 at 7 40 05 AM

Mobile is probably a tiny fraction as most users have Dozzle installed in their dev or production env.

I am still not against improving Dozzle on mobile. I just don't have a lot of time. Maybe you can help if you know how. Currently, I am focused more on making agents better as it is a new feature that requires improvement. Performance is also a big concern because I am seeing people with 1000s of containers.

amir20 commented 1 month ago

Found a pretty nifty solution to reuse the same code for mobile menu. See https://github.com/amir20/dozzle/pull/3153

drmrbrewer commented 1 month ago

@amir20 works nicely... thanks!