Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web gui #215

Open
gedw99 opened this issue Jan 30, 2023 · 16 comments
Open

Web gui #215

gedw99 opened this issue Jan 30, 2023 · 16 comments
Labels
enhancement New feature or request

Comments

@gedw99
Copy link

gedw99 commented Jan 30, 2023

Maybe the most ironic thing but a basic web gui.

what ya think ?

soft serve is mega cool and really extendable and so many git servers are crazy complex. Gitea etc etc .

so a htmx based web gui with pure golang might be a nice thing for others ?

@cjkvdev
Copy link

cjkvdev commented Mar 16, 2023

I second this, somehow lol

@gedw99
Copy link
Author

gedw99 commented Mar 16, 2023

there is a really nice one here i use.

https://github.com/icyphox/legit

It does not need git even :)

If anyone wants to work on it with me just shout...

@aymanbagabas aymanbagabas added the enhancement New feature or request label Apr 5, 2023
@gedw99
Copy link
Author

gedw99 commented Apr 19, 2023

Hey @aymanbagabas

If you want help on this just shout.

@ellieschieder
Copy link

Im willing to give it a try this week.

Maybe I can send a PR, maybe only a half one.

@gedw99
Copy link
Author

gedw99 commented Aug 7, 2023

I have now started to Use htmx for the GUI.

It allows progressive updates and is easy to develop on..

I based it on https://github.com/stackus/todos-htmx-wasm

The web gui is plan Go templates with sprinkles of htmx tags.

So the gui is updated from the server . Small parts of the gui update without a full page load.

You can also run the exact same go html templates as wasm service worker. You’re just moving the rendering server to the browsers Service worker.

so on first request the golang Server fully renders the page, whilst the Browser service worker is asynchronously loading that golang rendering Server into the browser.

Once the golang rendering server is inside your service worker ans WASM all browser html requests hit that.

Now that WASM is doing IO with the Golang Git server for only JSON using SSE and HTTP.

Soft Serve does not raise an event when a file changes and so SSE is not possible yet ..

The s

@nirui
Copy link

nirui commented Dec 9, 2023

Not sure if someone else is already working on this. If not, then I might be able to give it a try (but it might take awhile).

I'm still exploring the code, but I'm very sure at least you can have a home page (see screenshot) :D

截图 2023-12-09 12-54-09

The problem with third-party web UI is that they don't handle permissions, because the permission data is handled inside Soft Serve and not exposed. So the only way to do it is build it in.

@nirui
Copy link

nirui commented Dec 9, 2023

Well, before I dig myself any deeper, maybe it's a good time to ask the project members if the effort has already been commenced by someone.

So... @aymanbagabas, you've mentioned in #241 that a Web UI was planed. Is the work already started?

I mean, someone who knows the ins and outs is more likely to have better idea on how things should be done than me poking around :)

On the other hand, if there is no effort yet... well, I'm exploring the code just a little, not sure if I can succeed in the end though.

截图 2023-12-09 21-00-19

@gedw99
Copy link
Author

gedw99 commented Dec 20, 2023

This is awesome @nirui

I will be happy to help out . Let me know where your fork is etc

@nirui
Copy link

nirui commented Dec 21, 2023

My intention is to add the feature to the official version, so I want to hear the opinion and concerns from the project members before greenlighting myself to do anything further.

My plan is to implement few very minimal, and read-only web pages to allow visitors to browse basic information about the repositories. Just couple of template and CSS files, maybe not even include JavaScript (So no CodeMirror or Markdown parsing etc, just good old pre tag).

I might also make it so the end-user can customize the interface via their own template and CSS files. So if they don't like what I did, they can make it all fancy by themselves.

But before all that, we need to hear what the project members have to say about it.

@gedw99
Copy link
Author

gedw99 commented Jan 17, 2024

hey @nirui

Is there code to look at ?

My intention is to add the feature to the official version, so I want to hear the opinion and concerns from the project members before greenlighting myself to do anything further.

My plan is to implement few very minimal, and read-only web pages to allow visitors to browse basic information about the repositories. Just couple of template and CSS files, maybe not even include JavaScript (So no CodeMirror or Markdown parsing etc, just good old pre tag).

good. kiss...

I might also make it so the end-user can customize the interface via their own template and CSS files. So if they don't like what I did, they can make it all fancy by themselves.

agree +1

But before all that, we need to hear what the project members have to say about it.

@aymanbagabas ??

Raw http access is in the works : #456

@nirui
Copy link

nirui commented Jan 18, 2024

Hi @gedw99, I've stopped working on this after my last comment up there. If you'd like to take a look, here are the changes I made:

0001-webui-add-initial-files-to-explorer-the-possibility.patch.txt

Hope it will be useful to you if you're trying to implement similar feature ;)

@gedw99
Copy link
Author

gedw99 commented Jan 18, 2024

thanks @nirui

Patch looks pretty good with no exotic dependencies ...

I wil take a look later and see if I can PR it in.

OH and also what @aymanbagabas thinks of it.

@nirui
Copy link

nirui commented Jan 19, 2024

Hi @gedw99. My patch introduced no new dependency. I thought extra dependency might complicate the code review process.

However, please note that some part of the code might not be considered as up-to-spec for merging.

For starter, the templateCommonDataCtxKey type is not properly defined (it should be a struct type instead of a bare string type).

Another thing is the render function. The logic should be "By default return a HTML format, unless the user is requesting for nothing else but application/json" (Yes, I planed to support returning pure JSON data to enable better integration with other systems).

But... while waiting for the respond, I got involved in something else, which took all my free time away... So yeah, I'm no longer have time for this :( Anyway, that's your code now, have fun with it :)

@gedw99
Copy link
Author

gedw99 commented Jan 19, 2024

thanks @nirui

yep I know how it is when you get dragged onto paying work etc.

I will play with it and extend it based on your tips.

@ThaDaVos
Copy link

ThaDaVos commented Nov 9, 2024

Curious, are there any updates?

@gedw99
Copy link
Author

gedw99 commented Nov 10, 2024

I have not touched it at all .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants