From 9c6b20ecc68aa4e82404433119ea2b056ee4d4e3 Mon Sep 17 00:00:00 2001 From: Jesse Malotaux Date: Sat, 3 May 2025 02:03:48 +0200 Subject: [PATCH] Systray update. --- be/app/api.go | 2 +- be/app/systray.go | 6 ++++-- build.sh | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/be/app/api.go b/be/app/api.go index 75c16f8..af6f3e7 100644 --- a/be/app/api.go +++ b/be/app/api.go @@ -96,7 +96,7 @@ func ApiPost(w http.ResponseWriter, r *http.Request) { case "/macro/play": PlayMacro("", w, r) case "/device/server/ip": - GetServerIP(w) + ListServerIP(w) case "/device/list": DeviceList(w, r) case "/device/access/check": diff --git a/be/app/systray.go b/be/app/systray.go index dcece3f..fe36705 100644 --- a/be/app/systray.go +++ b/be/app/systray.go @@ -18,9 +18,11 @@ func OnReady() { systray.SetTitle("Macrame") systray.SetTooltip("Macrame - Server") - ip, _ := GetServerIp() + ip, err := GetServerIp() - systray.AddMenuItem("IP: "+ip+":"+helper.EnvGet("MCRM__PORT"), "") + if err == nil { + systray.AddMenuItem("IP: "+ip+":"+helper.EnvGet("MCRM__PORT"), "") + } systray.AddSeparator() diff --git a/build.sh b/build.sh index 604a868..4e173d7 100644 --- a/build.sh +++ b/build.sh @@ -5,7 +5,8 @@ BUILD_DIR="Macrame_$(date +'%m%d%H%M%S')" # Build the Go application cd be -go build -o Macrame.exe main.go +# go build -o Macrame.exe main.go // old command before systray update +go build -ldflags "-H=windowsgui" -o Macrame.exe main.go go build -o Setup.exe setup/setup.go # Build the frontend @@ -26,7 +27,7 @@ cp ../be/Macrame.exe $BUILD_DIR/be/Macrame.exe cp ../be/Setup.exe $BUILD_DIR/be/Setup.exe cp -r ../macros/* $BUILD_DIR/macros/ cp -r ../panels/* $BUILD_DIR/panels/ -mv ../public/* $BUILD_DIR/public/ +cp -r ../public/* $BUILD_DIR/public/ cp ../install.bat $BUILD_DIR/install.bat cp ../Macrame.lnk $BUILD_DIR/Macrame.lnk