From 03029981fd4f4368d1f90bbdd0cafb1460370c70 Mon Sep 17 00:00:00 2001 From: "DESKTOP-T0O5CDB\\DESK-555BD" Date: Fri, 26 Jan 2024 12:40:39 -0700 Subject: [PATCH] added maxfilesize label and error handling. --- Views/Vehicle/_CollisionRecordModal.cshtml | 2 ++ Views/Vehicle/_GasModal.cshtml | 2 ++ Views/Vehicle/_OdometerRecordModal.cshtml | 2 ++ Views/Vehicle/_PlanRecordModal.cshtml | 2 ++ Views/Vehicle/_ServiceRecordModal.cshtml | 2 ++ Views/Vehicle/_SupplyRecordModal.cshtml | 2 ++ Views/Vehicle/_TaxRecordModal.cshtml | 2 ++ Views/Vehicle/_UpgradeRecordModal.cshtml | 2 ++ wwwroot/js/shared.js | 4 ++++ wwwroot/js/vehicle.js | 4 ++++ 10 files changed, 24 insertions(+) diff --git a/Views/Vehicle/_CollisionRecordModal.cshtml b/Views/Vehicle/_CollisionRecordModal.cshtml index ae4e4df..086da03 100644 --- a/Views/Vehicle/_CollisionRecordModal.cshtml +++ b/Views/Vehicle/_CollisionRecordModal.cshtml @@ -37,6 +37,7 @@ @await Html.PartialAsync("_UploadedFiles", Model.Files) +
Max File Size: 28.6MB } else @@ -52,6 +53,7 @@ } +
Max File Size: 28.6MB } diff --git a/Views/Vehicle/_GasModal.cshtml b/Views/Vehicle/_GasModal.cshtml index 6238ad6..caa2e41 100644 --- a/Views/Vehicle/_GasModal.cshtml +++ b/Views/Vehicle/_GasModal.cshtml @@ -81,12 +81,14 @@ @await Html.PartialAsync("_UploadedFiles", Model.GasRecord.Files) +
Max File Size: 28.6MB } else { +
Max File Size: 28.6MB } diff --git a/Views/Vehicle/_OdometerRecordModal.cshtml b/Views/Vehicle/_OdometerRecordModal.cshtml index eae9515..f0d2a62 100644 --- a/Views/Vehicle/_OdometerRecordModal.cshtml +++ b/Views/Vehicle/_OdometerRecordModal.cshtml @@ -29,12 +29,14 @@ @await Html.PartialAsync("_UploadedFiles", Model.Files) +
Max File Size: 28.6MB } else { +
Max File Size: 28.6MB } diff --git a/Views/Vehicle/_PlanRecordModal.cshtml b/Views/Vehicle/_PlanRecordModal.cshtml index 637d003..fe3dab8 100644 --- a/Views/Vehicle/_PlanRecordModal.cshtml +++ b/Views/Vehicle/_PlanRecordModal.cshtml @@ -53,12 +53,14 @@ @await Html.PartialAsync("_UploadedFiles", Model.Files) +
Max File Size: 28.6MB } else { +
Max File Size: 28.6MB } diff --git a/Views/Vehicle/_ServiceRecordModal.cshtml b/Views/Vehicle/_ServiceRecordModal.cshtml index a844fb8..ebbef12 100644 --- a/Views/Vehicle/_ServiceRecordModal.cshtml +++ b/Views/Vehicle/_ServiceRecordModal.cshtml @@ -37,6 +37,7 @@ @await Html.PartialAsync("_UploadedFiles", Model.Files) +
Max File Size: 28.6MB } else @@ -52,6 +53,7 @@ } +
Max File Size: 28.6MB } diff --git a/Views/Vehicle/_SupplyRecordModal.cshtml b/Views/Vehicle/_SupplyRecordModal.cshtml index 99493f8..5097f8d 100644 --- a/Views/Vehicle/_SupplyRecordModal.cshtml +++ b/Views/Vehicle/_SupplyRecordModal.cshtml @@ -43,12 +43,14 @@ @await Html.PartialAsync("_UploadedFiles", Model.Files) +
Max File Size: 28.6MB } else { +
Max File Size: 28.6MB } diff --git a/Views/Vehicle/_TaxRecordModal.cshtml b/Views/Vehicle/_TaxRecordModal.cshtml index ac1eeec..4f4881c 100644 --- a/Views/Vehicle/_TaxRecordModal.cshtml +++ b/Views/Vehicle/_TaxRecordModal.cshtml @@ -45,6 +45,7 @@ @await Html.PartialAsync("_UploadedFiles", Model.Files) +
Max File Size: 28.6MB } else @@ -60,6 +61,7 @@ } +
Max File Size: 28.6MB } diff --git a/Views/Vehicle/_UpgradeRecordModal.cshtml b/Views/Vehicle/_UpgradeRecordModal.cshtml index 1cdd7fb..3e6eb60 100644 --- a/Views/Vehicle/_UpgradeRecordModal.cshtml +++ b/Views/Vehicle/_UpgradeRecordModal.cshtml @@ -37,6 +37,7 @@ @await Html.PartialAsync("_UploadedFiles", Model.Files) +
Max File Size: 28.6MB } else @@ -52,6 +53,7 @@ } +
Max File Size: 28.6MB } diff --git a/wwwroot/js/shared.js b/wwwroot/js/shared.js index 04904f6..f2f014a 100644 --- a/wwwroot/js/shared.js +++ b/wwwroot/js/shared.js @@ -108,6 +108,10 @@ function uploadFileAsync(event) { if (response.trim() != '') { uploadedFile = response; } + }, + error: function () { + sloader.hide(); + errorToast("An error has occurred, please check the file size and try again later.") } }); } diff --git a/wwwroot/js/vehicle.js b/wwwroot/js/vehicle.js index 3dc2ab8..bdc67f0 100644 --- a/wwwroot/js/vehicle.js +++ b/wwwroot/js/vehicle.js @@ -278,6 +278,10 @@ function uploadVehicleFilesAsync(event) { if (response.length > 0) { uploadedFiles.push.apply(uploadedFiles, response); } + }, + error: function () { + sloader.hide(); + errorToast("An error has occurred, please check the file size and try again later.") } }); }