From a087826d51217201f5b859d19b4f44983b49ac4d Mon Sep 17 00:00:00 2001 From: "kissudad@outlook.com" Date: Wed, 10 Apr 2024 12:22:32 +0800 Subject: [PATCH] fix: 1. audio preview 2. in mobile, filelist header layer is too high --- frontend/src/css/_share.css | 1 - frontend/src/stores/auth.ts | 5 +- frontend/src/views/Files.vue | 25 ++++++- frontend/src/views/Share.vue | 23 +++--- frontend/src/views/files/FileListing.vue | 93 +++++++++++++----------- 5 files changed, 90 insertions(+), 57 deletions(-) diff --git a/frontend/src/css/_share.css b/frontend/src/css/_share.css index 04034a32..f6a19a5f 100644 --- a/frontend/src/css/_share.css +++ b/frontend/src/css/_share.css @@ -19,7 +19,6 @@ color: var(--textPrimary); border-radius: 0.2em; margin: 5px; - overflow: hidden; } .share__box__header { diff --git a/frontend/src/stores/auth.ts b/frontend/src/stores/auth.ts index 2f5f653a..40c97c5e 100644 --- a/frontend/src/stores/auth.ts +++ b/frontend/src/stores/auth.ts @@ -16,7 +16,10 @@ export const useAuthStore = defineStore("auth", () => { perm: { create: false }, }); - const shareConfig = ref({ sortBy: "name", asc: false }); + const shareConfig = useStorage("share-config", { + sortBy: "name", + asc: false, + }); const isLoggedIn = computed(() => registeredUser.value !== null); const user = computed({ get: () => diff --git a/frontend/src/views/Files.vue b/frontend/src/views/Files.vue index 2e82fc6b..aa5edd87 100644 --- a/frontend/src/views/Files.vue +++ b/frontend/src/views/Files.vue @@ -8,7 +8,11 @@ - +

@@ -65,6 +69,25 @@ const clean = (path: string) => { const error = ref(null); +const currentViewProps = computed(() => { + if (fileStore.req?.type === undefined) { + return null; + } + + if (fileStore.req.isDir) { + return { + headerStickyTop: "4em", + }; + } else if ( + fileStore.req.type === "text" || + fileStore.req.type === "textImmutable" + ) { + return {}; + } else { + return {}; + } +}); + const currentView = computed(() => { if (fileStore.req?.type === undefined) { return null; diff --git a/frontend/src/views/Share.vue b/frontend/src/views/Share.vue index 4fe8b8d2..1e38fd1d 100644 --- a/frontend/src/views/Share.vue +++ b/frontend/src/views/Share.vue @@ -161,7 +161,7 @@
(null); const showLimit = ref(100); @@ -364,6 +368,7 @@ const play = () => { watch(reload, (newValue) => { newValue && fetchData(); }); + const fetchData = async () => { fileStore.reload = false; fileStore.selected = []; @@ -486,16 +491,8 @@ onBeforeUnmount(() => {