feat(remote): 实现文件上传真实进度显示
- 使用分块上传替代一次性上传 - 调用 /upload/start → /upload/chunk → /upload/merge 接口 - 通过 IPC 事件实时推送上传进度到前端 - 修复 merge 时未使用目标路径的问题
This commit is contained in:
3
src/types/electron.d.ts
vendored
3
src/types/electron.d.ts
vendored
@@ -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
|
||||
}>
|
||||
|
||||
Reference in New Issue
Block a user