From 94dafcd075ec3c57870ae5f8d26f9bdb63d0a5b2 Mon Sep 17 00:00:00 2001 From: Gabriel Massadas Date: Sun, 25 Feb 2024 22:10:21 +0000 Subject: [PATCH] Change default dashboard to v2.0 --- Makefile | 4 +- packages/dashboard-v2/quasar.config.js | 2 +- .../src/components/main/LeftSidebar.vue | 13 ++-- .../src/components/main/Topbar.vue | 2 +- .../src/components/utils/DragAndDrop.vue | 32 ++++++-- .../src/pages/email/EmailFolderPage.vue | 77 ++++++++++++++----- packages/dashboard/src/App.vue | 2 +- .../src/components/base/TopbarView.vue | 2 +- packages/dashboard/src/router/index.js | 4 +- packages/dashboard/src/store/index.js | 10 +-- packages/dashboard/vue.config.js | 4 +- worker/dev/index.ts | 2 +- worker/dev/wrangler.toml | 5 ++ 13 files changed, 110 insertions(+), 49 deletions(-) diff --git a/Makefile b/Makefile index 671c2f6..0848356 100644 --- a/Makefile +++ b/Makefile @@ -11,8 +11,8 @@ build-dashboard: npm install && \ npm run build - cp -r packages/dashboard/dist/ dist/ - cp -r packages/dashboard-v2/dist/spa/ dist/v2.0/ + cp -r packages/dashboard-v2/dist/spa/ dist/ + cp -r packages/dashboard/dist/ dist/v1.0/ build-worker: rm -rf worker/dist/ diff --git a/packages/dashboard-v2/quasar.config.js b/packages/dashboard-v2/quasar.config.js index f4be390..a64f005 100644 --- a/packages/dashboard-v2/quasar.config.js +++ b/packages/dashboard-v2/quasar.config.js @@ -69,7 +69,7 @@ module.exports = configure(function (/* ctx */) { // rebuildCache: true, // rebuilds Vite/linter/etc cache on startup - publicPath: '/v2.0/', + publicPath: '/', // analyze: true, // env: {}, // rawDefine: {} diff --git a/packages/dashboard-v2/src/components/main/LeftSidebar.vue b/packages/dashboard-v2/src/components/main/LeftSidebar.vue index 474f6d0..ad50d0e 100644 --- a/packages/dashboard-v2/src/components/main/LeftSidebar.vue +++ b/packages/dashboard-v2/src/components/main/LeftSidebar.vue @@ -53,13 +53,13 @@ explore the new features and improvements, feel free to provide feedback or report any issues you encounter. Your input helps us fine-tune the dashboard to meet your needs better.

- + To revisit this message in the future, simply click on the question mark icon located in the left corner. Your + feedback is invaluable to us, so don't hesitate to reach out with any thoughts or concerns.
+
Please report issues here: https://github.com/G4brym/R2-Explorer/issues/58

+ If you would like to continue using the old Dashboard: click here
+
Thank you for being a part of our journey towards excellence! 🌟

Best regards
@@ -83,8 +83,7 @@ export default defineComponent({ name: "LeftSidebar", data: function() { return { - alert: false, - firstTimeAlert: true + alert: false }; }, components: { CreateFolder }, diff --git a/packages/dashboard-v2/src/components/main/Topbar.vue b/packages/dashboard-v2/src/components/main/Topbar.vue index 06f9ada..36801f1 100644 --- a/packages/dashboard-v2/src/components/main/Topbar.vue +++ b/packages/dashboard-v2/src/components/main/Topbar.vue @@ -3,7 +3,7 @@ - + R2-Explorer diff --git a/packages/dashboard-v2/src/components/utils/DragAndDrop.vue b/packages/dashboard-v2/src/components/utils/DragAndDrop.vue index 4627b1d..ba6300d 100644 --- a/packages/dashboard-v2/src/components/utils/DragAndDrop.vue +++ b/packages/dashboard-v2/src/components/utils/DragAndDrop.vue @@ -26,6 +26,7 @@ import { useMainStore } from "stores/main-store"; import { apiHandler, decode, ROOT_FOLDER } from "src/appUtils"; +import { useQuasar } from "quasar"; export default { data: function () { @@ -127,9 +128,22 @@ export default { this.$bus.emit('fetchFiles') // self.$store.dispatch('addUploadingFiles', filenames) // TODO! + const notif = this.q.notify({ + group: false, + spinner: true, + message: `Uploading files 1/${filenames.length}...`, + caption: '0%', + timeout: 0 + }) + // Upload files let uploadCount = 0 for (const [folder, files] of Object.entries(folders)) { + notif({ + message: `Uploading files ${uploadCount+1}/${filenames.length}...`, + caption: `${parseInt((uploadCount+1)*100/(filenames.length))}%` // +1 because still needs to delete the folder + }) + let targetFolder = this.selectedFolder + folder if (targetFolder.length > 0 && targetFolder.slice(-1) !== '/') { targetFolder += '/' @@ -159,7 +173,7 @@ export default { // console.log(`${start} -> ${end}`) const { data } = await apiHandler.multipartUpload(uploadId, partNumber, this.selectedBucket, key, chunk, (progressEvent) => { - console.log((start + progressEvent.loaded) * 100 / file.size) + //console.log((start + progressEvent.loaded) * 100 / file.size) // self.$store.dispatch('setUploadProgress', { // filename: file.name, // progress: (start + progressEvent.loaded) * 100 / file.size @@ -173,7 +187,7 @@ export default { await apiHandler.multipartComplete(file, key, this.selectedBucket, parts, uploadId) } else { await apiHandler.uploadObjects(file, key, this.selectedBucket, (progressEvent) => { - console.log(progressEvent.loaded * 100 / file.size) + //console.log(progressEvent.loaded * 100 / file.size) // self.$store.dispatch('setUploadProgress', { // filename: file.name, // progress: progressEvent.loaded * 100 / file.size @@ -183,9 +197,13 @@ export default { } } - // this.$store.dispatch('makeToast', { - // message: `${totalFiles} Files uploaded successfully`, timeout: 5000 - // }) + notif({ + icon: 'done', // we add an icon + spinner: false, // we reset the spinner setting so the icon can be displayed + caption: '100%', + message: 'Files Uploaded!', + timeout: 5000 // we will timeout it in 5s + }) this.$bus.emit('fetchFiles') }, @@ -273,7 +291,8 @@ export default { }, setup () { return { - mainStore: useMainStore() + mainStore: useMainStore(), + q: useQuasar() } }, } @@ -281,6 +300,7 @@ export default {