Giter Club home page Giter Club logo

Comments (27)

lonnywong avatar lonnywong commented on May 28, 2024 2

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.

lonnywong avatar lonnywong commented on May 28, 2024 1

We have to build and release trzsz.js first ( and only one time ), then the timeout is adjustable.

from trzsz.js.

lonnywong avatar lonnywong commented on May 28, 2024

Or just increase it a little bit?
What value do you want to set it to?

from trzsz.js.

jkroepke avatar jkroepke commented on May 28, 2024

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.

lonnywong avatar lonnywong commented on May 28, 2024

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.

jkroepke avatar jkroepke commented on May 28, 2024

Does an option in options.ts requires an rebuild of trzsz?

from trzsz.js.

lonnywong avatar lonnywong commented on May 28, 2024

Any change requires rebuilding.

from trzsz.js.

jkroepke avatar jkroepke commented on May 28, 2024

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.

lonnywong avatar lonnywong commented on May 28, 2024

Add window['__trzsz_timeout'], or change the any other source code, we need to publish a new version of trzsz.js.

from trzsz.js.

jkroepke avatar jkroepke commented on May 28, 2024

Is that a problem?

from trzsz.js.

lonnywong avatar lonnywong commented on May 28, 2024

Since we need to publish trzsz.js anyway. Isn't adding an option in options.ts better then window['__trzsz_timeout']?

from trzsz.js.

jkroepke avatar jkroepke commented on May 28, 2024

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.

lonnywong avatar lonnywong commented on May 28, 2024

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.

jkroepke avatar jkroepke commented on May 28, 2024

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.

lonnywong avatar lonnywong commented on May 28, 2024

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.

jkroepke avatar jkroepke commented on May 28, 2024

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.

lonnywong avatar lonnywong commented on May 28, 2024

Oh, I mean the F12 console in the browser. Not the server console.

from trzsz.js.

lonnywong avatar lonnywong commented on May 28, 2024

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.

jkroepke avatar jkroepke commented on May 28, 2024

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.

lonnywong avatar lonnywong commented on May 28, 2024

I see. Which option is defined by xterm but not by ttyd?

from trzsz.js.

lonnywong avatar lonnywong commented on May 28, 2024

https://github.com/tsl0922/ttyd/blob/bf06c1449eae6e0d8da4dff12d7a91e4adc68fcb/html/src/components/terminal/xterm/index.ts#L384-L392

ttyd passes options to xterm. we can't do that without ttyd's help.

from trzsz.js.

jkroepke avatar jkroepke commented on May 28, 2024

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.

jkroepke avatar jkroepke commented on May 28, 2024

I if got it correctly. the client-option has to integrate here

https://github.com/tsl0922/ttyd/blob/bf06c1449eae6e0d8da4dff12d7a91e4adc68fcb/html/src/components/terminal/xterm/addons/zmodem.ts#L67C32-L78

Maybe as option/parameter for TrzszFilter

from trzsz.js.

lonnywong avatar lonnywong commented on May 28, 2024

The argument of new TrzszFilter is options.ts.

#13 (comment)

from trzsz.js.

jkroepke avatar jkroepke commented on May 28, 2024

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.

jkroepke avatar jkroepke commented on May 28, 2024

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.

lonnywong avatar lonnywong commented on May 28, 2024

trzsz.js v1.1.4 released.

from trzsz.js.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.