optional auto update

This commit is contained in:
waltem01 2024-02-21 09:55:19 +01:00
parent c38f300796
commit 3e2ef80ad3

View File

@ -20,6 +20,7 @@
y: number;
w: number;
h: number;
u: boolean;
}
let imageURL: string | null;
@ -109,7 +110,8 @@
x: parseInt(fdata.get('x')?.toString() ?? '0'),
y: parseInt(fdata.get('y')?.toString() ?? '0'),
w: parseInt(fdata.get('w')?.toString() ?? matrix.width.toString()),
h: parseInt(fdata.get('h')?.toString() ?? matrix.height.toString())
h: parseInt(fdata.get('h')?.toString() ?? matrix.height.toString()),
u: fdata.get('update') ? true : false
};
// Time upload by saving date
@ -211,6 +213,14 @@
/>
</div>
<div class="grid grid-cols-2">
<label class="border-2 border-black border-r-0 border-b-0 pl-1" for="update">Auto update:</label
>
<div class="border-2 border-black border-b-0 pl-1 bg-gray-100 w-full">
<input class="w-full" type="checkbox" name="update" id="update" checked />
</div>
</div>
<input
class="border-2 border-black hover:bg-gray-200 cursor-pointer"
type="submit"
@ -234,6 +244,7 @@
<p>Placing image . . .</p>
<p>{uploadData.elapsed} seconds elapsed.</p>
{:then}
{#if submitData.u}
{#await updateMatrix()}
<p>Updating matrix . . .</p>
<p>{uploadData.elapsed} seconds elapsed.</p>
@ -241,6 +252,15 @@
<p>Done!</p>
<p>{uploadData.elapsed} seconds elapsed.</p>
{/await}
{:else}
<p>Done!</p>
<p>
{(() => {
clearInterval(uploadData.interval);
return uploadData.elapsed;
})()} seconds elapsed.
</p>
{/if}
{/await}
{/await}
{/await}