From 37167a41a6a5f643acde3485d2a6e287a6e31415 Mon Sep 17 00:00:00 2001 From: Leo Vasanko Date: Tue, 7 Nov 2023 16:54:46 -0800 Subject: [PATCH] Fix server exit hang on MacOS, cleanup, include directories in zips, natural sort. --- cista-front/src/components/UploadButton.vue | 15 +++++--- cista/app.py | 41 ++++++++++----------- cista/auth.py | 2 +- cista/serve.py | 5 ++- cista/watching.py | 4 +- pyproject.toml | 3 +- 6 files changed, 37 insertions(+), 33 deletions(-) diff --git a/cista-front/src/components/UploadButton.vue b/cista-front/src/components/UploadButton.vue index d3caefe..a125ea0 100644 --- a/cista-front/src/components/UploadButton.vue +++ b/cista-front/src/components/UploadButton.vue @@ -55,11 +55,16 @@ async function sendChunk(file: File, start: number, end: number) { } } -async function uploadFileChangeHandler(event: Event) { +async function uploadHandler(event: Event) { const target = event.target as HTMLInputElement const chunkSize = 1 << 20 - if (target && target.files && target.files.length > 0) { - const file = target.files[0] + if (!target?.files?.length) { + documentStore.error = 'No files selected' + return + } + for (const idx in target.files) { + const file = target.files[idx] + console.log('Uploading', file) const numChunks = Math.ceil(file.size / chunkSize) const document = documentStore.pushUploadingDocuments(file.name) open('bottomRight') @@ -78,14 +83,14 @@ async function uploadFileChangeHandler(event: Event) {