@electerm/electerm-react 1.38.65 → 1.38.70

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 (35) hide show
  1. package/client/common/constants.js +3 -2
  2. package/client/common/create-title.jsx +9 -1
  3. package/client/common/sftp.js +3 -0
  4. package/client/components/batch-op/batch-op.jsx +1 -6
  5. package/client/components/bookmark-form/bookmark-form.styl +3 -1
  6. package/client/components/bookmark-form/render-ssh-tunnel.jsx +210 -88
  7. package/client/components/bookmark-form/ssh-form-ui.jsx +1 -1
  8. package/client/components/main/main.jsx +14 -0
  9. package/client/components/sftp/{confirm-modal.jsx → confirm-modal-store.jsx} +81 -50
  10. package/client/components/sftp/file-item.jsx +2 -0
  11. package/client/components/sftp/sftp-entry.jsx +27 -37
  12. package/client/components/sftp/transfer-conflict-store.jsx +291 -0
  13. package/client/components/sftp/transport-action-store.jsx +430 -0
  14. package/client/components/sftp/transports-action-store.jsx +102 -0
  15. package/client/components/sftp/transports-ui-store.jsx +30 -0
  16. package/client/components/sidebar/transfer-list-control.jsx +5 -14
  17. package/client/components/sidebar/transport-ui.jsx +2 -12
  18. package/client/components/tabs/tab.jsx +43 -2
  19. package/client/components/tabs/tabs.styl +1 -1
  20. package/client/components/terminal/index.jsx +1 -0
  21. package/client/components/terminal/terminal-interactive.jsx +15 -0
  22. package/client/components/terminal-info/disk.jsx +9 -0
  23. package/client/store/index.js +4 -0
  24. package/client/store/init-state.js +2 -3
  25. package/client/store/sync.js +5 -2
  26. package/client/store/tab.js +1 -1
  27. package/client/store/transfer-list.js +55 -2
  28. package/client/store/watch.js +0 -8
  29. package/package.json +1 -1
  30. package/client/components/sftp/transfer-conflict.jsx +0 -323
  31. package/client/components/sftp/transport-action.jsx +0 -412
  32. package/client/components/sftp/transport-entry.jsx +0 -108
  33. package/client/components/sftp/transport-types.js +0 -8
  34. package/client/components/sftp/transports-action.jsx +0 -111
  35. package/client/components/sftp/transports-ui.jsx +0 -93
@@ -1,93 +0,0 @@
1
- /**
2
- * transporter UI component
3
- */
4
- import { useRef, useEffect } from 'react'
5
- import Transport from './transport-action'
6
- import postMessage from '../../common/post-msg'
7
- import { transportTypes } from './transport-types'
8
-
9
- export default function TransportsUI (props) {
10
- const {
11
- transferList
12
- } = props
13
- const timer = useRef(null)
14
- function onDestroy () {
15
- clearTimeout(timer.current)
16
- }
17
- useEffect(() => {
18
- return onDestroy
19
- }, [])
20
- const pauseAll = () => {
21
- props.modifier({
22
- pauseAll: true
23
- })
24
- postMessage({
25
- action: transportTypes.pauseTransport,
26
- ids: []
27
- })
28
- }
29
- const resumeAll = () => {
30
- props.modifier({
31
- pauseAll: false
32
- })
33
- postMessage({
34
- action: transportTypes.resumeTransport,
35
- ids: []
36
- })
37
- }
38
- const pauseOrResumeAll = () => {
39
- if (props.pauseAll) {
40
- return resumeAll()
41
- }
42
- return pauseAll()
43
- }
44
- const cancelAll = () => {
45
- props.modifier({
46
- pauseAll: false
47
- })
48
- postMessage({
49
- action: transportTypes.cancelTransport,
50
- ids: []
51
- }, '*')
52
- }
53
-
54
- function onMessage (e) {
55
- const action = e?.data?.action
56
- const id = e?.data?.id
57
- if (id === props.sessionId || id === 'all') {
58
- switch (action) {
59
- case transportTypes.cancelAll:
60
- cancelAll()
61
- break
62
- case transportTypes.pauseOrResumeAll:
63
- pauseOrResumeAll()
64
- break
65
- default:
66
- break
67
- }
68
- }
69
- }
70
- function initEvent () {
71
- window.addEventListener('message', onMessage)
72
- }
73
- function destroyEvents () {
74
- window.removeEventListener('message', onMessage)
75
- }
76
- useEffect(() => {
77
- initEvent()
78
- return destroyEvents
79
- }, [])
80
- if (!transferList.length) {
81
- return null
82
- }
83
- return transferList.map((t, i) => {
84
- const { id } = t
85
- return (
86
- <Transport
87
- {...props}
88
- transfer={t}
89
- key={id + ':tr:' + i}
90
- />
91
- )
92
- })
93
- }