@electerm/electerm-react 1.40.20 → 1.50.31

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 (104) 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 +94 -0
  18. package/client/components/layout/layout.jsx +167 -0
  19. package/client/components/layout/layout.styl +8 -0
  20. package/client/components/layout/layouts.jsx +72 -0
  21. package/client/components/layout/session-size-alg.js +31 -0
  22. package/client/components/main/custom-css.jsx +1 -1
  23. package/client/components/main/main.jsx +184 -110
  24. package/client/components/main/ui-theme.jsx +1 -1
  25. package/client/components/main/wrapper.styl +2 -4
  26. package/client/components/profile/profile-list.jsx +1 -3
  27. package/client/components/profile/profile-transport-mod.jsx +1 -1
  28. package/client/components/profile/profile-transport.jsx +6 -9
  29. package/client/components/quick-commands/quick-command-transport.jsx +6 -9
  30. package/client/components/quick-commands/quick-commands-box.jsx +144 -153
  31. package/client/components/quick-commands/quick-commands-select.jsx +10 -3
  32. package/client/components/rdp/rdp-session.jsx +3 -23
  33. package/client/components/rdp/resolution-edit.jsx +40 -42
  34. package/client/components/session/session.jsx +63 -328
  35. package/client/components/session/session.styl +1 -5
  36. package/client/components/session/sessions.jsx +140 -111
  37. package/client/components/setting-panel/bookmark-tree-list.jsx +1 -1
  38. package/client/components/setting-panel/setting-common.jsx +6 -4
  39. package/client/components/setting-panel/setting-modal.jsx +31 -31
  40. package/client/components/setting-panel/start-session-select.jsx +4 -4
  41. package/client/components/setting-panel/tab-settings.jsx +27 -5
  42. package/client/components/setting-sync/data-import.jsx +36 -39
  43. package/client/components/setting-sync/setting-sync-form.jsx +10 -10
  44. package/client/components/setting-sync/setting-sync.jsx +50 -52
  45. package/client/components/sftp/address-bookmark.jsx +57 -58
  46. package/client/components/sftp/confirm-modal-store.jsx +34 -40
  47. package/client/components/sftp/file-item.jsx +14 -3
  48. package/client/components/sftp/file-mode-modal.jsx +3 -0
  49. package/client/components/sftp/list-table-ui.jsx +4 -4
  50. package/client/components/sftp/sftp-entry.jsx +2 -2
  51. package/client/components/sftp/transfer-conflict-store.jsx +13 -17
  52. package/client/components/sftp/transport-action-store.jsx +38 -31
  53. package/client/components/sftp/transports-action-store.jsx +3 -3
  54. package/client/components/sftp/transports-ui-store.jsx +18 -23
  55. package/client/components/shortcuts/shortcut-handler.js +1 -0
  56. package/client/components/shortcuts/shortcuts-defaults.js +5 -5
  57. package/client/components/shortcuts/shortcuts.jsx +9 -12
  58. package/client/components/side-panel-r/right-side-panel.styl +40 -0
  59. package/client/components/side-panel-r/side-panel-r.jsx +102 -0
  60. package/client/components/sidebar/bookmark-select.jsx +40 -40
  61. package/client/components/sidebar/bookmark.jsx +63 -65
  62. package/client/components/sidebar/history.jsx +53 -50
  63. package/client/components/sidebar/index.jsx +195 -184
  64. package/client/components/sidebar/info-modal.jsx +202 -202
  65. package/client/components/sidebar/sidebar.styl +8 -2
  66. package/client/components/sidebar/transfer-history-modal.jsx +95 -100
  67. package/client/components/sidebar/transfer-list-control.jsx +2 -2
  68. package/client/components/sidebar/transfer-list.jsx +45 -42
  69. package/client/components/sidebar/transfer-modal.jsx +49 -52
  70. package/client/components/sidebar/transport-ui.jsx +1 -1
  71. package/client/components/tabs/index.jsx +261 -49
  72. package/client/components/tabs/tab.jsx +48 -66
  73. package/client/components/tabs/tabs.styl +6 -1
  74. package/client/components/tabs/window-control.jsx +46 -48
  75. package/client/components/terminal/attach-addon-custom.js +1 -1
  76. package/client/components/terminal/index.jsx +111 -113
  77. package/client/components/terminal/term-search.jsx +26 -24
  78. package/client/components/terminal-info/run-cmd.jsx +0 -25
  79. package/client/components/terminal-info/terminal-info.jsx +60 -0
  80. package/client/components/terminal-info/terminal-info.styl +1 -1
  81. package/client/components/tree-list/bookmark-transport.jsx +8 -9
  82. package/client/components/tree-list/tree-list.jsx +36 -26
  83. package/client/components/vnc/vnc-session.jsx +1 -6
  84. package/client/components/web/address-bar.jsx +50 -0
  85. package/client/components/web/web-session.jsx +32 -10
  86. package/client/entry/index.jsx +5 -6
  87. package/client/store/common.js +1 -1
  88. package/client/store/db-upgrade.js +1 -1
  89. package/client/store/event.js +2 -2
  90. package/client/store/index.js +21 -32
  91. package/client/store/init-state.js +15 -3
  92. package/client/store/load-data.js +1 -1
  93. package/client/store/quick-command.js +4 -4
  94. package/client/store/session.js +1 -1
  95. package/client/store/setting.js +10 -6
  96. package/client/store/system-menu.js +1 -10
  97. package/client/store/tab.js +91 -1
  98. package/client/store/transfer-list.js +5 -6
  99. package/client/store/watch.js +11 -6
  100. package/package.json +1 -1
  101. package/client/components/common/react-subx.jsx +0 -1
  102. package/client/components/common/resize-wrap.jsx +0 -222
  103. package/client/components/common/resize-wrap.styl +0 -9
  104. package/client/components/terminal-info/content.jsx +0 -152
