mirror of
https://github.com/temetro/temetro.git
synced 2026-07-26 11:58:14 +00:00
2bb03633ff
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>
24 lines
603 B
TypeScript
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");
|
|
}
|