Files
temetro/frontend/lib/version.ts
T
Khalid Abdi 403e0e38e9 frontend: runtime backend URL (LAN), voice dictation, version + update UI
Resolve the backend URL from the current host at runtime (lib/backend-url.ts)
so one build works on localhost and any clinic LAN IP without a rebuild; used
by the API client, auth client, and socket. Wire the AI-chat mic to the Web
Speech API with graceful fallback. Add a Settings "About & updates" panel
(current/latest version, update command, shareable network address) and an
optional dismissible update banner.

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

24 lines
562 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(): Promise<VersionInfo> {
return apiFetch<VersionInfo>("/api/version");
}
export function getNetworkInfo(): Promise<NetworkInfo> {
return apiFetch<NetworkInfo>("/api/network");
}