datasette / datasette-write-ui

A Datasette plugin that adds UI elements to edit, insert, or delete rows in SQLite tables
Apache License 2.0
16 stars 3 forks source link

URLs don't respect base_path #14

Closed meowcat closed 1 year ago

meowcat commented 1 year ago

Running datasette with --setting base_url /my-instance/, the "insert row" button doesn't work and the GET requests for JS, CSS go to

https://my-server/-/static-plugins/datasette_write_ui/table.min.js instead of https://my-server/my-instance/-/static-plugins/datasette_write_ui/table.min.js

meowcat commented 1 year ago

I have proposed a fix in PR #15. To pass the correct base url to the JS, I added this: https://github.com/datasette/datasette-write-ui/blob/f9c38a3ea23c14415fa0a83ca242465b2528ac55/datasette_write_ui/__init__.py#L22-L25 which is then called in the JS code where needed. Now I don't know if this is a great way to do it, you probably know better :)

simonw commented 1 year ago

This should be fixed now, and the fix is released in 0.0.1a8 - re-open this issue if it doesn't work for you!