Comments (27)
I may name the timeout option to dragInitTimeout
. And the ttyd may name it trzszDragInitTimeout
.
It might be two weeks before I release the next version of trzsz.js
.
from trzsz.js.
We have to build and release trzsz.js
first ( and only one time ), then the timeout is adjustable.
from trzsz.js.
Or just increase it a little bit?
What value do you want to set it to?
from trzsz.js.
Due local limitations, calling the trzsz binary may takes some time to execute.
Currently, If I drag n drop a file into terminal, the timeout can exceeded. If this happens, the trz binary is executed anyways and trzsz.js opens the file browser instead uploading the file.
In the same environment, if trz is executed fast enough (within 1 second), everything works fine.
While 1000ms is a good default, our enterprise environment may needs more.
Is it possible to use a global scope variable from JS point of view? It would be great if the timeout is adjustable without rebuilding trzsz.js. At the end, I'm trying to integrate ttyd which already embedded trzsz.js
from trzsz.js.
I'm ok to add an option in options.ts.
Should we change the default value to 2000, or 3000 ?
It shouldn't be multiple uploads within 3 seconds.
from trzsz.js.
Does an option in options.ts requires an rebuild of trzsz?
from trzsz.js.
Any change requires rebuilding.
from trzsz.js.
An using something like window['__trzsz_timeout'] is an option?
Thinking something like xterm.js which expose some options without rebuilding the software.
from trzsz.js.
Add window['__trzsz_timeout']
, or change the any other source code, we need to publish a new version of trzsz.js
.
from trzsz.js.
Is that a problem?
from trzsz.js.
Since we need to publish trzsz.js
anyway. Isn't adding an option in options.ts better then window['__trzsz_timeout']
?
from trzsz.js.
If the maintainers of https://github.com/tsl0922/ttyd doesn't agree with an higher default timeout, I may have to rebuild ttyd entirely from scratch which would be a big too much for my scope.
I agree, that using the window variable is silly in context of mondern web application. But what about a interface for runtime parameters instead build-time parameters?
Something like trzsz.setOption('timeout', 4000)
from trzsz.js.
Is it more convenient to set it in the console ( every time ) than to build ttyd
yourself ( once )?
If I set the default timeout to 3000, Is the API no longer needed?
from trzsz.js.
Is it more convenient to set it in the console ( every time ) than to build
ttyd
yourself ( once )?
From downstream end-user perspective yes. It may not need every time, but I guess the trzsz library will constructed somewhere in the code and the option is define once.
Rebuild the entire software stack to change single properties feels too much.
For xterm.js. If the option about the background color would be a build time, no one would really benefit from it.
If I set the default timeout to 3000, Is the API no longer needed?
Maybe, but I guess it would relax the problem on my side without known the side-effects in general here.
from trzsz.js.
In fact, there are no side effects. I just felt that 1 second was enough when writing it.
I think run trz -r
command is much convenient then change the timeout settings in console.
from trzsz.js.
I think run trz -r command is much convenient then change the timeout settings in console.
Not sure, if that helps. From my limited view, in this case it's more a client side timeout (trzsz.js) than the timeout on the console.
The time between request for upload (client) and accepting (on console) can take more then 1 seconds.
from trzsz.js.
Oh, I mean the F12 console in the browser. Not the server console.
from trzsz.js.
How do you set the window['__trzsz_timeout']
on client? Do you need to press F12 to open the console in the browser? I don't think it's more convenience then type trz
command, and choose files from dialog. which isn't drag and drop files to upload, and there is no timeout for trz
command.
from trzsz.js.
How do you set the window['__trzsz_timeout'] on client?
I will never do this.
ttys has a concept of client-options. It's a json file that get downloaded on initial session and the client javascript of ttyd should define this on session start, get getting the value from json and set the value on the given library. That how ttyd is able the define options for xterm.js. I hope to integrate a similar way for trzsz.
from trzsz.js.
I see. Which option is defined by xterm but not by ttyd?
from trzsz.js.
ttyd
passes options to xterm. we can't do that without ttyd
's help.
from trzsz.js.
we can't do that without ttyd's help.
Sure, I expect this. Thats why I'm asking for an option lnterface like trzsz.setOption('timeout', 4000)
and after release of the new version of trzsz.js I have create an issue on ttyd to update and integrate the new capabilities.
from trzsz.js.
I if got it correctly. the client-option has to integrate here
Maybe as option/parameter for TrzszFilter
from trzsz.js.
The argument of new TrzszFilter
is options.ts.
from trzsz.js.
I guess we have an miscommunication here. Sorry.
The context of the questions
Does an option in options.ts requires an rebuild of trzsz?
had the background: After build and release trzsz, would be the timeout value adjustable without rebuilding trzsz.js?
The answer seems like "no" now.
from trzsz.js.
Thanks for the clarification! Add the timeout option to options.ts looks good to me, and after a release I will create an issue at ttyd.
from trzsz.js.
trzsz.js v1.1.4 released.
from trzsz.js.
Related Issues (11)
- [feature request] Support rz/sz HOT 1
- 不支持safari 14 版本 HOT 2
- chooseSaveDirectory is not a function HOT 3
- node12 is not supported? HOT 3
- try/catch is invalid HOT 5
- Does electron enable drag-and-drop uploads HOT 28
- Add trzsz support to ttyd HOT 1
- 大佬问个问题 The browser doesn't support the File System Access API HOT 40
- In browser mode, seems download(tsz) may not work HOT 26
- fs.exists deprecated, should use fs.stat() or fs.access() instead. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from trzsz.js.