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.

Keep the manage flow synced to the ledger and surface TrueNAS TLS errors

rcourtmanb85363898074
diff --git a/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx b/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx
index da7be8c0d3..12831fd34a 100644
--- a/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx
+++ b/frontend-modern/src/components/Settings/InfrastructureWorkspace.tsx
@@ -123,7 +123,19 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
const rowActions = useConnectionRowActions({ onMutated: () => ledger.reload() });
const [showAgentProfiles, setShowAgentProfiles] = createSignal(false);
- const [editingRow, setEditingRow] = createSignal<InfrastructureSystemRow | null>(null);
+ // Keep the row under edit synced to the live ledger: mutations inside the
+ // manage flow (e.g. removing an attached Pulse Agent) reload the ledger, and
+ // a frozen snapshot would keep rendering the removed attachment as if the
+ // action had no effect (#1602). Fall back to the snapshot while the ledger
+ // catches up so the flow doesn't flash empty mid-reload.
+ const [editingRowSource, setEditingRowSource] = createSignal<InfrastructureSystemRow | null>(
+ null,
+ );
+ const editingRow = createMemo<InfrastructureSystemRow | null>(() => {
+ const source = editingRowSource();
+ if (!source) return null;
+ return ledger.rows().find((row) => row.id === source.id) ?? source;
+ });
const [showDiscoverySettings, setShowDiscoverySettings] = createSignal(false);
const [selectedDiscoveredSource, setSelectedDiscoveredSource] =
createSignal<DiscoveredServer | null>(null);
@@ -273,7 +285,7 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
rowActions.cancelRemove(attached.id);
}
resetInlineEditorState();
- setEditingRow(null);
+ setEditingRowSource(null);
};
const handleAddSaved = () => {
@@ -911,7 +923,7 @@ const InfrastructureWorkspaceContent: Component<InfrastructureWorkspaceProps> =
}
}
onOpenDiscoverySettings={readOnly() ? undefined : () => setShowDiscoverySettings(true)}
- onOpenConnection={readOnly() ? undefined : (row) => setEditingRow(row)}
+ onOpenConnection={readOnly() ? undefined : (row) => setEditingRowSource(row)}
onOpenAgentDoctor={
readOnly()
? undefined
diff --git a/frontend-modern/src/components/Settings/useTrueNASSettingsPanelState.ts b/frontend-modern/src/components/Settings/useTrueNASSettingsPanelState.ts
index c59c8c0dda..2d15e76596 100644
--- a/frontend-modern/src/components/Settings/useTrueNASSettingsPanelState.ts
+++ b/frontend-modern/src/components/Settings/useTrueNASSettingsPanelState.ts
@@ -125,6 +125,14 @@ const getErrorMessage = (error: unknown, fallback: string): string => {
return fallback;
};
+// Connection tests fail with a generic top-level message ("Failed to connect
+// to TrueNAS") while the actionable cause — e.g. the exact x509 verification
+// error — rides in details.error. Prefer it so users can tell an untrusted CA
+// from a hostname mismatch instead of reaching for Skip TLS Verification
+// (#1602). Mirrors getVMwareErrorMessage.
+const getTrueNASErrorMessage = (error: unknown, fallback: string): string =>
+ apiErrorDetailField(error, 'error') ?? getErrorMessage(error, fallback);
+
const monitoredSystemImpactPreviewUnavailableStateFromError = (error: unknown) => {
return buildMonitoredSystemImpactPreviewUnavailableState({
code: apiErrorCode(error),
@@ -294,7 +302,7 @@ export function useTrueNASSettingsPanelState() {
notificationStore.success('TrueNAS connection successful');
return true;
} catch (error) {
- const message = getErrorMessage(error, 'TrueNAS connection failed');
+ const message = getTrueNASErrorMessage(error, 'TrueNAS connection failed');
notificationStore.error(message);
logger.error('[TrueNAS Settings] Connection test failed', error);
return false;
@@ -311,7 +319,7 @@ export function useTrueNASSettingsPanelState() {
`TrueNAS connection successful for ${connection.name || connection.host}`,
);
} catch (error) {
- const message = getErrorMessage(error, 'TrueNAS connection failed');
+ const message = getTrueNASErrorMessage(error, 'TrueNAS connection failed');
notificationStore.error(message);
logger.error('[TrueNAS Settings] Saved connection test failed', error);
} finally {
@@ -342,7 +350,7 @@ export function useTrueNASSettingsPanelState() {
} else {
setMonitoredSystemPreviewUnavailableState(null);
setMonitoredSystemPreviewGenericError(
- getErrorMessage(error, 'Could not preview monitored-system impact'),
+ getTrueNASErrorMessage(error, 'Could not preview monitored-system impact'),
);
}
logger.error('[TrueNAS Settings] Preview failed', error);