Closed fullee closed 2 years ago
It's running with Node.js environment. You need to implement the two functions.
const trzszFilter = new TrzszFilter({
// call on the user runs trz ( upload files ) on the server and no error on require('fs').
chooseSendFiles: async () => {
// return `undefined` if the user cancels.
// return an array of file paths choosed by the user.
return ["/path/to/file1", "/path/to/file2"];
},
// call on the user runs tsz ( download files ) on the server and no error on require('fs').
chooseSaveDirectory: async () => {
// return `undefined` if the user cancels.
// return a directory path choosed by the user.
return "/path/to/directory";
},
});
i used xterm.js join trzsz by TrzszAddon @lonnywong
i used xterm.js join trzsz by TrzszAddon
You can implement chooseSendFiles
and chooseSaveDirectory
too.
const trzszAddon = new TrzszAddon(webSocket, {
// call on the user runs trz ( upload files ) on the server and no error on require('fs').
chooseSendFiles: async () => {
// return `undefined` if the user cancels.
// return an array of file paths choosed by the user.
return ["/path/to/file1", "/path/to/file2"];
},
// call on the user runs tsz ( download files ) on the server and no error on require('fs').
chooseSaveDirectory: async () => {
// return `undefined` if the user cancels.
// return a directory path choosed by the user.
return "/path/to/directory";
},
});