From 95ca372568f4dc2db758d26a20359602b9fac57f Mon Sep 17 00:00:00 2001 From: SiYue-ZO <2835601846@qq.com> Date: Wed, 25 Mar 2026 01:00:42 +0800 Subject: [PATCH] frontend: refresh gateway status after tools/config save - ToolsPage: call refreshGatewayState after tool toggle success - ConfigPage: call refreshGatewayState after config save success - RawConfigPage: call refreshGatewayState after raw JSON save success - Ensures restart-required indicator updates immediately after changes --- web/frontend/src/components/config/config-page.tsx | 2 ++ web/frontend/src/components/config/raw-config-page.tsx | 2 ++ web/frontend/src/components/tools/tools-page.tsx | 2 ++ 3 files changed, 6 insertions(+) diff --git a/web/frontend/src/components/config/config-page.tsx b/web/frontend/src/components/config/config-page.tsx index 24a719d86..c3553f5a0 100644 --- a/web/frontend/src/components/config/config-page.tsx +++ b/web/frontend/src/components/config/config-page.tsx @@ -32,6 +32,7 @@ import { } from "@/components/config/form-model" import { PageHeader } from "@/components/page-header" import { Button } from "@/components/ui/button" +import { refreshGatewayState } from "@/store/gateway" export function ConfigPage() { const { t } = useTranslation() @@ -280,6 +281,7 @@ export function ConfigPage() { } toast.success(t("pages.config.save_success")) + void refreshGatewayState({ force: true }) } catch (err) { toast.error( err instanceof Error ? err.message : t("pages.config.save_error"), diff --git a/web/frontend/src/components/config/raw-config-page.tsx b/web/frontend/src/components/config/raw-config-page.tsx index e40cc7301..56a922fe6 100644 --- a/web/frontend/src/components/config/raw-config-page.tsx +++ b/web/frontend/src/components/config/raw-config-page.tsx @@ -19,6 +19,7 @@ import { } from "@/components/ui/alert-dialog" import { Button } from "@/components/ui/button" import { Textarea } from "@/components/ui/textarea" +import { refreshGatewayState } from "@/store/gateway" export function RawConfigPage() { const { t } = useTranslation() @@ -56,6 +57,7 @@ export function RawConfigPage() { } catch { queryClient.invalidateQueries({ queryKey: ["config"] }) } + void refreshGatewayState({ force: true }) }, onError: () => { toast.error(t("pages.config.save_error")) diff --git a/web/frontend/src/components/tools/tools-page.tsx b/web/frontend/src/components/tools/tools-page.tsx index 05aa42122..6a521a565 100644 --- a/web/frontend/src/components/tools/tools-page.tsx +++ b/web/frontend/src/components/tools/tools-page.tsx @@ -14,6 +14,7 @@ import { CardTitle, } from "@/components/ui/card" import { cn } from "@/lib/utils" +import { refreshGatewayState } from "@/store/gateway" export function ToolsPage() { const { t } = useTranslation() @@ -33,6 +34,7 @@ export function ToolsPage() { : t("pages.agent.tools.disable_success"), ) void queryClient.invalidateQueries({ queryKey: ["tools"] }) + void refreshGatewayState({ force: true }) }, onError: (err) => { toast.error(