Let the canvas panels choose from files already uploaded
The Background panel, the Box editor and the canvas admin bar could only take a new upload, so reusing a picture meant uploading it again or pasting its URL. Each now has a picker (UploadPicker.vue): a grid of the public uploads, newest first, filterable by name. It lists through a new admin-only GET /api/uploads (Uploads.List), the union of the Garage bucket and the disk fallback, since nginx serves from both; a bucket that can't list falls back to the disk's files. Admin-only because upload URLs are public but unguessable, and a public listing would give every one away. Private files and anything off the UploadTypes allow-list are never listed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -190,6 +190,7 @@ func main() {
|
||||
// the handler checks the cookies itself to decide admin privileges.
|
||||
r.GET("/ws", store.ConnectWebSocket)
|
||||
protected.POST("/uploads", store.Upload)
|
||||
admin.GET("/uploads", store.ListUploads)
|
||||
|
||||
// NOTES
|
||||
admin.GET("/notes/*path", store.GetNoteFile)
|
||||
|
||||
Reference in New Issue
Block a user