Files
ProxmoxVE/frontend/src/lib/data.ts
CanbiZ (MickLesk) c7669c39c3 Frontend: use github-versions.json for version display (#11281)
* fix(frontend): use github-versions.json for version display

- Update AppVersion type to match new format with slug field
- Switch from versions.json to github-versions.json API
- Simplify version matching by direct slug comparison
- Remove 'Loading versions...' text - show nothing if no version found

* feat(frontend): show tooltip for pinned versions

* fix(api): add github-versions endpoint and fix legacy versions route
2026-01-28 14:29:26 +01:00

19 lines
559 B
TypeScript

import type { Category } from "./types";
export async function fetchCategories() {
const response = await fetch(`/ProxmoxVE/api/categories`);
if (!response.ok) {
throw new Error(`Failed to fetch categories: ${response.statusText}`);
}
const categories: Category[] = await response.json();
return categories;
}
export async function fetchVersions() {
const response = await fetch(`/ProxmoxVE/api/github-versions`);
if (!response.ok) {
throw new Error(`Failed to fetch versions: ${response.statusText}`);
}
return response.json();
}