Closed wenbingzhang closed 2 years ago
Not yet. trzsz.js
will support the feature.
It should be an api of TrzszFilter
and TrzszAddon
. I may name it uploadFiles
.
The client of trzsz.js
can listen on the drag event, and call trzsz.js
api to upload the dragging files.
See also: https://www.geeksforgeeks.org/drag-and-drop-files-in-electronjs/
https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/File_drag_and_drop
I'm looking forward to this feature being developed
v0.4.0
supports dragging files and directories to upload.
Drag and drop uploads work fine, the display is just a little unfriendly.
I've try to hide the trz
. Sounds like it's not working.
Could you try to figure out why?
What's the type of the server output? Blob, or Uint8Array, or ArrayBuffer?
https://github.com/trzsz/trzsz.js/blob/7f43fe43f63a8271ec36107765e50426b555d583/src/filter.ts#L233
Although the complete command is sent here, "processServerOutput" may receive split characters.
Maybe. Could you print some log in here?
Figure out the server output, then we can skip it.
I've tested it many times. Sometimes it's a different result.
Is it Uint8Array? It may has some characters unprintable. Could you print the char codes too?
I've tested it many times. Sometimes it's a different result.
Collect all the cases, we can do it. We need to print each ascii code.
https://github.com/trzsz/trzsz.js/blob/7f43fe43f63a8271ec36107765e50426b555d583/src/filter.ts#L130-L139 If no breakpoint is set, the returned data is the same, but after setting a breakpoint, the automatic upload will be disabled and a file selection dialog will be prompted.
Could you print the printable log and char codes together? It would be easy to analyze. Thanks very much.
If no breakpoint is set, the returned data is the same, but after setting a breakpoint, the automatic upload will be disabled and a file selection dialog will be prompted.
The reason is: https://github.com/trzsz/trzsz.js/blob/7f43fe43f63a8271ec36107765e50426b555d583/src/filter.ts#L235-L245
I think "trz" can be displayed in "xterm", but it needs the correct line break.
I think "trz" can be displayed in "xterm", but it needs the correct line break.
But we need to figure out the server output first. Could you print the printable log and ascii codes together?
Is that right?
That's it. Thanks. Looks like I have to learn more about vt100.
@wenbingzhang If just remove these code, What will it show?
It looks not bad.
Type some garbage into the command line without a carriage return, what will it show after dragging files to upload?
And If move the cursor to the middle of the garbage, what will it show after dragging files to upload?
All right. I want to keep the garbage unchanged.
Since it doesn't work in some environments ( e.g., yours ), I'm going to remove it.
Should be solved with v0.4.1
.
It has been updated and tested, and it works fine.
@wenbingzhang
Thanks for your feedback.
Does electron enable drag-and-drop uploads