@electerm/electerm-react 1.40.20 → 1.50.21

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 (96) hide show
  1. package/client/common/constants.js +57 -7
  2. package/client/common/new-terminal.js +2 -2
  3. package/client/components/auth/login.jsx +34 -57
  4. package/client/components/batch-op/batch-op.jsx +12 -11
  5. package/client/components/bookmark-form/index.jsx +2 -2
  6. package/client/components/bookmark-form/ssh-form.jsx +4 -1
  7. package/client/components/bookmark-form/tree-delete.jsx +5 -5
  8. package/client/components/context-menu/boomarks.jsx +8 -12
  9. package/client/components/context-menu/context-menu.jsx +10 -10
  10. package/client/components/context-menu/history.jsx +21 -24
  11. package/client/components/context-menu/menu-btn.jsx +11 -11
  12. package/client/components/context-menu/tabs.jsx +15 -19
  13. package/client/components/context-menu/zoom.jsx +25 -29
  14. package/client/components/footer/footer-entry.jsx +56 -56
  15. package/client/components/icons/split-icons.jsx +77 -0
  16. package/client/components/layout/layout-alg.js +260 -0
  17. package/client/components/layout/layout-item.jsx +26 -0
  18. package/client/components/layout/layout.jsx +167 -0
  19. package/client/components/layout/layout.styl +5 -0
  20. package/client/components/layout/layouts.jsx +71 -0
  21. package/client/components/layout/session-size-alg.js +31 -0
  22. package/client/components/main/main.jsx +183 -109
  23. package/client/components/main/wrapper.styl +2 -4
  24. package/client/components/profile/profile-list.jsx +1 -3
  25. package/client/components/profile/profile-transport-mod.jsx +1 -1
  26. package/client/components/profile/profile-transport.jsx +6 -9
  27. package/client/components/quick-commands/quick-command-transport.jsx +6 -9
  28. package/client/components/quick-commands/quick-commands-box.jsx +144 -153
  29. package/client/components/quick-commands/quick-commands-select.jsx +10 -3
  30. package/client/components/rdp/rdp-session.jsx +3 -23
  31. package/client/components/rdp/resolution-edit.jsx +40 -42
  32. package/client/components/session/session.jsx +62 -317
  33. package/client/components/session/session.styl +1 -5
  34. package/client/components/session/sessions.jsx +99 -105
  35. package/client/components/setting-panel/bookmark-tree-list.jsx +1 -1
  36. package/client/components/setting-panel/setting-common.jsx +6 -4
  37. package/client/components/setting-panel/setting-modal.jsx +31 -31
  38. package/client/components/setting-panel/start-session-select.jsx +4 -4
  39. package/client/components/setting-panel/tab-settings.jsx +27 -5
  40. package/client/components/setting-sync/data-import.jsx +36 -39
  41. package/client/components/setting-sync/setting-sync-form.jsx +9 -9
  42. package/client/components/setting-sync/setting-sync.jsx +50 -52
  43. package/client/components/sftp/address-bookmark.jsx +57 -58
  44. package/client/components/sftp/confirm-modal-store.jsx +34 -40
  45. package/client/components/sftp/file-item.jsx +14 -3
  46. package/client/components/sftp/file-mode-modal.jsx +3 -0
  47. package/client/components/sftp/list-table-ui.jsx +4 -4
  48. package/client/components/sftp/sftp-entry.jsx +2 -2
  49. package/client/components/sftp/transfer-conflict-store.jsx +13 -17
  50. package/client/components/sftp/transport-action-store.jsx +38 -31
  51. package/client/components/sftp/transports-action-store.jsx +3 -3
  52. package/client/components/sftp/transports-ui-store.jsx +18 -23
  53. package/client/components/shortcuts/shortcut-handler.js +1 -0
  54. package/client/components/shortcuts/shortcuts.jsx +9 -12
  55. package/client/components/side-panel-r/right-side-panel.styl +40 -0
  56. package/client/components/side-panel-r/side-panel-r.jsx +102 -0
  57. package/client/components/sidebar/bookmark-select.jsx +40 -40
  58. package/client/components/sidebar/bookmark.jsx +63 -65
  59. package/client/components/sidebar/history.jsx +53 -50
  60. package/client/components/sidebar/index.jsx +195 -184
  61. package/client/components/sidebar/info-modal.jsx +202 -202
  62. package/client/components/sidebar/sidebar.styl +8 -2
  63. package/client/components/sidebar/transfer-history-modal.jsx +95 -100
  64. package/client/components/sidebar/transfer-list-control.jsx +2 -2
  65. package/client/components/sidebar/transfer-list.jsx +45 -42
  66. package/client/components/sidebar/transfer-modal.jsx +49 -52
  67. package/client/components/sidebar/transport-ui.jsx +1 -1
  68. package/client/components/tabs/index.jsx +261 -49
  69. package/client/components/tabs/tab.jsx +60 -65
  70. package/client/components/tabs/tabs.styl +6 -1
  71. package/client/components/tabs/window-control.jsx +46 -48
  72. package/client/components/terminal/index.jsx +101 -104
  73. package/client/components/terminal/term-search.jsx +26 -24
  74. package/client/components/terminal-info/run-cmd.jsx +0 -25
  75. package/client/components/terminal-info/terminal-info.jsx +60 -0
  76. package/client/components/terminal-info/terminal-info.styl +1 -1
  77. package/client/components/tree-list/bookmark-transport.jsx +8 -9
  78. package/client/components/tree-list/tree-list.jsx +36 -26
  79. package/client/components/vnc/vnc-session.jsx +1 -6
  80. package/client/store/common.js +1 -1
  81. package/client/store/event.js +2 -2
  82. package/client/store/index.js +21 -32
  83. package/client/store/init-state.js +15 -3
  84. package/client/store/load-data.js +1 -1
  85. package/client/store/quick-command.js +4 -4
  86. package/client/store/session.js +1 -1
  87. package/client/store/setting.js +9 -5
  88. package/client/store/system-menu.js +1 -10
  89. package/client/store/tab.js +66 -1
  90. package/client/store/transfer-list.js +5 -6
  91. package/client/store/watch.js +11 -6
  92. package/package.json +1 -1
  93. package/client/components/common/react-subx.jsx +0 -1
  94. package/client/components/common/resize-wrap.jsx +0 -222
  95. package/client/components/common/resize-wrap.styl +0 -9
  96. package/client/components/terminal-info/content.jsx +0 -152
