mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-11-21 21:15:16 +00:00
* Refactor MobileSidebar to manage script and category selection based on current pathname. Introduced temporary state for non-scripts pages and updated logic for last viewed script handling. Improved accessibility by ensuring proper aria attributes and class management. * Update API endpoint paths in data.ts to include ProxmoxVE prefix for category and version fetching functions. * Refactor Navbar component layout for improved structure and responsiveness. Adjusted flex properties to ensure proper alignment of elements, enhancing the mobile and desktop user experience. Updated accessibility features and ensured consistent use of TailwindCSS classes.
19 lines
552 B
TypeScript
19 lines
552 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/versions`);
|
|
if (!response.ok) {
|
|
throw new Error(`Failed to fetch versions: ${response.statusText}`);
|
|
}
|
|
return response.json();
|
|
}
|