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
This commit is contained in:
parent
80e4c47b10
commit
95ca372568
3 changed files with 6 additions and 0 deletions
|
|
@ -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"),
|
||||
|
|
|
|||
|
|
@ -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"))
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue