feat: add hierarchical folder browser for library creation
- Extend API /folders endpoint to support browsing subdirectories with path parameter - Add depth and has_children fields to FolderItem - Create FolderBrowser component with tree view navigation - Create FolderPicker component with input, browse button and popup modal - Add API proxy route for /api/folders - Update LibraryForm to use new FolderPicker component - Fix path handling to correctly resolve /libraries/ subdirectories
This commit is contained in:
@@ -41,6 +41,8 @@ export type TokenDto = {
|
||||
export type FolderItem = {
|
||||
name: string;
|
||||
path: string;
|
||||
depth: number;
|
||||
has_children: boolean;
|
||||
};
|
||||
|
||||
export type BookDto = {
|
||||
@@ -177,8 +179,9 @@ export async function cancelJob(id: string) {
|
||||
return apiFetch<IndexJobDto>(`/index/cancel/${id}`, { method: "POST" });
|
||||
}
|
||||
|
||||
export async function listFolders() {
|
||||
return apiFetch<FolderItem[]>("/folders");
|
||||
export async function listFolders(path?: string) {
|
||||
const url = path ? `/folders?path=${encodeURIComponent(path)}` : "/folders";
|
||||
return apiFetch<FolderItem[]>(url);
|
||||
}
|
||||
|
||||
export async function listTokens() {
|
||||
|
||||
Reference in New Issue
Block a user