[client/ui] Replace fyne UI with Wails (rename ui-wails to ui)

Removes the legacy fyne-based client/ui implementation and renames the
Wails replacement (client/ui-wails) to take its place at client/ui. Go
imports, frontend bindings, CI workflows, goreleaser configs and the
windows .syso icon path are updated to follow the rename.
This commit is contained in:
Zoltán Papp
2026-05-11 11:20:22 +02:00
parent 08f52f4517
commit 9aef31ff53
189 changed files with 82 additions and 5840 deletions

View File

@@ -0,0 +1,36 @@
import { useEffect, useState } from "react";
import { Events } from "@wailsio/runtime";
import { Peers } from "../../bindings/github.com/netbirdio/netbird/client/ui-wails/services";
import type { Status } from "../../bindings/github.com/netbirdio/netbird/client/ui-wails/services/models.js";
const EVENT_STATUS = "netbird:status";
// useStatus loads the current daemon status once and re-renders whenever the
// peers service emits a fresh snapshot over the Wails event bus.
export function useStatus(): { status: Status | null; error: string | null } {
const [status, setStatus] = useState<Status | null>(null);
const [error, setError] = useState<string | null>(null);
useEffect(() => {
let cancelled = false;
Peers.Get()
.then((s) => {
if (!cancelled) setStatus(s);
})
.catch((e: unknown) => {
if (!cancelled) setError(String(e));
});
const off = Events.On(EVENT_STATUS, (ev: { data: Status }) => {
setStatus(ev.data);
setError(null);
});
return () => {
cancelled = true;
off();
};
}, []);
return { status, error };
}