diff options
| author | diogo464 <[email protected]> | 2025-08-12 16:28:33 +0100 |
|---|---|---|
| committer | diogo464 <[email protected]> | 2025-08-12 16:28:33 +0100 |
| commit | 70738d871decbcdec4f5535a7b6f57de26de7d2a (patch) | |
| tree | 6402994fefa3bed8c352e24d20b53cb59a75afa0 /frontend/app | |
| parent | 507d9ee9ae524edd4e39942b735d987aa5d48359 (diff) | |
Clean up old UI code and rename V2 to Drive
- Remove old UI components: file-drive.tsx, history-view.tsx
- Remove unused API endpoints: /api/tree, /api/log, /api/fs/route.ts
- Rename /v2 routes to /drive routes for cleaner URLs
- Rename V2* components to Drive* components (V2DirectoryView -> DriveDirectoryView, etc.)
- Update all breadcrumb and navigation references from /v2 to /drive
- Redirect root path to /drive instead of old UI
- Keep /api/fs/[...path] and /api/directories for uploads and move functionality
- Preserve Drive_* server functions for potential future use
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
Diffstat (limited to 'frontend/app')
| -rw-r--r-- | frontend/app/api/fs/route.ts | 19 | ||||
| -rw-r--r-- | frontend/app/api/log/route.ts | 13 | ||||
| -rw-r--r-- | frontend/app/api/tree/route.ts | 13 | ||||
| -rw-r--r-- | frontend/app/drive/[...path]/page.tsx (renamed from frontend/app/v2/[...path]/page.tsx) | 6 | ||||
| -rw-r--r-- | frontend/app/drive/page.tsx | 7 | ||||
| -rw-r--r-- | frontend/app/page.tsx | 4 | ||||
| -rw-r--r-- | frontend/app/v2/page.tsx | 7 |
7 files changed, 12 insertions, 57 deletions
diff --git a/frontend/app/api/fs/route.ts b/frontend/app/api/fs/route.ts deleted file mode 100644 index 61d0f8a..0000000 --- a/frontend/app/api/fs/route.ts +++ /dev/null | |||
| @@ -1,19 +0,0 @@ | |||
| 1 | import { NextResponse } from 'next/server' | ||
| 2 | import { Drive_ls } from '@/lib/drive_server' | ||
| 3 | |||
| 4 | // GET /api/fs - Get root directory listing | ||
| 5 | export async function GET() { | ||
| 6 | try { | ||
| 7 | // Get root directory listing using Drive_ls (non-recursive) | ||
| 8 | const entries = await Drive_ls('/', false) | ||
| 9 | |||
| 10 | return NextResponse.json(entries) | ||
| 11 | |||
| 12 | } catch (error) { | ||
| 13 | console.error('GET fs root error:', error) | ||
| 14 | return NextResponse.json( | ||
| 15 | { error: error instanceof Error ? error.message : 'Internal server error' }, | ||
| 16 | { status: 500 } | ||
| 17 | ) | ||
| 18 | } | ||
| 19 | } \ No newline at end of file | ||
diff --git a/frontend/app/api/log/route.ts b/frontend/app/api/log/route.ts deleted file mode 100644 index a316ce7..0000000 --- a/frontend/app/api/log/route.ts +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | import { NextResponse } from 'next/server' | ||
| 2 | import { Drive_log } from '@/lib/drive_server' | ||
| 3 | |||
| 4 | export async function GET() { | ||
| 5 | try { | ||
| 6 | const logEntries = await Drive_log() | ||
| 7 | |||
| 8 | return NextResponse.json(logEntries) | ||
| 9 | } catch (error) { | ||
| 10 | console.error('Error getting log entries:', error) | ||
| 11 | throw error | ||
| 12 | } | ||
| 13 | } \ No newline at end of file | ||
diff --git a/frontend/app/api/tree/route.ts b/frontend/app/api/tree/route.ts deleted file mode 100644 index ece8122..0000000 --- a/frontend/app/api/tree/route.ts +++ /dev/null | |||
| @@ -1,13 +0,0 @@ | |||
| 1 | import { NextResponse } from 'next/server' | ||
| 2 | import { Drive_tree } from '@/lib/drive_server' | ||
| 3 | |||
| 4 | export async function GET() { | ||
| 5 | try { | ||
| 6 | const treeResponse = await Drive_tree() | ||
| 7 | |||
| 8 | return NextResponse.json(treeResponse) | ||
| 9 | } catch (error) { | ||
| 10 | console.error('Error building tree:', error) | ||
| 11 | throw error | ||
| 12 | } | ||
| 13 | } \ No newline at end of file | ||
diff --git a/frontend/app/v2/[...path]/page.tsx b/frontend/app/drive/[...path]/page.tsx index 3b4cbb8..b0c6d7d 100644 --- a/frontend/app/v2/[...path]/page.tsx +++ b/frontend/app/drive/[...path]/page.tsx | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | import { V2DirectoryView } from "@/components/v2/V2DirectoryView" | 1 | import { DriveDirectoryView } from "@/components/drive/DriveDirectoryView" |
| 2 | import { Drive_ls } from "@/lib/drive_server" | 2 | import { Drive_ls } from "@/lib/drive_server" |
| 3 | 3 | ||
| 4 | export default async function V2DirectoryPage({ | 4 | export default async function DriveDirectoryPage({ |
| 5 | params, | 5 | params, |
| 6 | }: { | 6 | }: { |
| 7 | params: Promise<{ path: string[] }> | 7 | params: Promise<{ path: string[] }> |
| @@ -10,5 +10,5 @@ export default async function V2DirectoryPage({ | |||
| 10 | const currentPath = '/' + (pathSegments?.join('/') || '') | 10 | const currentPath = '/' + (pathSegments?.join('/') || '') |
| 11 | 11 | ||
| 12 | const files = await Drive_ls(currentPath, false) | 12 | const files = await Drive_ls(currentPath, false) |
| 13 | return <V2DirectoryView path={currentPath} files={files} /> | 13 | return <DriveDirectoryView path={currentPath} files={files} /> |
| 14 | } \ No newline at end of file | 14 | } \ No newline at end of file |
diff --git a/frontend/app/drive/page.tsx b/frontend/app/drive/page.tsx new file mode 100644 index 0000000..0e3fd0c --- /dev/null +++ b/frontend/app/drive/page.tsx | |||
| @@ -0,0 +1,7 @@ | |||
| 1 | import { DriveDirectoryView } from "@/components/drive/DriveDirectoryView" | ||
| 2 | import { Drive_ls } from "@/lib/drive_server" | ||
| 3 | |||
| 4 | export default async function DriveRootPage() { | ||
| 5 | const files = await Drive_ls("/", false) | ||
| 6 | return <DriveDirectoryView path="/" files={files} /> | ||
| 7 | } \ No newline at end of file | ||
diff --git a/frontend/app/page.tsx b/frontend/app/page.tsx index e2b6a80..e1c6eed 100644 --- a/frontend/app/page.tsx +++ b/frontend/app/page.tsx | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | import FileDrive from "../file-drive" | 1 | import { redirect } from 'next/navigation' |
| 2 | 2 | ||
| 3 | export default function Page() { | 3 | export default function Page() { |
| 4 | return <FileDrive /> | 4 | redirect('/drive') |
| 5 | } | 5 | } |
diff --git a/frontend/app/v2/page.tsx b/frontend/app/v2/page.tsx deleted file mode 100644 index 09418a2..0000000 --- a/frontend/app/v2/page.tsx +++ /dev/null | |||
| @@ -1,7 +0,0 @@ | |||
| 1 | import { V2DirectoryView } from "@/components/v2/V2DirectoryView" | ||
| 2 | import { Drive_ls } from "@/lib/drive_server" | ||
| 3 | |||
| 4 | export default async function V2RootPage() { | ||
| 5 | const files = await Drive_ls("/", false) | ||
| 6 | return <V2DirectoryView path="/" files={files} /> | ||
| 7 | } \ No newline at end of file | ||
