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