Added file not found notification

This commit is contained in:
Max W. 2024-02-18 11:29:24 +01:00
parent 690fe5289f
commit 2fdc1d3f48
2 changed files with 26 additions and 1 deletions

View File

@ -50,7 +50,7 @@
<div class="bg-white shadow-lg rounded-lg p-6 flex flex-col items-center justify-center">
<img class="w-16 mb-6" src="./assets/circle-check-solid.svg" alt="Success">
<p class="text-xl font-bold text-center text-gray-800 mb-6">Download complete!</p>
<p class="text-gray-600 text-center w-2/3 mb-3">File {{ fileName }} has been downloaded and saved to your drive.</p>
<p class="text-gray-600 text-center w-2/3 mb-3">File <strong>{{ fileName }}</strong> has been downloaded and saved to your drive.</p>
<p class="text-gray-600 text-center w-2/3 mb-6">The download took {{ downloadDuration }} seconds.</p>
<button class="btn btn-primary w-full max-w-md flex justify-center items-center mb-4" >
Save to disk (again)
@ -93,6 +93,29 @@
<button>close</button>
</form>
</dialog>
<dialog #file_not_found_modal class="modal">
<div class="modal-box">
<h3 class="font-bold text-lg">File not found!</h3>
<div class="flex items-center justify-center flex-col w-full">
<img class="w-24 mt-6 mb-6" src="./assets/poop-solid.svg">
<h4 class="text-xl mb-1">Oh no...</h4>
<p class="text-gray-400 mb-6">What happened here?</p>
<p class="text-gray-800 text-center mb-3">The file you are trying to download does not exist.</p>
<p class="text-gray-800 text-center mb-6">Please check the file ID.</p>
<form method="dialog">
<button class="btn">Okay</button>
</form>
</div>
<form method="dialog">
<button class="btn btn-sm btn-circle btn-ghost absolute right-2 top-2"></button>
</form>
</div>
<form method="dialog" class="modal-backdrop">
<button>close</button>
</form>
</dialog>
<div class="invisible h-0 w-0">
<img src="./assets/circle-check-solid.svg">
</div>

View File

@ -22,6 +22,7 @@ import {RouterLink} from "@angular/router";
export class DownloadComponent {
@ViewChild('download_not_possible') download_not_possible: ElementRef<HTMLDialogElement> | undefined;
@ViewChild('file_not_found_modal') file_not_found_modal: ElementRef<HTMLDialogElement> | undefined;
inputFileId: string = "2402183";
fileId: string = "";
@ -114,6 +115,7 @@ export class DownloadComponent {
this.processDownloadInfo();
})
.catch(error => {
this.file_not_found_modal?.nativeElement.showModal();
console.error('Error during download info request:', error);
});
}