feat(remote): 下载改成本地面板选择目录

This commit is contained in:
2026-03-10 02:10:21 +08:00
parent 073abafdfd
commit 8839ec244a
10 changed files with 41 additions and 31 deletions

View File

@@ -8,6 +8,7 @@ interface LocalFilePanelProps {
selectedFile: FileItem | null
onSelect: (file: FileItem | null) => void
onUpload: () => void
onPathChange?: (path: string) => void
disabled?: boolean
}
@@ -15,6 +16,7 @@ export const LocalFilePanel: React.FC<LocalFilePanelProps> = ({
selectedFile,
onSelect,
onUpload,
onPathChange,
disabled,
}) => {
const [currentPath, setCurrentPath] = useState('')
@@ -50,6 +52,7 @@ export const LocalFilePanel: React.FC<LocalFilePanelProps> = ({
useEffect(() => {
if (isAtDrives) {
loadDrives()
onPathChange?.('')
} else {
loadFiles(currentPath)
}
@@ -64,6 +67,9 @@ export const LocalFilePanel: React.FC<LocalFilePanelProps> = ({
setCurrentPath(prevPath)
if (prevPath === '') {
setIsAtDrives(true)
onPathChange?.('')
} else {
onPathChange?.(prevPath)
}
onSelect(null)
}
@@ -74,6 +80,7 @@ export const LocalFilePanel: React.FC<LocalFilePanelProps> = ({
setPathHistory([...pathHistory, file.path])
setCurrentPath(file.path)
onSelect(null)
onPathChange?.(file.path)
}
const handleRefresh = () => {