@@ -13,50 +13,47 @@ import {
13
13
  ExportOutlined,
14
14
  InfoCircleOutlined
15
15
  } from '@ant-design/icons'
16
- import { Component } from '../common/react-subx'
17
16
 
18
17
  const e = window.translate
19
18
 
20
- export class DataTransport extends Component {
21
- render () {
22
- const txt = e('autoSync')
23
- const {
24
- store
25
- } = this.props
26
- return (
27
- <div className='pd2 fix'>
28
- <div className='fleft'>
19
+ export default function DataTransport (props) {
20
+ const txt = e('autoSync')
21
+ const {
22
+ store
23
+ } = window
24
+ return (
25
+ <div className='pd2 fix'>
26
+ <div className='fleft'>
27
+ <Button
28
+ icon={<ExportOutlined />}
29
+ className='mg1r'
30
+ onClick={store.handleExportAllData}
31
+ >
32
+ {e('export')}
33
+ </Button>
34
+ <Upload
35
+ beforeUpload={store.importAll}
36
+ fileList={[]}
37
+ >
29
38
  <Button
30
- icon={<ExportOutlined />}
31
- className='mg1r'
32
- onClick={store.handleExportAllData}
39
+ icon={<ImportOutlined />}
33
40
  >
34
- {e('export')}
41
+ {e('importFromFile')}
35
42
  </Button>
36
- <Upload
37
- beforeUpload={store.importAll}
38
- fileList={[]}
39
- >
40
- <Button
41
- icon={<ImportOutlined />}
42
- >
43
- {e('importFromFile')}
44
- </Button>
45
- </Upload>
46
- </div>
47
- <div className='fright'>
48
- <Switch
49
- checked={store.config.autoSync || false}
50
- checkedChildren={txt}
51
- onChange={store.handleAutoSync}
52
- unCheckedChildren={txt}
53
- className='mg3l mg1r'
54
- />
55
- <Tooltip title={e('autoSyncTip')}>
56
- <InfoCircleOutlined />
57
- </Tooltip>
58
- </div>
43
+ </Upload>
44
+ </div>
45
+ <div className='fright'>
46
+ <Switch
47
+ checked={props.config.autoSync || false}
48
+ checkedChildren={txt}
49
+ onChange={store.handleAutoSync}
50
+ unCheckedChildren={txt}
51
+ className='mg3l mg1r'
52
+ />
53
+ <Tooltip title={e('autoSyncTip')}>
54
+ <InfoCircleOutlined />
55
+ </Tooltip>
59
56
  </div>
60
- )
61
- }
57
+ </div>
58
+ )
62
59
  }
@@ -5,7 +5,7 @@
5
5
  /**
6
6
  * bookmark form
7
7
  */
8
- import { useDelta, useConditionalEffect } from 'react-delta'
8
+ import { useDelta, useConditionalEffect } from 'react-delta-hooks'
9
9
  import { ArrowDownOutlined, ArrowUpOutlined, SaveOutlined, ClearOutlined } from '@ant-design/icons'
10
10
  import { Button, Input, notification, Form } from 'antd'
11
11
  import Link from '../common/external-link'
@@ -53,34 +53,34 @@ export default function SyncForm (props) {
53
53
  up[syncType + 'ApiUrl'] = 'https://electerm-cloud.html5beta.com/api/sync'
54
54
  // up[syncType + 'ApiUrl'] = 'http://127.0.0.1:5678/api/sync'
55
55
  }
56
- props.store.updateSyncSetting(up)
57
- const test = await props.store.testSyncToken(syncType, res.gistId)
56
+ window.store.updateSyncSetting(up)
57
+ const test = await window.store.testSyncToken(syncType, res.gistId)
58
58
  if (!test) {
59
59
  return notification.error({
60
60
  message: 'token invalid'
61
61
  })
62
62
  }
63
63
  if (!res.gistId && syncType !== syncTypes.custom && syncType !== syncTypes.cloud) {
64
- props.store.createGist(syncType)
64
+ window.store.createGist(syncType)
65
65
  }
66
66
  }
