feat(FN-1827): merge fusion/fn-1827

This commit is contained in:
gsxdsm
2026-04-16 09:08:06 -07:00
parent 563f169f3d
commit 30a178bb3f
11 changed files with 438 additions and 3 deletions

View File

@@ -118,6 +118,10 @@ export interface UseNodeSettingsSyncResult {
pullSettings: (nodeId: string) => Promise<NodeSettingsSyncResult>;
/** Sync auth credentials with a remote node */
syncAuth: (nodeId: string) => Promise<NodeAuthSyncResult>;
/** Get auth sync state for a specific node */
getAuthSyncState: (nodeId: string) => "match" | "differs" | "not-synced" | undefined;
/** Get per-provider auth match details for a specific node */
getAuthProviders: (nodeId: string) => Record<string, "match" | "differs"> | undefined;
}
const POLL_INTERVAL_MS = 30_000; // 30 seconds
@@ -352,6 +356,28 @@ export function useNodeSettingsSync(): UseNodeSettingsSyncResult {
}
}, []);
/**
* Get auth sync state for a specific node.
*/
const getAuthSyncState = useCallback(
(nodeId: string): "match" | "differs" | "not-synced" | undefined => {
const status = syncStatusMap[nodeId];
return status?.authMatch;
},
[syncStatusMap],
);
/**
* Get per-provider auth match details for a specific node.
*/
const getAuthProviders = useCallback(
(nodeId: string): Record<string, "match" | "differs"> | undefined => {
const status = syncStatusMap[nodeId];
return status?.authDiff;
},
[syncStatusMap],
);
return {
syncStatusMap,
loading,
@@ -363,5 +389,7 @@ export function useNodeSettingsSync(): UseNodeSettingsSyncResult {
pushSettings,
pullSettings,
syncAuth,
getAuthSyncState,
getAuthProviders,
};
}