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: add hash check to polling fallback and persist sidebar state

rcourtman584bdc88ffd9
diff --git a/frontend-modern/src/components/Settings/Settings.tsx b/frontend-modern/src/components/Settings/Settings.tsx
index 4d0b5b1a96..2cc79a7879 100644
--- a/frontend-modern/src/components/Settings/Settings.tsx
+++ b/frontend-modern/src/components/Settings/Settings.tsx
@@ -39,6 +39,7 @@ import { SettingsSectionNav } from './SettingsSectionNav';
import { SettingsAPI } from '@/api/settings';
import { NodesAPI } from '@/api/nodes';
import { UpdatesAPI } from '@/api/updates';
+import { usePersistentSignal } from '@/hooks/usePersistentSignal';
import { Card } from '@/components/shared/Card';
import { SectionHeader } from '@/components/shared/SectionHeader';
import { Toggle } from '@/components/shared/Toggle';
@@ -596,7 +597,7 @@ const Settings: Component<SettingsProps> = (props) => {
);
const [hasUnsavedChanges, setHasUnsavedChanges] = createSignal(false);
- const [sidebarCollapsed, setSidebarCollapsed] = createSignal(true);
+ const [sidebarCollapsed, setSidebarCollapsed] = usePersistentSignal('settings-sidebar-collapsed', false);
const [nodes, setNodes] = createSignal<NodeConfigWithStatus[]>([]);
const [discoveredNodes, setDiscoveredNodes] = createSignal<DiscoveredServer[]>([]);
const [showNodeModal, setShowNodeModal] = createSignal(false);
diff --git a/internal/config/watcher.go b/internal/config/watcher.go
index 26920c0002..6439288ada 100644
--- a/internal/config/watcher.go
+++ b/internal/config/watcher.go
@@ -265,8 +265,17 @@ func (cw *ConfigWatcher) pollForChanges() {
// Check .env
if stat, err := os.Stat(cw.envPath); err == nil {
if stat.ModTime().After(cw.lastModTime) {
- log.Info().Msg("Detected .env file change via polling")
cw.lastModTime = stat.ModTime()
+ // Check if content actually changed to prevent restart loops on touch
+ newHash, err := cw.calculateFileHash(cw.envPath)
+ if err == nil {
+ if newHash == cw.lastEnvHash {
+ log.Debug().Msg("Detected .env file touch but content unchanged (polling), skipping reload")
+ continue
+ }
+ cw.lastEnvHash = newHash
+ }
+ log.Info().Msg("Detected .env file change via polling")
cw.reloadConfig()
}
}