diff --git a/internal/gateway/router.go b/internal/gateway/router.go index c0c06b28..2f938eea 100644 --- a/internal/gateway/router.go +++ b/internal/gateway/router.go @@ -272,7 +272,7 @@ func (r *MethodRouter) handleConnect(ctx context.Context, client *Client, req *p "sender_id": client.id, "server": map[string]any{ "name": "goclaw", - "version": "0.2.0", + "version": r.server.version, }, })) return @@ -301,7 +301,7 @@ func (r *MethodRouter) sendConnectResponse(ctx context.Context, client *Client, "cross_tenant": client.crossTenant, "server": map[string]any{ "name": "goclaw", - "version": "0.2.0", + "version": r.server.version, }, } diff --git a/ui/web/src/api/ws-client.ts b/ui/web/src/api/ws-client.ts index eb289b49..3b0d74af 100644 --- a/ui/web/src/api/ws-client.ts +++ b/ui/web/src/api/ws-client.ts @@ -31,6 +31,7 @@ export class WsClient { tenantName = ""; tenantSlug = ""; crossTenant = false; + serverVersion = ""; private readonly maxReconnectDelay = 30_000; private readonly baseReconnectDelay = 1_000; @@ -206,6 +207,7 @@ export class WsClient { tenant_name?: string; tenant_slug?: string; cross_tenant?: boolean; + server?: { name?: string; version?: string }; }>("connect", { token: this.getToken(), user_id: this.getUserId(), @@ -238,6 +240,7 @@ export class WsClient { this.tenantName = res?.tenant_name ?? ""; this.tenantSlug = res?.tenant_slug ?? ""; this.crossTenant = res?.cross_tenant ?? false; + this.serverVersion = res?.server?.version ?? ""; this.onStateChange("connected"); } catch (e) { if (this.connectGeneration === generation) { diff --git a/ui/web/src/components/layout/connection-status.tsx b/ui/web/src/components/layout/connection-status.tsx index 6c6d1f05..adc38cb8 100644 --- a/ui/web/src/components/layout/connection-status.tsx +++ b/ui/web/src/components/layout/connection-status.tsx @@ -5,6 +5,7 @@ import { cn } from "@/lib/utils"; export function ConnectionStatus({ collapsed }: { collapsed?: boolean }) { const { t } = useTranslation("common"); const connected = useAuthStore((s) => s.connected); + const serverVersion = useAuthStore((s) => s.serverInfo?.version); return (