Files
Khalid Abdi 2bb03633ff backend: detect updates from Docker Hub + add a Check for updates button
GET /api/version now reads the latest version from Docker Hub image tags (the
actual update channel clinics pull), falling back to the GitHub release if
Docker Hub is unreachable, with a shorter 1h cache and a `?refresh=1` bypass.
Settings → About & updates gains a "Check for updates" button that forces a
fresh, cache-bypassing lookup.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 21:00:18 +03:00

24 lines
603 B
TypeScript

// Client helpers for the backend's version + network endpoints (both public).
import { apiFetch } from "@/lib/api-client";
export type VersionInfo = {
current: string;
latest: string | null;
updateAvailable: boolean;
releaseUrl: string | null;
};
export type NetworkInfo = {
port: number;
addresses: string[];
urls: string[];
};
export function getVersionInfo(force = false): Promise<VersionInfo> {
return apiFetch<VersionInfo>(`/api/version${force ? "?refresh=1" : ""}`);
}
export function getNetworkInfo(): Promise<NetworkInfo> {
return apiFetch<NetworkInfo>("/api/network");
}