From 07235fda1d992fc6f57966a1edb9ed5a6fadc257 Mon Sep 17 00:00:00 2001 From: SebClem Date: Thu, 27 Oct 2022 19:02:06 +0200 Subject: [PATCH] :hammer: Show detail in cloud list view --- .../backend/src/services/webdavService.ts | 2 +- nextcloud_backup/frontend/package.json | 1 + nextcloud_backup/frontend/pnpm-lock.yaml | 7 ++ .../frontend/src/components/MessageBar.vue | 27 ++++--- .../src/components/cloud/CloudList.vue | 49 ++++--------- .../src/components/cloud/CloudListItem.vue | 73 +++++++++++++++++++ nextcloud_backup/frontend/src/types/webdav.ts | 2 +- 7 files changed, 113 insertions(+), 48 deletions(-) create mode 100644 nextcloud_backup/frontend/src/components/cloud/CloudListItem.vue diff --git a/nextcloud_backup/backend/src/services/webdavService.ts b/nextcloud_backup/backend/src/services/webdavService.ts index a614915..2eb71c5 100644 --- a/nextcloud_backup/backend/src/services/webdavService.ts +++ b/nextcloud_backup/backend/src/services/webdavService.ts @@ -139,7 +139,7 @@ function parseXmlBackupData(body: string) { backups.push({ id: id, lastEdit: lastEdit, - size: propstat["d:prop"]["d:getcontentlenght"], + size: propstat["d:prop"]["d:getcontentlength"], name: name, }); } diff --git a/nextcloud_backup/frontend/package.json b/nextcloud_backup/frontend/package.json index 6cb9e13..1066fff 100644 --- a/nextcloud_backup/frontend/package.json +++ b/nextcloud_backup/frontend/package.json @@ -17,6 +17,7 @@ "ky": "^0.31.4", "luxon": "^3.0.4", "pinia": "^2.0.23", + "pretty-bytes": "^6.0.0", "roboto-fontface": "*", "vue": "^3.2.40", "vuetify": "3.0.0-beta.15", diff --git a/nextcloud_backup/frontend/pnpm-lock.yaml b/nextcloud_backup/frontend/pnpm-lock.yaml index 6e0f7ce..4cf5d0e 100644 --- a/nextcloud_backup/frontend/pnpm-lock.yaml +++ b/nextcloud_backup/frontend/pnpm-lock.yaml @@ -18,6 +18,7 @@ specifiers: npm-run-all: ^4.1.5 pinia: ^2.0.23 prettier: ^2.7.1 + pretty-bytes: ^6.0.0 roboto-fontface: '*' typescript: ~4.7.4 vite: ^3.1.7 @@ -34,6 +35,7 @@ dependencies: ky: 0.31.4 luxon: 3.0.4 pinia: 2.0.23_rg374xhldfcyvjtaj3qktyfz5y + pretty-bytes: 6.0.0 roboto-fontface: 0.10.0 vue: 3.2.40 vuetify: 3.0.0-beta.15_vdkwhj2kz5kpysy3rwb432nm3y @@ -1841,6 +1843,11 @@ packages: hasBin: true dev: true + /pretty-bytes/6.0.0: + resolution: {integrity: sha512-6UqkYefdogmzqAZWzJ7laYeJnaXDy2/J+ZqiiMtS7t7OfpXWTlaeGMwX8U6EFvPV/YWWEKRkS8hKS4k60WHTOg==} + engines: {node: ^14.13.1 || >=16.0.0} + dev: false + /punycode/2.1.1: resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==} engines: {node: '>=6'} diff --git a/nextcloud_backup/frontend/src/components/MessageBar.vue b/nextcloud_backup/frontend/src/components/MessageBar.vue index 147499a..61d877c 100644 --- a/nextcloud_backup/frontend/src/components/MessageBar.vue +++ b/nextcloud_backup/frontend/src/components/MessageBar.vue @@ -31,18 +31,23 @@ @click="show[index] = show[index] ? false : true" size="small" > - mdi-information - - - mdi-check + + {{ show[index] ? "mdi-chevron-up" : "mdi-information" }} + + + + mdi-check + + +
{{ getTimeDelta(item.time) }}
diff --git a/nextcloud_backup/frontend/src/components/cloud/CloudList.vue b/nextcloud_backup/frontend/src/components/cloud/CloudList.vue index 973cee4..db5d57c 100644 --- a/nextcloud_backup/frontend/src/components/cloud/CloudList.vue +++ b/nextcloud_backup/frontend/src/components/cloud/CloudList.vue @@ -16,23 +16,13 @@ class="text-center text-subtitle-2 text-disabled" >Folder is empty - + + @@ -50,26 +40,13 @@ class="text-center text-subtitle-2 text-disabled" >Folder is empty - + @@ -88,6 +65,9 @@ import { getManualBackupList, } from "@/services/webdavService"; +import CloudListItem from "./CloudListItem.vue"; + +const popup = ref(false); const autoBackups = ref([]); const manualBackups = ref([]); function refreshBackup() { @@ -98,6 +78,5 @@ function refreshBackup() { manualBackups.value = value; }); } - refreshBackup(); diff --git a/nextcloud_backup/frontend/src/components/cloud/CloudListItem.vue b/nextcloud_backup/frontend/src/components/cloud/CloudListItem.vue new file mode 100644 index 0000000..4dfa6a3 --- /dev/null +++ b/nextcloud_backup/frontend/src/components/cloud/CloudListItem.vue @@ -0,0 +1,73 @@ + + + diff --git a/nextcloud_backup/frontend/src/types/webdav.ts b/nextcloud_backup/frontend/src/types/webdav.ts index 413ddea..a361bb0 100644 --- a/nextcloud_backup/frontend/src/types/webdav.ts +++ b/nextcloud_backup/frontend/src/types/webdav.ts @@ -4,5 +4,5 @@ export interface WebdavBackup { id: string; name: string; size: number; - lastEdit: DateTime; + lastEdit: string; } \ No newline at end of file