mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-02-04 04:13:26 +01:00
* 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
19 lines
559 B
TypeScript
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();
|
|
}
|