From 1dae2f721115b4b35ec2303c51d31e97e8319885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B0=D1=82=D0=BE=D0=BB=D0=B8=D0=B9=20=D0=A2?= =?UTF-8?q?=D1=83=D1=85=D1=82=D0=B0=D1=80=D0=BE=D0=B2?= Date: Wed, 12 Mar 2025 06:27:44 +0500 Subject: [PATCH] far async --- app.go | 4 ++-- frontend/src/App.svelte | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app.go b/app.go index 9ddea31..0c50da8 100644 --- a/app.go +++ b/app.go @@ -96,7 +96,7 @@ func getFileCountAndSize(dir string) (int, int64, error) { func (a *App) GetDownloads() string { cnt, size, err := getFileCountAndSize("C:\\Users\\admin\\Downloads") checkError("getDownloads", err) - info := fmt.Sprintf("%d(%d Mb)", cnt, size/1024/1024) + info := fmt.Sprintf("%d (%d Mb)", cnt, size/1024/1024) return info } @@ -216,5 +216,5 @@ func getCountReady(ctx context.Context, dir string) int { func (a *App) GetStatus() string { pics := getCountPics("d:\\pics") ready := getCountReady(a.ctx, "d:\\pics-move") - return fmt.Sprintf("%d/%d", pics, ready) + return fmt.Sprintf("%d / %d", pics, ready) } diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index a27a38f..be9d86f 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -27,8 +27,9 @@ function get_disks() { console.log("get disks") GetDisks().then((result) => { console.log("получена информация о дисках:", result) - disks = result; - normal = (disks[0].Free > 10) && (disks[1].Free > 50); + disks = result + disks[0].normal = disks[0].Free > 20; + disks[1].normal = disks[1].Free > 50; }) } @@ -101,7 +102,7 @@ get_status(); {#each disks as disk}
{disk.Name} - {disk.Free} Gb + {disk.Free} Gb
{/each}