@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.
- package/client/common/pre.js +38 -11
- package/client/components/bookmark-form/config/rdp.js +1 -0
- package/client/components/bookmark-form/config/vnc.js +5 -0
- package/client/components/common/remote-float-control.jsx +79 -0
- package/client/components/common/remote-float-control.styl +28 -0
- package/client/components/layout/layout.jsx +2 -1
- package/client/components/main/main.jsx +3 -6
- package/client/components/main/term-fullscreen.styl +1 -10
- package/client/components/rdp/rdp-session.jsx +131 -17
- package/client/components/rdp/resolutions.js +6 -0
- package/client/components/session/session.jsx +4 -3
- package/client/components/session/session.styl +18 -5
- package/client/components/session/sessions.jsx +2 -1
- package/client/components/shortcuts/shortcut-control.jsx +5 -3
- package/client/components/shortcuts/shortcut-handler.js +4 -2
- package/client/components/terminal/attach-addon-custom.js +13 -0
- package/client/components/terminal/event-emitter.js +27 -0
- package/client/components/terminal/terminal.jsx +10 -297
- package/client/components/terminal/zmodem-client.js +385 -0
- package/client/components/terminal-info/data-cols-parser.jsx +3 -2
- package/client/components/terminal-info/network.jsx +3 -2
- package/client/components/vnc/vnc-session.jsx +398 -62
- package/client/css/basic.styl +3 -0
- package/client/store/event.js +2 -2
- package/client/store/init-state.js +1 -1
- package/package.json +1 -1
- package/client/common/byte-format.js +0 -14
- package/client/components/main/term-fullscreen-control.jsx +0 -21
- 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
|
-
}
|