From df64020e074845e9299942a94091e68ecb538a68 Mon Sep 17 00:00:00 2001 From: Azalea Gui Date: Thu, 23 Feb 2023 15:55:15 -0500 Subject: [PATCH] [+] UI: Display image thumbnail --- src/App.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index 3147913..aa90eac 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -20,6 +20,7 @@ interface File { size: number mtime: string mime?: string + has_thumb?: boolean } const getType = (f: File) => f.type ?? f.file_type @@ -47,6 +48,8 @@ const fetchApi = async () => function getIcon(f: File) { if (getType(f) == "directory") return urlJoin(deployPath, "mime/folder.svg") + + if (f.has_thumb) return urlJoin(host, filePath, f.name) + "?thumb=1" const sp = f.name.split(".") const m = f.mime ?? mime.getType(sp[sp.length - 1])