feat(remote): 实现文件上传真实进度显示

- 使用分块上传替代一次性上传
- 调用 /upload/start → /upload/chunk → /upload/merge 接口
- 通过 IPC 事件实时推送上传进度到前端
- 修复 merge 时未使用目标路径的问题
This commit is contained in:
2026-03-10 15:36:10 +08:00
parent 433db24688
commit de4c101b36
10 changed files with 142 additions and 42 deletions

View File

@@ -15,6 +15,7 @@ export interface ElectronAPI {
onRemoteClipboardSyncFromRemote: (callback: () => void) => () => void
onRemoteClipboardAutoSync: (callback: (text: string) => void) => () => void
onDownloadProgress: (callback: (data: { progress: number; id: string }) => void) => () => void
onUploadProgress: (callback: (data: { progress: number; id: string }) => void) => () => void
clipboardReadText: () => Promise<{ success: boolean; text?: string; error?: string }>
clipboardWriteText: (text: string) => Promise<{ success: boolean; error?: string }>
remoteFetchDrives: (serverHost: string, port: number, password?: string) => Promise<{
@@ -27,7 +28,7 @@ export interface ElectronAPI {
data?: Array<{ name: string; path: string; type: 'file' | 'dir'; size: number; modified?: string }>
error?: string
}>
remoteUploadFile: (serverHost: string, port: number, filePath: string, remotePath: string, password?: string) => Promise<{
remoteUploadFile: (id: string, serverHost: string, port: number, filePath: string, remotePath: string, password?: string) => Promise<{
success: boolean
error?: string
}>