list warrens + explore nested folders

This commit is contained in:
2025-07-12 06:39:43 +02:00
parent f9f55895ed
commit 4d0765c53b
38 changed files with 1877 additions and 93 deletions

5
frontend/utils/api.ts Normal file
View File

@@ -0,0 +1,5 @@
export function getApiUrl(path: string): string {
const API_BASE_URL = useRuntimeConfig().public.apiBase;
console.log(API_BASE_URL);
return `${API_BASE_URL}/${path}`;
}

View File

@@ -1,6 +1,8 @@
import type { BreadcrumbData } from '~/types';
export function getBreadcrumbs(path: string): BreadcrumbData[] {
const { warrens } = useWarrenStore();
const crumbs = path
.split('/')
.filter((v) => v.length > 0)
@@ -21,6 +23,14 @@ export function getBreadcrumbs(path: string): BreadcrumbData[] {
.join('/');
}
if (
crumbs.length >= 3 &&
crumbs[1].href === '/warrens' &&
crumbs[2].name in warrens
) {
crumbs[2].name = warrens[crumbs[2].name].name;
}
return crumbs;
}