amir20 / dozzle

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

Embed Dozzle main panel into another application #2793

Closed clabnet closed 7 months ago

clabnet commented 7 months ago

First: Dozzle is a very fantastic application. Thank's to developer.

Then, it should possible to embed the main log panel into another web application ? It should useful hide the selector left panel in this case and force the view only to a single container.

Only iframe or there are any other chances ?

amir20 commented 7 months ago

First: Dozzle is a very fantastic application. Thank's to developer.

🎉

Then, it should possible to embed the main log panel into another web application ?

Is it not possible right now to iframe Dozzle? Someone else asked this question and I know it's possible. What functionality is missing to be able to iframe?

It should useful hide the selector left panel in this case and force the view only to a single container.

That's already possible with a button on the bottom left.

force the view only to a single container

Technically, this is possible because you can search by name and redirect.

Possible questions I would have:

  1. Dozzle uses container id to view logs. So it might not always make sense to show a single continaer.
  2. Should it auto hide the menu?
  3. Perhaps, you want to iframe for other users to not even be allowed to search other containers?
  4. Last, what is exactly your usecase? Is this an internal tool you are trying to iframe Dozzle?
clabnet commented 7 months ago

Yes, i would embed Dozzle into my web app Vue 3, and I interested only to see one container log's only.

image

Is there a mode to hide left bottom button ?

amir20 commented 7 months ago

Oh I see. So you are saying everything is working as expected but only want to hide the menu on the left permanently?

I'll have to see how is easy that is. Perhaps I can pass a flag like ?embedded=true

clabnet commented 7 months ago

Yes, all correct, This would be great.

amir20 commented 7 months ago

Try https://github.com/amir20/dozzle/pull/2796 with amir20/dozzle:pr-2796. You should be able to append ?hideMenu which would force hide the menu.

amir20 commented 7 months ago

I will add that if you want a secure option, this won't work. People can still jump in the javascript and look at other logs. But I think that's too hard to fix.

clabnet commented 7 months ago

@amir20 Sorry for delay. It is correct your assertion related security, fortunately users are not all geeks. Dozzle version v6.2.5 it seems the hideMenu is not working (or I missed any thing) http://localhost:9999/show?name=log-drawings-processor&hideMenu=true

amir20 commented 7 months ago

I haven't released a new build yet. Waiting for you to test it. amir20/dozzle:master should work.