Implement ZMODEM drag-and-drop file upload support in terminal

- Remove outdated SFTP upload message and replace it with ZMODEM-specific messages in English, Russian, and Chinese locales.
- Add a new function to handle ZMODEM drag-and-drop uploads in the terminal backend.
- Update terminal components to support ZMODEM drag-and-drop functionality.
- Enhance error handling for file uploads and provide user feedback for no files to upload.
- Introduce tests to verify ZMODEM upload behavior and fallback to SFTP for network devices.
This commit is contained in:
shideqin
2026-06-12 14:12:34 +08:00
parent ea24841939
commit f16429e30f
14 changed files with 338 additions and 21 deletions

View File

@@ -229,6 +229,16 @@ declare global {
}) => void
): () => void;
cancelZmodem?(sessionId: string): void;
startZmodemDragDropUpload?(
sessionId: string,
files: Array<{
path?: string;
name: string;
remoteName: string;
data?: ArrayBuffer;
}>,
uploadCommand?: string,
): Promise<{ success: boolean; error?: string }>;
onZmodemOverwriteRequest?(
sessionId: string,
cb: (payload: { sessionId: string; requestId: string; filename: string }) => void