mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
feat(web): display backend version info in sidebar (#2087)
* feat(web): display backend version info in sidebar * fix(web): improve version parsing and timeout behavior * refactor(web): remove useless --version fallback * feat(web): implement version info caching and improve retrieval logic * fix(web): clarify version timeout rationale * fix(web): harden gateway version probing and tests * style(web): split regexp to two lines for lint
This commit is contained in:
@@ -13,6 +13,13 @@ export interface LauncherConfig {
|
||||
allowed_cidrs: string[]
|
||||
}
|
||||
|
||||
export interface SystemVersionInfo {
|
||||
version: string
|
||||
git_commit?: string
|
||||
build_time?: string
|
||||
go_version: string
|
||||
}
|
||||
|
||||
async function request<T>(path: string, options?: RequestInit): Promise<T> {
|
||||
const res = await launcherFetch(path, options)
|
||||
if (!res.ok) {
|
||||
@@ -62,3 +69,7 @@ export async function setLauncherConfig(
|
||||
body: JSON.stringify(payload),
|
||||
})
|
||||
}
|
||||
|
||||
export async function getSystemVersionInfo(): Promise<SystemVersionInfo> {
|
||||
return request<SystemVersionInfo>("/api/system/version")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user