@@ -32,7 +32,7 @@ export default class TransferModalUI extends Component {
32
32
  }
33
33
 
34
34
  getGroups = () => {
35
- const fileTransfers = this.props.store.fileTransfers
35
+ const { fileTransfers } = this.props
36
36
  const tree = fileTransfers.reduce((p, k) => {
37
37
  const {
38
38
  id,
@@ -69,7 +69,7 @@ export default class TransferModalUI extends Component {
69
69
  const {
70
70
  filter
71
71
  } = this.state
72
- const fileTransfers = this.props.store.fileTransfers
72
+ const fileTransfers = this.props.fileTransfers
73
73
  return filter === 'all'
74
74
  ? fileTransfers
75
75
  : fileTransfers.filter(d => d.sessionId === filter)
@@ -1,4 +1,4 @@
1
- import { Component } from '../common/react-subx'
1
+ import { memo } from 'react'
2
2
  import {
3
3
  SwapOutlined
4
4
  } from '@ant-design/icons'
@@ -11,46 +11,49 @@ import './transfer.styl'
11
11
 
12
12
  const e = window.translate
13
13
 
14
- export default class TransferList extends Component {
15
- render () {
16
- const { store } = this.props
17
- const {
18
- fileTransfers,
19
- transferHistory
20
- } = store
21
- const len = fileTransfers.length
22
- if (!len && !transferHistory.length) {
23
- return null
24
- }
25
- const color = fileTransfers.some(item => item.error) ? 'red' : 'green'
26
- const bdProps = {
27
- className: len ? 'hvr-bob hvr-bob-fast' : '',
28
- count: len,
29
- size: 'small',
30
- offset: [-10, -5],
31
- color,
32
- overflowCount: 99
33
- }
34
- return (
35
- <div
36
- className='control-icon-wrap'
37
- title={e('fileTransfers')}
14
+ export default memo(function TransferList (props) {
15
+ const {
16
+ fileTransfers,
17
+ transferTab,
18
+ transferHistory
19
+ } = props
20
+ const len = fileTransfers.length
21
+ if (!len && !transferHistory.length) {
22
+ return null
23
+ }
24
+ const color = fileTransfers.some(item => item.error) ? 'red' : 'green'
25
+ const bdProps = {
26
+ className: len ? 'hvr-bob hvr-bob-fast' : '',
27
+ count: len,
28
+ size: 'small',
29
+ offset: [-10, -5],
30
+ color,
31
+ overflowCount: 99
32
+ }
33
+ const transferModalProps = {
34
+ fileTransfers,
35
+ transferHistory,
36
+ transferTab
37
+ }
38
+ return (
39
+ <div
40
+ className='control-icon-wrap'
41
+ title={e('fileTransfers')}
42
+ >
43
+ <Popover
44
+ placement='right'
45
+ destroyTooltipOnHide
46
+ overlayClassName='transfer-list-card'
47
+ content={<TransferModal {...transferModalProps} />}
38
48
  >
39
- <Popover
40
- placement='right'
41
- destroyTooltipOnHide
42
- overlayClassName='transfer-list-card'
43
- content={<TransferModal store={store} />}
49
+ <Badge
50
+ {...bdProps}
44
51
  >
45
- <Badge
46
- {...bdProps}
47
- >
48
- <SwapOutlined
49
- className='iblock font20 control-icon'
50
- />
51
- </Badge>
52
- </Popover>
53
- </div>
54
- )
55
- }
56
- }
52
+ <SwapOutlined
53
+ className='iblock font20 control-icon'
54
+ />
55
+ </Badge>
56
+ </Popover>
57
+ </div>
58
+ )
59
+ })
@@ -1,74 +1,71 @@
1
- import { Component } from '../common/react-subx'
2
1
  import {
3
2
  Tabs
4
3
  } from 'antd'
5
4
  import Transports from './transfer-list-control'
6
5
  import TransportHistory from './transfer-history-modal'
6
+ import { memo } from 'react'
7
7
 
8
8
  const e = window.translate
9
9
 
10
- export default class TransferModal extends Component {
11
- renderTransfer = () => {
10
+ export default memo(function TransferModal (props) {
11
+ const renderTransfer = () => {
12
12
  return (
13
13
  <Transports
14
- store={this.props.store}
14
+ fileTransfers={props.fileTransfers}
15
15
  />
16
16
  )
17
17
  }
18
18
 
19
- renderHistory = () => {
19
+ const renderHistory = () => {
20
20
  return (
21
21
  <TransportHistory
22
- store={this.props.store}
22
+ transferHistory={props.transferHistory}
23
23
  />
24
24
  )
25
25
  }
26
26
 
27
- render () {
28
- const {
29
- fileTransfers,
30
- transferHistory,
31
- transferTab,
32
- handleTransferTab
33
- } = this.props.store
34
- if (!fileTransfers.length && !transferHistory.length) {
35
- return null
36
- }
37
- const tabs = []
38
- if (fileTransfers.length) {
39
- tabs.push({
40
- title: e('fileTransfers'),
41
- id: 'transfer',
42
- render: this.renderTransfer
43
- })
44
- }
45
- if (transferHistory.length) {
46
- tabs.push({
47
- title: e('transferHistory'),
48
- id: 'history',
49
- render: this.renderHistory
50
- })
51
- }
52
- const activeTab = tabs.map(d => d.id).includes(transferTab)
53
- ? transferTab
54
- : tabs[0].id
55
- const items = tabs.map(tab => {
56
- return {
57
- key: tab.id,
58
- label: tab.title,
59
- children: tab.render()
60
- }
27
+ const {
28
+ fileTransfers,
29
+ transferHistory,
30
+ transferTab
31
+ } = props
32
+ if (!fileTransfers.length && !transferHistory.length) {
33
+ return null
34
+ }
35
+ const tabs = []
36
+ if (fileTransfers.length) {
37
+ tabs.push({
38
+ title: e('fileTransfers'),
39
+ id: 'transfer',
40
+ render: renderTransfer
41
+ })
42
+ }
43
+ if (transferHistory.length) {
44
+ tabs.push({
45
+ title: e('transferHistory'),
46
+ id: 'history',
47
+ render: renderHistory
61
48
  })
62
- return (
63
- <div
64
- className='pd1'
65
- >
66
- <Tabs
67
- activeKey={activeTab}
68
- onChange={handleTransferTab}
69
- items={items}
70
- />
71
- </div>
72
- )
73
49
  }
74
- }
50
+ const activeTab = tabs.map(d => d.id).includes(transferTab)
51
+ ? transferTab
52
+ : tabs[0].id
53
+ const items = tabs.map(tab => {
54
+ return {
55
+ key: tab.id,
56
+ label: tab.title,
57
+ children: tab.render()
58
+ }
59
+ })
60
+ return (
61
+ <div
62
+ className='pd1'
63
+ >
64
+ <Tabs
65
+ activeKey={activeTab}
66
+ onChange={window.store.handleTransferTab}
67
+ items={items}
68
+ />
69
+ </div>
70
+ )
71
+ })
@@ -44,7 +44,7 @@ export default function Transporter (props) {
44
44
  const title = `${typeFromTitle}→${typeToTitle}: ${fromPath} -> ${toPath} ${speed || ''} ${percent || 0}%`
45
45
  const cancelIcon = (
46
46
  <CloseCircleOutlined
47
- className='transfer-control-icon pointer hover-black font14'
47
+ className='transfer-control-icon transfer-control-cancel pointer hover-black font14'
48
48
  onClick={cancel}
49
49
  title={e('cancel')}
50
50
  />