@electerm/electerm-react 2.7.8 → 2.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/client/common/pre.js +38 -11
  2. package/client/components/bookmark-form/config/rdp.js +1 -0
  3. package/client/components/bookmark-form/config/vnc.js +5 -0
  4. package/client/components/common/remote-float-control.jsx +79 -0
  5. package/client/components/common/remote-float-control.styl +28 -0
  6. package/client/components/layout/layout.jsx +2 -1
  7. package/client/components/main/main.jsx +3 -6
  8. package/client/components/main/term-fullscreen.styl +1 -10
  9. package/client/components/rdp/rdp-session.jsx +131 -17
  10. package/client/components/rdp/resolutions.js +6 -0
  11. package/client/components/session/session.jsx +4 -3
  12. package/client/components/session/session.styl +18 -5
  13. package/client/components/session/sessions.jsx +2 -1
  14. package/client/components/shortcuts/shortcut-control.jsx +5 -3
  15. package/client/components/shortcuts/shortcut-handler.js +4 -2
  16. package/client/components/terminal/attach-addon-custom.js +13 -0
  17. package/client/components/terminal/event-emitter.js +27 -0
  18. package/client/components/terminal/terminal.jsx +10 -297
  19. package/client/components/terminal/zmodem-client.js +385 -0
  20. package/client/components/terminal-info/data-cols-parser.jsx +3 -2
  21. package/client/components/terminal-info/network.jsx +3 -2
  22. package/client/components/vnc/vnc-session.jsx +398 -62
  23. package/client/css/basic.styl +3 -0
  24. package/client/store/event.js +2 -2
  25. package/client/store/init-state.js +1 -1
  26. package/package.json +1 -1
  27. package/client/common/byte-format.js +0 -14
  28. package/client/components/main/term-fullscreen-control.jsx +0 -21
  29. package/client/components/terminal/xterm-zmodem.js +0 -55
@@ -1,55 +0,0 @@
1
- // import zmodem from 'zmodem-ts/dist/zmodem.mjs'
2
- import Sentry from 'zmodem-ts/dist/zsentry.js'
3
- export class AddonZmodem {
4
- _disposables = []
5
-
6
- activate (terminal) {
7
- terminal.zmodemAttach = this.zmodemAttach
8
- }
9
-
10
- sendWebSocket = (octets) => {
11
- const { socket } = this
12
- if (socket && socket.readyState === WebSocket.OPEN) {
13
- return socket.send(new Uint8Array(octets))
14
- } else {
15
- console.error('WebSocket is not open')
16
- }
17
- }
18
-
19
- zmodemAttach = (ctx) => {
20
- this.socket = ctx.socket
21
- this.term = ctx.term
22
- this.ctx = ctx
23
- this.zsentry = new Sentry({
24
- to_terminal: (octets) => {
25
- if (ctx.onZmodem) {
26
- this.term.write(String.fromCharCode.apply(String, octets))
27
- }
28
- },
29
- sender: this.sendWebSocket,
30
- on_retract: ctx.onzmodemRetract,
31
- on_detect: ctx.onZmodemDetect
32
- })
33
- this.socket.binaryType = 'arraybuffer'
34
- this.socket.addEventListener('message', this.handleWSMessage)
35
- }
36
-
37
- handleWSMessage = (evt) => {
38
- if (typeof evt.data === 'string') {
39
- if (this.ctx.onZmodem) {
40
- this.term.write(evt.data)
41
- }
42
- } else {
43
- this.zsentry.consume(evt.data)
44
- }
45
- }
46
-
47
- dispose = () => {
48
- this.socket && this.socket.removeEventListener('message', this.handleWSMessage)
49
- this._disposables.forEach(d => d.dispose())
50
- this._disposables.length = 0
51
- this.term = null
52
- this.zsentry = null
53
- this.socket = null
54
- }
55
- }