diff options
Diffstat (limited to 'frontend/components')
| -rw-r--r-- | frontend/components/drive/DriveDirectoryClient.tsx (renamed from frontend/components/v2/V2DirectoryClient.tsx) | 12 | ||||
| -rw-r--r-- | frontend/components/drive/DriveDirectoryView.tsx (renamed from frontend/components/v2/V2DirectoryView.tsx) | 14 | ||||
| -rw-r--r-- | frontend/components/drive/DriveMoveDialog.tsx (renamed from frontend/components/v2/V2MoveDialog.tsx) | 4 |
3 files changed, 15 insertions, 15 deletions
diff --git a/frontend/components/v2/V2DirectoryClient.tsx b/frontend/components/drive/DriveDirectoryClient.tsx index 0d9a63a..548773a 100644 --- a/frontend/components/v2/V2DirectoryClient.tsx +++ b/frontend/components/drive/DriveDirectoryClient.tsx | |||
| @@ -35,7 +35,7 @@ import { Checkbox } from "@/components/ui/checkbox" | |||
| 35 | import { toast } from "@/hooks/use-toast" | 35 | import { toast } from "@/hooks/use-toast" |
| 36 | import { DriveLsEntry } from "@/lib/drive_types" | 36 | import { DriveLsEntry } from "@/lib/drive_types" |
| 37 | import { UPLOAD_MAX_FILE_SIZE, UPLOAD_MAX_FILES } from "@/lib/constants" | 37 | import { UPLOAD_MAX_FILE_SIZE, UPLOAD_MAX_FILES } from "@/lib/constants" |
| 38 | import { V2MoveDialog } from "./V2MoveDialog" | 38 | import { DriveMoveDialog } from "./DriveMoveDialog" |
| 39 | 39 | ||
| 40 | function formatFileSize(bytes: number): string { | 40 | function formatFileSize(bytes: number): string { |
| 41 | if (bytes === 0) return "0 Bytes" | 41 | if (bytes === 0) return "0 Bytes" |
| @@ -66,13 +66,13 @@ interface Breadcrumb { | |||
| 66 | path: string | 66 | path: string |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | interface V2DirectoryClientProps { | 69 | interface DriveDirectoryClientProps { |
| 70 | path: string | 70 | path: string |
| 71 | files: DriveLsEntry[] | 71 | files: DriveLsEntry[] |
| 72 | breadcrumbs: Breadcrumb[] | 72 | breadcrumbs: Breadcrumb[] |
| 73 | } | 73 | } |
| 74 | 74 | ||
| 75 | export function V2DirectoryClient({ path, files, breadcrumbs }: V2DirectoryClientProps) { | 75 | export function DriveDirectoryClient({ path, files, breadcrumbs }: DriveDirectoryClientProps) { |
| 76 | const [selectedFiles, setSelectedFiles] = useState<Set<string>>(new Set()) | 76 | const [selectedFiles, setSelectedFiles] = useState<Set<string>>(new Set()) |
| 77 | const [renameDialogOpen, setRenameDialogOpen] = useState(false) | 77 | const [renameDialogOpen, setRenameDialogOpen] = useState(false) |
| 78 | const [infoDialogOpen, setInfoDialogOpen] = useState(false) | 78 | const [infoDialogOpen, setInfoDialogOpen] = useState(false) |
| @@ -287,7 +287,7 @@ export function V2DirectoryClient({ path, files, breadcrumbs }: V2DirectoryClien | |||
| 287 | <div className="flex items-center gap-4"> | 287 | <div className="flex items-center gap-4"> |
| 288 | <div className="flex items-center gap-2"> | 288 | <div className="flex items-center gap-2"> |
| 289 | <HardDrive className="h-6 w-6" /> | 289 | <HardDrive className="h-6 w-6" /> |
| 290 | <h1 className="text-2xl font-bold">Drive V2</h1> | 290 | <h1 className="text-2xl font-bold">Drive</h1> |
| 291 | </div> | 291 | </div> |
| 292 | 292 | ||
| 293 | {/* Breadcrumbs */} | 293 | {/* Breadcrumbs */} |
| @@ -421,7 +421,7 @@ export function V2DirectoryClient({ path, files, breadcrumbs }: V2DirectoryClien | |||
| 421 | <> | 421 | <> |
| 422 | <Folder className="h-4 w-4 text-blue-500" /> | 422 | <Folder className="h-4 w-4 text-blue-500" /> |
| 423 | <Link | 423 | <Link |
| 424 | href={`/v2${file.path}`} | 424 | href={`/drive${file.path}`} |
| 425 | className="text-blue-600 hover:text-blue-800 hover:underline cursor-pointer" | 425 | className="text-blue-600 hover:text-blue-800 hover:underline cursor-pointer" |
| 426 | > | 426 | > |
| 427 | {fileName} | 427 | {fileName} |
| @@ -572,7 +572,7 @@ export function V2DirectoryClient({ path, files, breadcrumbs }: V2DirectoryClien | |||
| 572 | </Dialog> | 572 | </Dialog> |
| 573 | 573 | ||
| 574 | {/* Move Dialog */} | 574 | {/* Move Dialog */} |
| 575 | <V2MoveDialog | 575 | <DriveMoveDialog |
| 576 | open={moveDialogOpen} | 576 | open={moveDialogOpen} |
| 577 | onOpenChange={setMoveDialogOpen} | 577 | onOpenChange={setMoveDialogOpen} |
| 578 | selectedCount={selectedFiles.size} | 578 | selectedCount={selectedFiles.size} |
diff --git a/frontend/components/v2/V2DirectoryView.tsx b/frontend/components/drive/DriveDirectoryView.tsx index 97fa9a8..20ed9d8 100644 --- a/frontend/components/v2/V2DirectoryView.tsx +++ b/frontend/components/drive/DriveDirectoryView.tsx | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | import { DriveLsEntry } from "@/lib/drive_types" | 1 | import { DriveLsEntry } from "@/lib/drive_types" |
| 2 | import { V2DirectoryClient } from "./V2DirectoryClient" | 2 | import { DriveDirectoryClient } from "./DriveDirectoryClient" |
| 3 | 3 | ||
| 4 | interface V2DirectoryViewProps { | 4 | interface DriveDirectoryViewProps { |
| 5 | path: string | 5 | path: string |
| 6 | files: DriveLsEntry[] | 6 | files: DriveLsEntry[] |
| 7 | } | 7 | } |
| @@ -9,18 +9,18 @@ interface V2DirectoryViewProps { | |||
| 9 | // Generate breadcrumbs from path | 9 | // Generate breadcrumbs from path |
| 10 | function generateBreadcrumbs(currentPath: string) { | 10 | function generateBreadcrumbs(currentPath: string) { |
| 11 | if (currentPath === '/') { | 11 | if (currentPath === '/') { |
| 12 | return [{ name: 'Root', path: '/v2' }] | 12 | return [{ name: 'Root', path: '/drive' }] |
| 13 | } | 13 | } |
| 14 | 14 | ||
| 15 | const parts = currentPath.split('/').filter(Boolean) | 15 | const parts = currentPath.split('/').filter(Boolean) |
| 16 | const breadcrumbs = [{ name: 'Root', path: '/v2' }] | 16 | const breadcrumbs = [{ name: 'Root', path: '/drive' }] |
| 17 | 17 | ||
| 18 | let accumulatedPath = '' | 18 | let accumulatedPath = '' |
| 19 | parts.forEach((part, index) => { | 19 | parts.forEach((part, index) => { |
| 20 | accumulatedPath += '/' + part | 20 | accumulatedPath += '/' + part |
| 21 | breadcrumbs.push({ | 21 | breadcrumbs.push({ |
| 22 | name: decodeURIComponent(part), // Decode URL encoded characters | 22 | name: decodeURIComponent(part), // Decode URL encoded characters |
| 23 | path: '/v2' + accumulatedPath | 23 | path: '/drive' + accumulatedPath |
| 24 | }) | 24 | }) |
| 25 | }) | 25 | }) |
| 26 | 26 | ||
| @@ -41,12 +41,12 @@ function sortFiles(files: DriveLsEntry[]): DriveLsEntry[] { | |||
| 41 | }); | 41 | }); |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | export function V2DirectoryView({ path, files }: V2DirectoryViewProps) { | 44 | export function DriveDirectoryView({ path, files }: DriveDirectoryViewProps) { |
| 45 | const sortedFiles = sortFiles(files) | 45 | const sortedFiles = sortFiles(files) |
| 46 | const breadcrumbs = generateBreadcrumbs(path) | 46 | const breadcrumbs = generateBreadcrumbs(path) |
| 47 | 47 | ||
| 48 | return ( | 48 | return ( |
| 49 | <V2DirectoryClient | 49 | <DriveDirectoryClient |
| 50 | path={path} | 50 | path={path} |
| 51 | files={sortedFiles} | 51 | files={sortedFiles} |
| 52 | breadcrumbs={breadcrumbs} | 52 | breadcrumbs={breadcrumbs} |
diff --git a/frontend/components/v2/V2MoveDialog.tsx b/frontend/components/drive/DriveMoveDialog.tsx index 7cedde0..d00f860 100644 --- a/frontend/components/v2/V2MoveDialog.tsx +++ b/frontend/components/drive/DriveMoveDialog.tsx | |||
| @@ -9,14 +9,14 @@ import { ScrollArea } from "@/components/ui/scroll-area" | |||
| 9 | import { toast } from "@/hooks/use-toast" | 9 | import { toast } from "@/hooks/use-toast" |
| 10 | import { DriveLsEntry } from "@/lib/drive_types" | 10 | import { DriveLsEntry } from "@/lib/drive_types" |
| 11 | 11 | ||
| 12 | interface V2MoveDialogProps { | 12 | interface DriveMoveDialogProps { |
| 13 | open: boolean | 13 | open: boolean |
| 14 | onOpenChange: (open: boolean) => void | 14 | onOpenChange: (open: boolean) => void |
| 15 | selectedCount: number | 15 | selectedCount: number |
| 16 | onMove: (destinationPath: string) => void | 16 | onMove: (destinationPath: string) => void |
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | export function V2MoveDialog({ open, onOpenChange, selectedCount, onMove }: V2MoveDialogProps) { | 19 | export function DriveMoveDialog({ open, onOpenChange, selectedCount, onMove }: DriveMoveDialogProps) { |
| 20 | const [directories, setDirectories] = useState<DriveLsEntry[]>([]) | 20 | const [directories, setDirectories] = useState<DriveLsEntry[]>([]) |
| 21 | const [filteredDirectories, setFilteredDirectories] = useState<DriveLsEntry[]>([]) | 21 | const [filteredDirectories, setFilteredDirectories] = useState<DriveLsEntry[]>([]) |
| 22 | const [searchQuery, setSearchQuery] = useState("") | 22 | const [searchQuery, setSearchQuery] = useState("") |
