Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

fix: Make AI Assistant toggle auto-save immediately

rcourtman2dc03b02a5ac
diff --git a/frontend-modern/src/components/Settings/AISettings.tsx b/frontend-modern/src/components/Settings/AISettings.tsx
index 8f36e39aa5..3765484c03 100644
--- a/frontend-modern/src/components/Settings/AISettings.tsx
+++ b/frontend-modern/src/components/Settings/AISettings.tsx
@@ -442,8 +442,20 @@ export const AISettings: Component = () => {
/>
<Toggle
checked={form.enabled}
- onChange={(event) => {
- setForm('enabled', event.currentTarget.checked);
+ onChange={async (event) => {
+ const newValue = event.currentTarget.checked;
+ setForm('enabled', newValue);
+ // Auto-save the enabled toggle immediately
+ try {
+ const updated = await AIAPI.updateSettings({ enabled: newValue });
+ setSettings(updated);
+ notificationStore.success(newValue ? 'AI Assistant enabled' : 'AI Assistant disabled');
+ } catch (error) {
+ // Revert on failure
+ setForm('enabled', !newValue);
+ logger.error('[AISettings] Failed to toggle AI:', error);
+ notificationStore.error('Failed to update AI setting');
+ }
}}
disabled={loading() || saving()}
containerClass="items-center gap-2"