From 8677325510142793de31938b55396ad3426cdc6b Mon Sep 17 00:00:00 2001 From: Gabriel Massadas Date: Sun, 1 Dec 2024 19:20:42 +0000 Subject: [PATCH 1/2] Add http and custom metadata edit --- packages/dashboard/src/appUtils.js | 5 +- .../src/components/files/FileOptions.vue | 86 +++++++++++++++++++ .../src/components/main/LeftSidebar.vue | 17 ++-- .../src/pages/files/FileContextMenu.vue | 6 ++ .../src/pages/files/FilesFolderPage.vue | 4 +- packages/worker/package.json | 2 +- .../worker/src/modules/buckets/putMetadata.ts | 2 + 7 files changed, 112 insertions(+), 10 deletions(-) diff --git a/packages/dashboard/src/appUtils.js b/packages/dashboard/src/appUtils.js index c692378..bb30241 100644 --- a/packages/dashboard/src/appUtils.js +++ b/packages/dashboard/src/appUtils.js @@ -133,14 +133,15 @@ export const apiHandler = { newKey: encode(newKey), }); }, - updateMetadata: async (bucket, key, metadata) => { + updateMetadata: async (bucket, key, customMetadata, httpMetadata = {}) => { let prefix = ""; if (key.includes("/")) { prefix = key.replace(key.split("/").pop(), ""); } const resp = await api.post(`/buckets/${bucket}/${encode(key)}`, { - customMetadata: metadata, + customMetadata: customMetadata, + httpMetadata: httpMetadata, }); if (resp.status === 200) { diff --git a/packages/dashboard/src/components/files/FileOptions.vue b/packages/dashboard/src/components/files/FileOptions.vue index dacb3fe..b3fae7a 100644 --- a/packages/dashboard/src/components/files/FileOptions.vue +++ b/packages/dashboard/src/components/files/FileOptions.vue @@ -30,6 +30,44 @@ + + + + +
HTTP Metadata
+
+
+ +
+
+ +
+
+ +
+
+ +
Custom Metadata
+
+
+ +
+
+ +
+
+ +
+
+ +
+ + + + + +
+
diff --git a/packages/dashboard/quasar.config.js b/packages/dashboard/quasar.config.js index 6cc3194..e302494 100644 --- a/packages/dashboard/quasar.config.js +++ b/packages/dashboard/quasar.config.js @@ -21,7 +21,7 @@ module.exports = configure((/* ctx */) => ({ // }, // https://v2.quasar.dev/quasar-cli-vite/prefetch-feature - // preFetch: true, + preFetch: true, // app boot file (/src/boot) // --> boot files are part of "main.js" diff --git a/packages/dashboard/src/router/routes.js b/packages/dashboard/src/router/routes.js index f3ad4a3..30919e7 100644 --- a/packages/dashboard/src/router/routes.js +++ b/packages/dashboard/src/router/routes.js @@ -1,3 +1,8 @@ +import MainLayout from "layouts/MainLayout.vue"; +import HomePage from "pages/HomePage.vue"; +import EmailFolderPage from "pages/email/EmailFolderPage.vue"; +import FilesFolderPage from "pages/files/FilesFolderPage.vue"; + const routes = [ { path: "/auth", @@ -12,38 +17,38 @@ const routes = [ }, { path: "/", - component: () => import("layouts/MainLayout.vue"), + component: MainLayout, children: [ { path: "/", name: "home", - component: () => import("pages/HomePage.vue"), + component: HomePage, }, { path: "/:bucket/files", name: "files-home", - component: () => import("pages/files/FilesFolderPage.vue"), + component: FilesFolderPage, }, { path: "/:bucket/files/:folder", name: "files-folder", - component: () => import("pages/files/FilesFolderPage.vue"), + component: FilesFolderPage, }, { path: "/:bucket/files/:folder/:file", name: "files-file", - component: () => import("pages/files/FilesFolderPage.vue"), + component: FilesFolderPage, }, { path: "/:bucket/email", name: "email-home", - component: () => import("pages/email/EmailFolderPage.vue"), + component: EmailFolderPage, }, { path: "/:bucket/email/:folder", name: "email-folder", - component: () => import("pages/email/EmailFolderPage.vue"), + component: EmailFolderPage, }, { path: "/:bucket/email/:folder/:file",