From 31f69bac10ffd34c9b226c3f183ac0df2cfb7199 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 6 Sep 2022 16:47:18 +0200 Subject: [PATCH] Added Preview images for non image files (Based on type / generated from extension) Closes #31 --- frontend/src/components/AsyncImage.vue | 31 ------- .../components/DirViewer/DirViewerTable.vue | 8 +- .../src/components/DirViewer/PreviewImage.vue | 84 +++++++++++++++++++ 3 files changed, 87 insertions(+), 36 deletions(-) delete mode 100644 frontend/src/components/AsyncImage.vue create mode 100644 frontend/src/components/DirViewer/PreviewImage.vue diff --git a/frontend/src/components/AsyncImage.vue b/frontend/src/components/AsyncImage.vue deleted file mode 100644 index 8e6b7f5..0000000 --- a/frontend/src/components/AsyncImage.vue +++ /dev/null @@ -1,31 +0,0 @@ - - - - - diff --git a/frontend/src/components/DirViewer/DirViewerTable.vue b/frontend/src/components/DirViewer/DirViewerTable.vue index 3949100..afdb759 100644 --- a/frontend/src/components/DirViewer/DirViewerTable.vue +++ b/frontend/src/components/DirViewer/DirViewerTable.vue @@ -34,7 +34,7 @@ import { Download } from '@vicons/carbon'; import NLink from '@/components/NLink.vue'; -import AsyncImage from '@/components/AsyncImage.vue'; +import PreviewImage from '@/components/DirViewer/PreviewImage.vue'; import createZipDialog from '@/components/DirViewer/CreateZipDialog'; import DeleteModal from '@/components/DirViewer/DeleteModal.vue'; @@ -219,12 +219,10 @@ const previewColumns: DataTableColumn[] = [ title: 'Preview', key: 'preview', render(node) { - return node.preview ? ( + return node.isFile ? ( {{ - default: () => ( - - ), + default: () => , fallback: () => }} diff --git a/frontend/src/components/DirViewer/PreviewImage.vue b/frontend/src/components/DirViewer/PreviewImage.vue new file mode 100644 index 0000000..030e986 --- /dev/null +++ b/frontend/src/components/DirViewer/PreviewImage.vue @@ -0,0 +1,84 @@ + + + + +