From 3d6328fbb372ed2b5cb0148feeb6e306e844300a Mon Sep 17 00:00:00 2001 From: Joep Date: Tue, 19 Sep 2023 23:37:33 +0200 Subject: [PATCH] Updated filelisting to composition api & typescript. TODO: FILELISTING BROKEN --- frontend/src/stores/auth.ts | 1 - frontend/src/types/user.d.ts | 5 + frontend/src/utils/upload.ts | 7 +- frontend/src/views/files/FileListing.vue | 1166 +++++++++++----------- 4 files changed, 616 insertions(+), 563 deletions(-) diff --git a/frontend/src/stores/auth.ts b/frontend/src/stores/auth.ts index 38b4adcf..d29f2a31 100644 --- a/frontend/src/stores/auth.ts +++ b/frontend/src/stores/auth.ts @@ -1,5 +1,4 @@ import { defineStore } from "pinia"; -import dayjs from "dayjs"; import i18n, { detectLocale, setLocale } from "@/i18n"; import { cloneDeep } from "lodash-es"; diff --git a/frontend/src/types/user.d.ts b/frontend/src/types/user.d.ts index a4fb3dd1..3255cbb9 100644 --- a/frontend/src/types/user.d.ts +++ b/frontend/src/types/user.d.ts @@ -11,6 +11,11 @@ interface IUser { hideDotfiles: boolean; singleClick: boolean; dateFormat: boolean; + viewMode: "list" | "mosaic" | "mosaic gallery"; + sorting?: { + by: string, + asc: boolean + } } interface IUserForm { diff --git a/frontend/src/utils/upload.ts b/frontend/src/utils/upload.ts index 2436d5cc..72872c78 100644 --- a/frontend/src/utils/upload.ts +++ b/frontend/src/utils/upload.ts @@ -1,10 +1,7 @@ import { useUploadStore } from "@/stores/upload"; import url from "@/utils/url"; -export function checkConflict( - files: UploadList, - dest: ResourceItem[] -): boolean { +export function checkConflict(files: UploadList, dest: Resource[]): boolean { if (typeof dest === "undefined" || dest === null) { dest = []; } @@ -29,7 +26,7 @@ export function checkConflict( return dest.some((d) => names.has(d.name)); } -export function scanFiles(dt: DataTransfer) { +export function scanFiles(dt: DataTransfer): Promise { return new Promise((resolve) => { let reading = 0; const contents: UploadList = []; diff --git a/frontend/src/views/files/FileListing.vue b/frontend/src/views/files/FileListing.vue index faed1928..a87867a0 100644 --- a/frontend/src/views/files/FileListing.vue +++ b/frontend/src/views/files/FileListing.vue @@ -51,7 +51,7 @@ v-if="headerButtons.shell" icon="code" :label="$t('buttons.shell')" - @action="toggleShell" + @action="layoutStore.toggleShell" />
- {{ selectedCount }} selected + {{ fileStore.selectedCount }} selected
-
+

@@ -126,7 +126,7 @@

-