feat(FN-2663): add cached update-check setting, APIs, and banner
- Add global updateCheckEnabled setting to core schema/types and wire dashboard command to cache update checks in the CLI - Implement dashboard server update-check cache module plus REST routes for status and refresh behavior - Add dashboard client hook, legacy API helpers, and UpdateAvailableBanner UI to show cached CLI update notices - Cover update-check server routes, hook behavior, banner rendering, and route registration with focused tests - Document update-check configuration and API behavior in architecture and settings reference docs
This commit is contained in:
@@ -410,6 +410,25 @@ export function updateSettings(settings: Partial<Settings>, projectId?: string):
|
||||
});
|
||||
}
|
||||
|
||||
export interface UpdateCheckResponse {
|
||||
currentVersion?: string;
|
||||
latestVersion?: string | null;
|
||||
updateAvailable: boolean;
|
||||
lastChecked?: number;
|
||||
disabled?: boolean;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export function checkForUpdate(projectId?: string): Promise<UpdateCheckResponse> {
|
||||
return api<UpdateCheckResponse>(withProjectId("/update-check", projectId));
|
||||
}
|
||||
|
||||
export function refreshUpdateCheck(projectId?: string): Promise<UpdateCheckResponse> {
|
||||
return api<UpdateCheckResponse>(withProjectId("/update-check/refresh", projectId), {
|
||||
method: "POST",
|
||||
});
|
||||
}
|
||||
|
||||
export interface RemoteSettings {
|
||||
remoteActiveProvider: "tailscale" | "cloudflare" | null;
|
||||
remoteTailscaleEnabled: boolean;
|
||||
|
||||
Reference in New Issue
Block a user