f111_frontend_ueberarbeitung #39
@@ -51,22 +51,21 @@
|
||||
return;
|
||||
}
|
||||
const url = await getUrl();
|
||||
open = true;
|
||||
inProgress = true;
|
||||
openUL = true;
|
||||
inProgressUL = true;
|
||||
|
||||
fetch(url, { method: 'PUT', body: files[0] })
|
||||
.then((response) => {
|
||||
inProgress = false;
|
||||
inProgressUL = false;
|
||||
etag = '123';
|
||||
})
|
||||
.catch((err) => {
|
||||
inProgress = false;
|
||||
inProgressUL = false;
|
||||
etag = null;
|
||||
console.log('ERROR', err);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
async function validateForm() {
|
||||
let data = new FormData();
|
||||
data.append('vorgang', vorgangName);
|
||||
@@ -94,6 +93,14 @@
|
||||
return success;
|
||||
}
|
||||
|
||||
async function uploadSuccessful() {
|
||||
openUL = false;
|
||||
name = '';
|
||||
files = null;
|
||||
await invalidateAll();
|
||||
crimesList = data.crimesList;
|
||||
}
|
||||
|
||||
// `val` is hex string
|
||||
function swap_endian(val) {
|
||||
// from https://www.geeksforgeeks.org/bit-manipulation-swap-endianness-of-a-number/
|
||||
@@ -401,7 +408,7 @@ Mit freundlichen Grüßen,
|
||||
<ModalFooter><Button disabled={inProgress} on:click={closeModal}>Ok</Button></ModalFooter>
|
||||
</Modal>
|
||||
|
||||
<Modal {openUL}
|
||||
<Modal open={openUL}
|
||||
><ModalTitle>Upload</ModalTitle><ModalContent>
|
||||
{#if inProgressUL}
|
||||
<p class="py-2 mb-1">Upload läuft...</p>
|
||||
@@ -411,9 +418,10 @@ Mit freundlichen Grüßen,
|
||||
<Alert class="w-full" type="error">Fehler beim Upload</Alert>
|
||||
{/if}
|
||||
</ModalContent>
|
||||
<ModalFooter><Button disabled={inProgressUL} on:click={uploadSuccessful}>Ok</Button></ModalFooter>
|
||||
<ModalFooter
|
||||
><Button disabled={inProgressUL} on:click={uploadSuccessful}>Ok</Button></ModalFooter
|
||||
>
|
||||
</Modal>
|
||||
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@@ -422,4 +430,3 @@ Mit freundlichen Grüßen,
|
||||
min-width: 24rem;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user