From 3e2ef80ad3a64464568e910ebded5284e64c5221 Mon Sep 17 00:00:00 2001 From: waltem01 Date: Wed, 21 Feb 2024 09:55:19 +0100 Subject: [PATCH] optional auto update --- Webserver/src/routes/image/+page.svelte | 34 ++++++++++++++++++++----- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/Webserver/src/routes/image/+page.svelte b/Webserver/src/routes/image/+page.svelte index d93f40d..823be57 100644 --- a/Webserver/src/routes/image/+page.svelte +++ b/Webserver/src/routes/image/+page.svelte @@ -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 @@ /> +
+ +
+ +
+
+ Placing image . . .

{uploadData.elapsed} seconds elapsed.

{:then} - {#await updateMatrix()} -

Updating matrix . . .

-

{uploadData.elapsed} seconds elapsed.

- {:then} + {#if submitData.u} + {#await updateMatrix()} +

Updating matrix . . .

+

{uploadData.elapsed} seconds elapsed.

+ {:then} +

Done!

+

{uploadData.elapsed} seconds elapsed.

+ {/await} + {:else}

Done!

-

{uploadData.elapsed} seconds elapsed.

- {/await} +

+ {(() => { + clearInterval(uploadData.interval); + return uploadData.elapsed; + })()} seconds elapsed. +

+ {/if} {/await} {/await} {/await}