sosedoff / pgweb

Cross-platform client for PostgreSQL databases
https://sosedoff.github.io/pgweb
MIT License
8.47k stars 716 forks source link

Add support for a bookmarks-only mode #716

Closed agologan closed 4 months ago

agologan commented 4 months ago

This adds the ability to disable manually-entered connection details in favor of bookmarks. Feel free to recommend any changes that better align with project directions.

The use-case for this self-hosting and avoiding users to ever provide connection details. A connect backend is sortof similar, but bookmarks already go 90% of the way and come baked-in.

sosedoff commented 4 months ago

Thank you. I will have a look

sosedoff commented 4 months ago

When pgweb bookmarks dont exist i get this UI:

Screenshot 2024-03-11 at 10 15 13 PM

After clicking on the "Connect" button:

Screenshot 2024-03-11 at 10 15 22 PM

In this particular case i think its best if we can display a message like "No bookmarks available" and an explanation that Pgweb is running in bookmarks-only mode and connecting to custom databases is not allowed.

agologan commented 4 months ago

Hid the connect button and showed an error reading:

Running in bookmarks-only mode but NO bookmarks configured

Also added errors when attempting to start with URL or host + port or connect-backend set.