From 2456d7fd47567e22e1a9aa063caafa28123a77fe Mon Sep 17 00:00:00 2001 From: Austin Hulen Date: Tue, 6 Aug 2024 00:32:00 -0700 Subject: [PATCH 1/2] Added file upload size limit to 512 MB --- src/ui/UserPortal/components/ChatInput.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ui/UserPortal/components/ChatInput.vue b/src/ui/UserPortal/components/ChatInput.vue index 64be1f7d38..108ca7f7e5 100644 --- a/src/ui/UserPortal/components/ChatInput.vue +++ b/src/ui/UserPortal/components/ChatInput.vue @@ -63,6 +63,7 @@ :file-limit="1" :auto="false" :custom-upload="true" + :max-file-size="512000000" @uploader="handleUpload" > @@ -228,6 +232,7 @@ export default { primaryButtonText: this.$appConfigStore.primaryButtonText, secondaryButtonBg: this.$appConfigStore.secondaryButtonBg, secondaryButtonText: this.$appConfigStore.secondaryButtonText, + uploadProgress: 0, }; }, @@ -293,6 +298,7 @@ export default { }, async handleUpload(event: any) { + this.uploadProgress = 70; try { const formData = new FormData(); formData.append('file', event.files[0]); @@ -310,6 +316,7 @@ export default { life: 5000, }); this.showFileUploadDialog = false; + this.uploadProgress = 0; } catch (error) { this.$toast.add({ severity: 'error', @@ -333,6 +340,7 @@ export default { }, uploadFile(uploadCallback) { + this.uploadProgress = 0; if (this.fileArrayFiltered.length) { this.$confirm.require({ message: 'Uploading a new file will replace the file already attached.', @@ -353,12 +361,10 @@ export default { }, reject: () => { uploadCallback(); - this.showFileUploadDialog = false; }, }); } else { uploadCallback(); - this.showFileUploadDialog = false; } }, diff --git a/src/ui/UserPortal/plugins/primevue.ts b/src/ui/UserPortal/plugins/primevue.ts index f674d717a7..95cb11b6f3 100644 --- a/src/ui/UserPortal/plugins/primevue.ts +++ b/src/ui/UserPortal/plugins/primevue.ts @@ -17,6 +17,7 @@ import Badge from 'primevue/badge'; import BadgeDirective from 'primevue/badgedirective'; import ConfirmDialog from 'primevue/confirmdialog'; import ConfirmationService from 'primevue/confirmationservice'; +import ProgressBar from 'primevue/progressbar'; import { defineNuxtPlugin } from '#app'; @@ -37,6 +38,7 @@ export default defineNuxtPlugin((nuxtApp) => { nuxtApp.vueApp.component('Badge', Badge); nuxtApp.vueApp.directive('badge', BadgeDirective); nuxtApp.vueApp.component('ConfirmDialog', ConfirmDialog); + nuxtApp.vueApp.component('ProgressBar', ProgressBar); nuxtApp.vueApp.use(ConfirmationService);