diff --git a/frontend/src/api/files.ts b/frontend/src/api/files.ts index 01498b83..8de0196d 100644 --- a/frontend/src/api/files.ts +++ b/frontend/src/api/files.ts @@ -188,10 +188,15 @@ export async function diskUsage(url: string) { return await data.json(); } -export async function archive(url: string, name: string, format: string, ...files: string[]) { +export async function archive( + url: string, + name: string, + format: string, + ...files: string[] +) { let arg = ""; - for (let file of files) { + for (const file of files) { arg += file + ","; } @@ -214,7 +219,12 @@ export async function unarchive(path: string, name: string, override: boolean) { return resourceAction(url, "PATCH"); } -export async function chmod(path: string, perms: number, recursive: boolean, recursionType: string) { +export async function chmod( + path: string, + perms: number, + recursive: boolean, + recursionType: string +) { const action = `chmod`; let url = `${path}?action=${action}&permissions=${perms}&recursive=${recursive}`; if (recursive) { diff --git a/frontend/src/components/Quota.vue b/frontend/src/components/Quota.vue index 24f97571..bb096370 100644 --- a/frontend/src/components/Quota.vue +++ b/frontend/src/components/Quota.vue @@ -44,23 +44,37 @@ const quotaStore = useQuotaStore(); const { t } = useI18n(); const loaded = computed(() => - quotaStore.quota ? quotaStore.quota.inodes !== null && quotaStore.quota.space !== null : false + quotaStore.quota + ? quotaStore.quota.inodes !== null && quotaStore.quota.space !== null + : false ); const spaceProgress = computed(() => - quotaStore.quota && quotaStore.quota.space !== null ? progress(quotaStore.quota.space) : 0 + quotaStore.quota && quotaStore.quota.space !== null + ? progress(quotaStore.quota.space) + : 0 ); const inodeProgress = computed(() => - quotaStore.quota && quotaStore.quota.inodes !== null ? progress(quotaStore.quota.inodes) : 0 + quotaStore.quota && quotaStore.quota.inodes !== null + ? progress(quotaStore.quota.inodes) + : 0 ); const spaceUsageTitle = computed(() => - !quotaStore.quota ? "- / -" : filesize(quotaStore.quota.space.usage) + " / " + filesize(quotaStore.quota.space.quota) + !quotaStore.quota + ? "- / -" + : filesize(quotaStore.quota.space.usage) + + " / " + + filesize(quotaStore.quota.space.quota) ); const inodeUsageTitle = computed(() => - !quotaStore.quota ? "- / -" : filesize(quotaStore.quota.inodes.usage) + " / " + filesize(quotaStore.quota.inodes.quota) + !quotaStore.quota + ? "- / -" + : filesize(quotaStore.quota.inodes.usage) + + " / " + + filesize(quotaStore.quota.inodes.quota) ); const progress = (info: QuotaInfo) => { @@ -71,5 +85,5 @@ const progress = (info: QuotaInfo) => { onMounted(() => { quotaStore.fetchQuota(); -}) +}); diff --git a/frontend/src/components/Sidebar.vue b/frontend/src/components/Sidebar.vue index e89062b1..c90a5073 100644 --- a/frontend/src/components/Sidebar.vue +++ b/frontend/src/components/Sidebar.vue @@ -131,7 +131,7 @@ href="https://github.com/filebrowser/filebrowser" >File Browser - {{ ' ' }} {{ version }} + {{ " " }} {{ version }} {{ $t("sidebar.help") }} diff --git a/frontend/src/components/files/ContextMenu.vue b/frontend/src/components/files/ContextMenu.vue index b10d3b8d..3c02be1a 100644 --- a/frontend/src/components/files/ContextMenu.vue +++ b/frontend/src/components/files/ContextMenu.vue @@ -1,10 +1,5 @@ diff --git a/frontend/src/components/prompts/Unarchive.vue b/frontend/src/components/prompts/Unarchive.vue index 76208b5f..b06f9f10 100644 --- a/frontend/src/components/prompts/Unarchive.vue +++ b/frontend/src/components/prompts/Unarchive.vue @@ -79,16 +79,9 @@ const overwriteAvailable = computed((): boolean => { return false; } - return [ - ".zip", - ".rar", - ".tar", - ".bz2", - ".gz", - ".xz", - ".lz4", - ".sz", - ].includes(item.extension); + return [".zip", ".rar", ".tar", ".bz2", ".gz", ".xz", ".lz4", ".sz"].includes( + item.extension + ); }); const cancel = () => { diff --git a/frontend/src/components/settings/Languages.vue b/frontend/src/components/settings/Languages.vue index dd8d90ff..c41b42ab 100644 --- a/frontend/src/components/settings/Languages.vue +++ b/frontend/src/components/settings/Languages.vue @@ -29,7 +29,7 @@ export default { ru_RU: "Русский", tr_TR: "Türkçe", uk_UA: "Український", - zh_CN: "中文 (简体)" + zh_CN: "中文 (简体)", }; // Vue3 reactivity breaks with this configuration diff --git a/frontend/src/i18n/index.ts b/frontend/src/i18n/index.ts index d3653257..83f76ca7 100644 --- a/frontend/src/i18n/index.ts +++ b/frontend/src/i18n/index.ts @@ -106,9 +106,9 @@ export const isRtl = (locale?: string) => { }; export function setLocale(locale: string) { - let normalizedLocale = locale + let normalizedLocale = locale; if (locale.includes("_")) { - normalizedLocale = locale.split("_")[0] + normalizedLocale = locale.split("_")[0]; } dayjs.locale(normalizedLocale); diff --git a/frontend/src/stores/contextMenu.ts b/frontend/src/stores/contextMenu.ts index 6b6bdc00..a8ac86c6 100644 --- a/frontend/src/stores/contextMenu.ts +++ b/frontend/src/stores/contextMenu.ts @@ -8,10 +8,10 @@ export const useContextMenuStore = defineStore("context-menu", { }), actions: { show(x: number, y: number) { - this.position = { x, y } + this.position = { x, y }; }, hide() { - this.position = null + this.position = null; }, }, }); diff --git a/frontend/src/stores/file.ts b/frontend/src/stores/file.ts index c8a1e159..c2acbaae 100644 --- a/frontend/src/stores/file.ts +++ b/frontend/src/stores/file.ts @@ -33,8 +33,8 @@ export const useFileStore = defineStore("file", { return state.isFiles && state?.req?.isDir; }, onlyArchivesSelected: (state) => { - let extensions = [".zip", ".tar", ".gz", ".bz2", ".xz", ".lz4", ".sz"]; - let items = state.req?.items; + const extensions = [".zip", ".tar", ".gz", ".bz2", ".xz", ".lz4", ".sz"]; + const items = state.req?.items; if (!items) { return false; @@ -45,7 +45,7 @@ export const useFileStore = defineStore("file", { } for (const i of state.selected) { - let item = items[i]; + const item = items[i]; if (item.isDir || !extensions.includes(item.extension)) { return false; } diff --git a/frontend/src/stores/quota.ts b/frontend/src/stores/quota.ts index f8b23a26..3dfb6d1c 100644 --- a/frontend/src/stores/quota.ts +++ b/frontend/src/stores/quota.ts @@ -16,7 +16,7 @@ export const useQuotaStore = defineStore("quota", { setTimeout(async () => { try { - let data = await api.getQuota(); + const data = await api.getQuota(); if ( data !== null && @@ -29,6 +29,6 @@ export const useQuotaStore = defineStore("quota", { console.log(e); } }, delay); - } + }, }, }); diff --git a/frontend/src/types/contextMenu.d.ts b/frontend/src/types/contextMenu.d.ts index 6aa3757f..41e531a3 100644 --- a/frontend/src/types/contextMenu.d.ts +++ b/frontend/src/types/contextMenu.d.ts @@ -1,4 +1,4 @@ interface ContextMenuPosition { - x: number, - y: number, + x: number; + y: number; } diff --git a/frontend/src/types/permissions.d.ts b/frontend/src/types/permissions.d.ts index 3f33d5b0..693e059f 100644 --- a/frontend/src/types/permissions.d.ts +++ b/frontend/src/types/permissions.d.ts @@ -1,11 +1,11 @@ interface FilePermissions { - owner: PermissionModes, - group: PermissionModes, - others: PermissionModes, + owner: PermissionModes; + group: PermissionModes; + others: PermissionModes; } interface PermissionModes { - read: boolean, - write: boolean, - execute: boolean, + read: boolean; + write: boolean; + execute: boolean; } diff --git a/frontend/src/views/Layout.vue b/frontend/src/views/Layout.vue index 1c1459f0..1bf3d9df 100644 --- a/frontend/src/views/Layout.vue +++ b/frontend/src/views/Layout.vue @@ -50,7 +50,8 @@ watch(route, () => { } }); -const contextMenuVisible = computed((): boolean => - (fileStore.isListing || false) && contextMenuStore.position !== null +const contextMenuVisible = computed( + (): boolean => + (fileStore.isListing || false) && contextMenuStore.position !== null ); diff --git a/frontend/src/views/files/FileListing.vue b/frontend/src/views/files/FileListing.vue index bdbb450f..e4aeb0ef 100644 --- a/frontend/src/views/files/FileListing.vue +++ b/frontend/src/views/files/FileListing.vue @@ -903,13 +903,10 @@ const calculateDirSizes = () => { Promise.allSettled(promises).then((results) => { for (let result of results) { if (result.status === "fulfilled") { - fileStore.addDiskUsage( - result.value.path, - { - size: result.value.diskUsage, - inodes: result.value.inodes, - }, - ) + fileStore.addDiskUsage(result.value.path, { + size: result.value.diskUsage, + inodes: result.value.inodes, + }); } }