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.
Go aialertsdashboarddockerdocker-monitoringgohomelabinfrastructure-monitoringkubernetesmonitoringmspproxmoxproxmox-backup-serverproxmox-mail-gatewayproxmox-veself-hostedtruenastypescriptvspherewebhooks
Fix false "unsaved changes" banner on alerts destinations tab
rcourtman7832014f740a
diff --git a/frontend-modern/src/components/Alerts/EmailProviderSelect.tsx b/frontend-modern/src/components/Alerts/EmailProviderSelect.tsxindex 286118de95..9181c3f0df 100644--- a/frontend-modern/src/components/Alerts/EmailProviderSelect.tsx+++ b/frontend-modern/src/components/Alerts/EmailProviderSelect.tsx@@ -197,6 +197,7 @@ export function EmailProviderSelect(props: EmailProviderSelectProps) {onInput={(e) => props.onChange({ ...props.config, username: e.currentTarget.value })}placeholder={getAlertEmailUsernamePlaceholder(props.config.provider)}class={controlClass('px-2 py-1.5')}+ autocomplete="off"/></div>@@ -211,6 +212,7 @@ export function EmailProviderSelect(props: EmailProviderSelectProps) {onInput={(e) => props.onChange({ ...props.config, password: e.currentTarget.value })}placeholder={ALERT_EMAIL_PASSWORD_PLACEHOLDER}class={controlClass('px-2 py-1.5')}+ autocomplete="new-password"/></div></div>diff --git a/frontend-modern/src/features/alerts/AlertsConfigurationSurface.tsx b/frontend-modern/src/features/alerts/AlertsConfigurationSurface.tsxindex b02b69bd22..294988d391 100644--- a/frontend-modern/src/features/alerts/AlertsConfigurationSurface.tsx+++ b/frontend-modern/src/features/alerts/AlertsConfigurationSurface.tsx@@ -144,7 +144,7 @@ export function AlertsConfigurationSurface(props: AlertsConfigurationSurfaceProppmgThresholds={state.pmgThresholds}setPMGThresholds={state.setPMGThresholds}activeAlerts={props.activeAlerts}- setHasUnsavedChanges={props.setHasUnsavedChanges}+ setHasUnsavedChanges={state.guardedSetHasUnsavedChanges}removeAlerts={props.removeAlerts}disableAllNodes={state.disableAllNodes}setDisableAllNodes={state.setDisableAllNodes}@@ -209,7 +209,7 @@ export function AlertsConfigurationSurface(props: AlertsConfigurationSurfaceProp<Show when={props.activeTab() === 'destinations'}><DestinationsTab- setHasUnsavedChanges={props.setHasUnsavedChanges}+ setHasUnsavedChanges={state.guardedSetHasUnsavedChanges}emailConfig={state.emailConfig}setEmailConfig={state.setEmailConfig}appriseConfig={state.appriseConfig}@@ -223,7 +223,7 @@ export function AlertsConfigurationSurface(props: AlertsConfigurationSurfaceProp<Show when={props.activeTab() === 'schedule'}><ScheduleTab- setHasUnsavedChanges={props.setHasUnsavedChanges}+ setHasUnsavedChanges={state.guardedSetHasUnsavedChanges}quietHours={state.scheduleQuietHours}setQuietHours={state.setScheduleQuietHours}cooldown={state.scheduleCooldown}diff --git a/frontend-modern/src/features/alerts/useAlertsConfigurationState.ts b/frontend-modern/src/features/alerts/useAlertsConfigurationState.tsindex a48d3a1df4..f94ab11d6d 100644--- a/frontend-modern/src/features/alerts/useAlertsConfigurationState.ts+++ b/frontend-modern/src/features/alerts/useAlertsConfigurationState.ts@@ -45,8 +45,13 @@ export interface AlertsConfigurationSurfaceProps {export function useAlertsConfigurationState(props: AlertsConfigurationSurfaceProps) {const [isReloadingConfig, setIsReloadingConfig] = createSignal(false);+ const [suppressDirtyFlag, setSuppressDirtyFlag] = createSignal(false);+ const guardedSetHasUnsavedChanges = (value: boolean) => {+ if (value && suppressDirtyFlag()) return;+ props.setHasUnsavedChanges(value);+ };const configurationSnapshotState = useAlertsConfigurationSnapshotState({- setHasUnsavedChanges: props.setHasUnsavedChanges,+ setHasUnsavedChanges: guardedSetHasUnsavedChanges,});const destinationsState = useAlertDestinationsState({ activeTab: props.activeTab });const overridesState = useAlertOverridesState({@@ -59,6 +64,7 @@ export function useAlertsConfigurationState(props: AlertsConfigurationSurfaceProconst loadAlertConfiguration = async (options: { notify?: boolean } = {}) => {setIsReloadingConfig(true);+ setSuppressDirtyFlag(true);props.setHasUnsavedChanges(false);destinationsState.resetDestinations();configurationSnapshotState.applyConfigurationSnapshot(createDefaultAlertsConfigurationSnapshot());@@ -81,6 +87,7 @@ export function useAlertsConfigurationState(props: AlertsConfigurationSurfacePro}} finally {setIsReloadingConfig(false);+ queueMicrotask(() => setSuppressDirtyFlag(false));}};@@ -115,6 +122,7 @@ export function useAlertsConfigurationState(props: AlertsConfigurationSurfaceProreturn {isReloadingConfig,+ guardedSetHasUnsavedChanges,isLoadingDestinations: destinationsState.isLoadingDestinations,destConfigLoadError: destinationsState.destConfigLoadError,overrides: overridesState.overrides,