67
67
 
68
68
  function upload () {
69
- props
69
+ window
70
70
  .store
71
71
  .uploadSetting(props.syncType)
72
- .catch(props.store.onError)
72
+ .catch(window.store.onError)
73
73
  }
74
74
 
75
75
  function download () {
76
- props
76
+ window
77
77
  .store
78
78
  .downloadSetting(props.syncType)
79
- .catch(props.store.onError)
79
+ .catch(window.store.onError)
80
80
  }
81
81
 
82
82
  // onChangeAutoSync = checked => {
83
- // this.props.store.updateSyncSetting({
83
+ // this.window.store.updateSyncSetting({
84
84
  // autoSync: checked
85
85
  // })
86
86
  // }
@@ -273,7 +273,7 @@ export default function SyncForm (props) {
273
273
  </Button>
274
274
  <Button
275
275
  type='dashed'
276
- onClick={props.store.handleClearSyncSetting}
276
+ onClick={window.store.handleClearSyncSetting}
277
277
  disabled={disabled()}
278
278
  className='mg1r mg1b sync-btn-clear'
279
279
  icon={<ClearOutlined />}
@@ -1,30 +1,31 @@
1
1
  /**
2
2
  * sync setting module entry
3
3
  */
4
- import { Component } from '../common/react-subx'
4
+
5
5
  import { Tabs, Spin } from 'antd'
6
6
  import SyncForm from './setting-sync-form'
7
7
  import { syncTypes, syncDataMaps } from '../../common/constants'
8
- import { DataTransport } from './data-import'
8
+ import DataTransport from './data-import'
9
9
  import DataSelect from './data-select'
10
10
  import { pick } from 'lodash-es'
11
11
 
12
- export default class SyncSettingEntry extends Component {
13
- handleChange = (key) => {
14
- this.props.store.syncType = key
12
+ export default function SyncSettingEntry (props) {
13
+ const handleChange = (key) => {
14
+ window.store.syncType = key
15
15
  }
16
-
17
- renderForm () {
18
- const {
19
- store
20
- } = this.props
21
- const {
22
- syncSetting
23
- } = store.config
16
+ const {
17
+ config
18
+ } = props
19
+ const {
20
+ syncSetting
21
+ } = config
22
+ const {
23
+ store
24
+ } = window
25
+ function renderForm () {
24
26
  const syncProps = {
25
- store,
26
27
  ...syncSetting,
27
- ...pick(store, [
28
+ ...pick(props, [
28
29
  'autofocustrigger',
29
30
  'isSyncingSetting',
30
31
  'isSyncDownload',
@@ -32,7 +33,7 @@ export default class SyncSettingEntry extends Component {
32
33
  'syncType'
33
34
  ])
34
35
  }
35
- const type = store.syncType
36
+ const type = props.syncType
36
37
  const formData = {
37
38
  gistId: syncSetting[type + 'GistId'],
38
39
  token: syncSetting[type + 'AccessToken'],
@@ -51,42 +52,39 @@ export default class SyncSettingEntry extends Component {
51
52
  )
52
53
  }
53
54
 
54
- render () {
55
- const {
56
- store
57
- } = this.props
58
-
59
- const syncItems = Object.keys(syncTypes).map(type => {
60
- return {
61
- key: type,
62
- label: type,
63
- children: null
64
- }
65
- })
66
- const {
67
- dataSyncSelected
68
- } = store.config
69
- const arr = dataSyncSelected && dataSyncSelected !== 'all'
70
- ? dataSyncSelected.split(',')
71
- : Object.keys(syncDataMaps)
72
- const dataSelectProps = {
73
- dataSyncSelected: arr
55
+ const syncItems = Object.keys(syncTypes).map(type => {
56
+ return {
57
+ key: type,
58
+ label: type,
59
+ children: null
74
60
  }
75
- return (
76
- <div className='pd2l'>
77
- <DataTransport store={store} />
78
- <Spin spinning={store.isSyncingSetting}>
79
- <Tabs
80
- activeKey={store.syncType}
81
- onChange={this.handleChange}
82
- items={syncItems}
83
- />
84
- {
85
- this.renderForm()
86
- }
87
- <DataSelect {...dataSelectProps} />
88
- </Spin>
89
- </div>
90
- )
61
+ })
62
+ const {
63
+ dataSyncSelected
64
+ } = props.config
65
+ const arr = dataSyncSelected && dataSyncSelected !== 'all'
66
+ ? dataSyncSelected.split(',')
67
+ : Object.keys(syncDataMaps)
68
+ const dataSelectProps = {
69
+ dataSyncSelected: arr
70
+ }
71
+ const dataImportProps = {
72
+ config
91
73
  }
74
+ return (
75
+ <div className='pd2l'>
76
+ <DataTransport {...dataImportProps} />
77
+ <Spin spinning={store.isSyncingSetting}>
78
+ <Tabs
79
+ activeKey={store.syncType}
80
+ onChange={handleChange}
81
+ items={syncItems}
82
+ />
83
+ {
84
+ renderForm()
85
+ }
86
+ <DataSelect {...dataSelectProps} />
87
+ </Spin>
88
+ </div>
89
+ )
92
90
  }
@@ -1,4 +1,4 @@
1
- import { Component } from '../common/react-subx'
1
+ import { auto } from 'manate/react'
2
2
  import {
3
3
  StarOutlined,
4
4
  PlusSquareOutlined
@@ -11,16 +11,16 @@ import { typeMap } from '../../common/constants'
11
11
  import uid from '../../common/uid'
12
12
  import './address-bookmark.styl'
13
13
 
14
- export default class AddrBookmark extends Component {
15
- onDel = (item) => {
16
- this.props.store.delAddressBookmark(item)
14
+ export default auto(function AddrBookmark (props) {
15
+ function onDel (item) {
16
+ window.store.delAddressBookmark(item)
17
17
  }
18
18
 
19
- handleAddAddr = () => {
19
+ function handleAddAddr () {
20
20
  const {
21
- store, host, realPath, type
22
- } = this.props
23
- store.addAddressBookmark(
21
+ host, realPath, type
22
+ } = props
23
+ window.store.addAddressBookmark(
24
24
  {
25
25
  addr: realPath,
26
26
  host: type === typeMap.local ? '' : host,
@@ -29,55 +29,54 @@ export default class AddrBookmark extends Component {
29
29
  )
30
30
  }
31
31
 
32
- render () {
33
- const { type, onClickHistory, store, host } = this.props
34
- // const cls = classnames(
35
- // 'sftp-history',
36
- // 'animated',
37
- // `sftp-history-${type}`
38
- // )
39
- const addrs = type === typeMap.local
40
- ? store.addressBookmarksLocal
41
- : store.addressBookmarks.filter(
42
- g => g.host === host
43
- )
44
- const inner = addrs.length
45
- ? addrs.map(o => {
46
- return (
47
- <AddrBookmarkItem
48
- handleClick={onClickHistory}
49
- type={type}
50
- key={o.id}
51
- handleDel={this.onDel}
52
- item={o}
53
- />
54
- )
55
- })
56
- : null
57
- const content = (
58
- <div
59
- className='addr-bookmark-list'
60
- >
61
- {inner}
62
- </div>
32
+ const { type, onClickHistory, host } = props
33
+ const { store } = window
34
+ // const cls = classnames(
35
+ // 'sftp-history',
36
+ // 'animated',
37
+ // `sftp-history-${type}`
38
+ // )
39
+ const addrs = type === typeMap.local
40
+ ? store.addressBookmarksLocal
41
+ : store.addressBookmarks.filter(
42
+ g => g.host === host
63
43
  )
64
- const title = (
65
- <div>
66
- <PlusSquareOutlined
67
- className='add-addr-bookmark'
68
- onClick={this.handleAddAddr}
44
+ const inner = addrs.length
45
+ ? addrs.map(o => {
46
+ return (
47
+ <AddrBookmarkItem
48
+ handleClick={onClickHistory}
49
+ type={type}
50
+ key={o.id}
51
+ handleDel={onDel}
52
+ item={o}
69
53
  />
70
- </div>
71
- )
72
- return (
73
- <Popover
74
- content={content}
75
- title={title}
76
- placement='bottom'
77
- trigger='click'
78
- >
79
- <StarOutlined />
80
- </Popover>
81
- )
82
- }
83
- }
54
+ )
55
+ })
56
+ : null
57
+ const content = (
58
+ <div
59
+ className='addr-bookmark-list'
60
+ >
61
+ {inner}
62
+ </div>
63
+ )
64
+ const title = (
65
+ <div>
66
+ <PlusSquareOutlined
67
+ className='add-addr-bookmark'
68
+ onClick={handleAddAddr}
69
+ />
70
+ </div>
71
+ )
72
+ return (
73
+ <Popover
74
+ content={content}
75
+ title={title}
76
+ placement='bottom'
77
+ trigger='click'
78
+ >
79
+ <StarOutlined />
80
+ </Popover>
81
+ )
82
+ })
@@ -3,7 +3,6 @@
3
3
  *
4
4
  */
5
5
 
6
- import { Component } from '../common/react-subx'
7
6
  import { Modal, Button } from 'antd'
8
7
  import { isString } from 'lodash-es'
9
8
  import AnimateText from '../common/animate-text'
@@ -23,13 +22,10 @@ function formatTimeAuto (strOrDigit) {
23
22
  return formatTime(strOrDigit * 1000)
24
23
  }
25
24
 
26
- export default class ConfirmModalStore extends Component {
27
- act (action) {
28
- const { store } = this.props
29
- const {
30
- transferToConfirm
31
- } = store
32
- store.setState(
25
+ export default function ConfirmModalStore (props) {
26
+ function act (action) {
27
+ const { transferToConfirm } = props
28
+ window.store.setState(
33
29
  'transferToConfirm', {}
34
30
  )
35
31
  const {
@@ -48,10 +44,10 @@ export default class ConfirmModalStore extends Component {
48
44
  })
49
45
  }
50
46
 
51
- renderContent () {
47
+ function renderContent () {
52
48
  const {
53
49
  transferToConfirm
54
- } = this.props.store
50
+ } = props
55
51
  const {
56
52
  fromPath,
57
53
  toPath,
@@ -105,10 +101,10 @@ export default class ConfirmModalStore extends Component {
105
101
  )
106
102
  }
107
103
 
108
- renderFooter () {
104
+ function renderFooter () {
109
105
  const {
110
106
  transferToConfirm
111
- } = this.props.store
107
+ } = props
112
108
  if (!transferToConfirm) {
113
109
  return null
114
110
  }
@@ -122,21 +118,21 @@ export default class ConfirmModalStore extends Component {
122
118
  <Button
123
119
  type='dashed'
124
120
  className='mg1l'
125
- onClick={() => this.act(fileActions.cancel)}
121
+ onClick={() => act(fileActions.cancel)}
126
122
  >
127
123
  {e('cancel')}
128
124
  </Button>
129
125
  <Button
130
126
  type='dashed'
131
127
  className='mg1l'
132
- onClick={() => this.act(fileActions.skip)}
128
+ onClick={() => act(fileActions.skip)}
133
129
  >
134
130
  {e('skip')}
135
131
  </Button>
136
132
  <Button
137
133
  type='dashed'
138
134
  className='mg1l'
139
- onClick={() => this.act(fileActions.skipAll)}
135
+ onClick={() => act(fileActions.skipAll)}
140
136
  >
141
137
  {e('skipAll')}
142
138
  </Button>
@@ -144,7 +140,7 @@ export default class ConfirmModalStore extends Component {
144
140
  danger
145
141
  className='mg1l'
146
142
  onClick={
147
- () => this.act(fileActions.mergeOrOverwrite)
143
+ () => act(fileActions.mergeOrOverwrite)
148
144
  }
149
145
  >
150
146
  {isDirectory ? e('merge') : e('overwrite')}
@@ -153,7 +149,7 @@ export default class ConfirmModalStore extends Component {
153
149
  type='primary'
154
150
  className='mg1l'
155
151
  onClick={
156
- () => this.act(fileActions.rename)
152
+ () => act(fileActions.rename)
157
153
  }
158
154
  >
159
155
  {e('rename')}
@@ -169,7 +165,7 @@ export default class ConfirmModalStore extends Component {
169
165
  : e('overwriteDesc')
170
166
  }
171
167
  onClick={
172
- () => this.act(fileActions.mergeOrOverwriteAll)
168
+ () => act(fileActions.mergeOrOverwriteAll)
173
169
  }
174
170
  >
175
171
  {isDirectory ? e('mergeAll') : e('overwriteAll')}
@@ -179,7 +175,7 @@ export default class ConfirmModalStore extends Component {
179
175
  className='mg1l'
180
176
  title={e('renameDesc')}
181
177
  onClick={
182
- () => this.act(fileActions.renameAll)
178
+ () => act(fileActions.renameAll)
183
179
  }
184
180
  >
185
181
  {e('renameAll')}
@@ -189,26 +185,24 @@ export default class ConfirmModalStore extends Component {
189
185
  )
190
186
  }
191
187
 
192
- render () {
193
- const {
194
- transferToConfirm
195
- } = this.props.store
196
- if (!transferToConfirm.id) {
197
- return null
198
- }
199
- const modalProps = {
200
- open: true,
201
- width: 500,
202
- title: e('fileConflict'),
203
- footer: this.renderFooter(),
204
- onCancel: () => this.act(fileActions.cancel)
205
- }
206
- return (
207
- <Modal
208
- {...modalProps}
209
- >
210
- {this.renderContent()}
211
- </Modal>
212
- )
188
+ const {
189
+ transferToConfirm
190
+ } = props
191
+ if (!transferToConfirm.id) {
192
+ return null
193
+ }
194
+ const modalProps = {
195
+ open: true,
196
+ width: 500,
197
+ title: e('fileConflict'),
198
+ footer: renderFooter(),
199
+ onCancel: () => act(fileActions.cancel)
213
200
  }
201
+ return (
202
+ <Modal
203
+ {...modalProps}
204
+ >
205
+ {renderContent()}
206
+ </Modal>
207
+ )
214
208
  }
@@ -10,7 +10,7 @@ import {
10
10
  } from '@ant-design/icons'
11
11
  import classnames from 'classnames'
12
12
  import copy from 'json-deep-copy'
13
- import { pick, some, without } from 'lodash-es'
13
+ import { pick, some } from 'lodash-es'
14
14
  import Input from '../common/input-auto-focus'
15
15
  import resolve from '../../common/resolve'
16
16
  import { addClass, removeClass } from '../../common/class'
@@ -76,6 +76,9 @@ export default class FileSection extends React.Component {
76
76
 
77
77
  componentWillUnmount () {
78
78
  clearTimeout(this.timer)
79
+ this.timer = null
80
+ this.dom = null
81
+ this.dropTarget = null
79
82
  this.removeFileEditEvent()
80
83
  window.removeEventListener('message', this.changeFileMode)
81
84
  window.removeEventListener('message', this.onContextAction)
@@ -380,7 +383,7 @@ export default class FileSection extends React.Component {
380
383
  const { type } = this.props
381
384
  window.store.openFileInfoModal({
382
385
  file: this.state.file,
383
- tab: without(this.props.tab, 'terminals'),
386
+ tab: this.props.tab,
384
387
  visible: true,
385
388
  pid: this.props.pid,
386
389
  sessionId: this.props.sessionId,
@@ -507,6 +510,10 @@ export default class FileSection extends React.Component {
507
510
  file = {},
508
511
  action
509
512
  } = e.data || {}
513
+ if (action === commonActions.submitFileModeClose) {
514
+ window.removeEventListener('message', this.changeFileMode)
515
+ return false
516
+ }
510
517
  if (
511
518
  action !== commonActions.submitFileModeEdit ||
512
519
  file.id !== this.state.file.id
@@ -529,7 +536,7 @@ export default class FileSection extends React.Component {
529
536
  'message', this.changeFileMode
530
537
  )
531
538
  window.store.openFileModeModal({
532
- tab: without(this.props.tab, 'terminals'),
539
+ tab: this.props.tab,
533
540
  visible: true,
534
541
  uidTree: this.props[`${type}UidTree`],
535
542
  gidTree: this.props[`${type}GidTree`]
@@ -1092,6 +1099,10 @@ export default class FileSection extends React.Component {
1092
1099
  args = [],
1093
1100
  func
1094
1101
  } = e.data || {}
1102
+ if (action === commonActions.closeContextMenuAfter) {
1103
+ window.removeEventListener('message', this.onContextAction)
1104
+ return false
1105
+ }
1095
1106
  if (
1096
1107
  action !== commonActions.clickContextMenu ||
1097
1108
  id !== this.uid ||
@@ -83,6 +83,9 @@ export default class FileMode extends React.PureComponent {
83
83
  }
84
84
 
85
85
  onClose = () => {
86
+ postMessage({
87
+ action: commonActions.submitFileModeClose
88
+ })
86
89
  this.setStateProxy({
87
90
  file: {},
88
91
  data: {}
@@ -6,7 +6,7 @@
6
6
  * - click header to sort
7
7
  */
8
8
 
9
- import { Component } from '../common/react-subx'
9
+ import { PureComponent } from 'react'
10
10
  import classnames from 'classnames'
11
11
  import { isEqual, pick, find, isNull, isArray, isUndefined } from 'lodash-es'
12
12
  import generate from '../../common/uid'
@@ -31,7 +31,7 @@ import IconHolder from '../context-menu/icon-holder'
31
31
 
32
32
  const e = window.translate
33
33
 
34
- export default class FileListTable extends Component {
34
+ export default class FileListTable extends PureComponent {
35
35
  constructor (props) {
36
36
  super(props)
37
37
  this.state = {
@@ -162,7 +162,7 @@ export default class FileListTable extends Component {
162
162
  }
163
163
 
164
164
  getPropsDefault = () => {
165
- return this.props.store.config.filePropsEnabled || [
165
+ return this.props.config.filePropsEnabled || [
166
166
  'name',
167
167
  'size',
168
168
  'modifyTime'
@@ -275,7 +275,7 @@ export default class FileListTable extends Component {
275
275
  : [...names, name]
276
276
  const props = all.filter(g => newProps.includes(g))
277
277
  const update = this.initFromProps(props)
278
- this.props.store.setConfig({
278
+ window.store.setConfig({
279
279
  filePropsEnabled: props
280
280
  })
281
281
  this.setState(update)