From bac1bb2b5eb3c8df96ee5274ce169430cc6a7c32 Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 4 Jun 2025 18:14:00 +0200 Subject: [PATCH] Add file rename functionality and improve preview handling - Implement file/folder rename feature with dialog and API endpoint - Add rename button to file browser with keyboard shortcuts - Switch PDF preview from object to embed tag for better compatibility - Fix CORS issues by fetching preview files as blobs with object URLs - Add proper cleanup for object URLs to prevent memory leaks - Add renameObject utility function for MinIO operations --- components/FilePreviewModal.vue | 60 +++++++++++++----- pages/dashboard/file-browser.vue | 101 +++++++++++++++++++++++++++++++ server/api/files/rename.ts | 93 ++++++++++++++++++++++++++++ server/utils/minio.ts | 79 +++++++++++++++++++++++- 4 files changed, 317 insertions(+), 16 deletions(-) create mode 100644 server/api/files/rename.ts diff --git a/components/FilePreviewModal.vue b/components/FilePreviewModal.vue index 834b0b8..269579f 100644 --- a/components/FilePreviewModal.vue +++ b/components/FilePreviewModal.vue @@ -50,16 +50,12 @@
- -

PDF preview is not available. Click here to view the PDF.

-
+ />
@@ -86,7 +82,7 @@