@electerm/electerm-react 1.39.76 → 1.39.99

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 (112) hide show
  1. package/client/common/constants.js +8 -0
  2. package/client/common/create-title.jsx +3 -4
  3. package/client/common/default-setting.js +2 -1
  4. package/client/common/init-setting-item.js +3 -6
  5. package/client/common/new-terminal.js +1 -2
  6. package/client/common/terminal-theme.js +2 -3
  7. package/client/components/auth/login.jsx +2 -3
  8. package/client/components/batch-op/batch-op.jsx +18 -36
  9. package/client/components/bookmark-form/color-picker.jsx +1 -1
  10. package/client/components/bookmark-form/form-ssh-common.jsx +4 -7
  11. package/client/components/bookmark-form/form-tabs.jsx +4 -8
  12. package/client/components/bookmark-form/index.jsx +5 -9
  13. package/client/components/bookmark-form/local-form-ui.jsx +3 -6
  14. package/client/components/bookmark-form/proxy.jsx +1 -2
  15. package/client/components/bookmark-form/quick-command.jsx +7 -8
  16. package/client/components/bookmark-form/rdp-form-ui.jsx +2 -4
  17. package/client/components/bookmark-form/render-auth-ssh.jsx +1 -2
  18. package/client/components/bookmark-form/render-connection-hopping.jsx +9 -11
  19. package/client/components/bookmark-form/render-delayed-scripts.jsx +36 -35
  20. package/client/components/bookmark-form/render-ssh-tunnel.jsx +9 -12
  21. package/client/components/bookmark-form/serial-form-ui.jsx +4 -8
  22. package/client/components/bookmark-form/sftp-enable.jsx +1 -2
  23. package/client/components/bookmark-form/telnet-form-ui.jsx +2 -4
  24. package/client/components/bookmark-form/tree-delete.jsx +3 -4
  25. package/client/components/bookmark-form/use-quick-commands.jsx +5 -6
  26. package/client/components/bookmark-form/use-submit.jsx +1 -2
  27. package/client/components/bookmark-form/use-ui.jsx +4 -6
  28. package/client/components/bookmark-form/vnc-form-ui.jsx +2 -4
  29. package/client/components/bookmark-form/web-form-ui.jsx +2 -4
  30. package/client/components/common/markdown.jsx +1 -1
  31. package/client/components/context-menu/context-menu.jsx +3 -4
  32. package/client/components/context-menu/menu-btn.jsx +13 -18
  33. package/client/components/footer/batch-input.jsx +1 -2
  34. package/client/components/footer/footer-entry.jsx +2 -3
  35. package/client/components/footer/footer.styl +1 -1
  36. package/client/components/main/error-wrapper.jsx +2 -4
  37. package/client/components/main/upgrade.jsx +2 -4
  38. package/client/components/main/upgrade.styl +4 -1
  39. package/client/components/profile/profile-form-elem.jsx +28 -10
  40. package/client/components/quick-commands/quick-commands-box.jsx +1 -2
  41. package/client/components/quick-commands/quick-commands-form-elem.jsx +7 -12
  42. package/client/components/quick-commands/quick-commands-list-form.jsx +5 -6
  43. package/client/components/quick-commands/quick-commands-list.jsx +2 -3
  44. package/client/components/quick-commands/quick-commands-select.jsx +1 -2
  45. package/client/components/rdp/rdp-session.jsx +0 -3
  46. package/client/components/rdp/resolution-form.jsx +3 -6
  47. package/client/components/session/session.jsx +3 -5
  48. package/client/components/session/sessions.jsx +4 -6
  49. package/client/components/setting-panel/keywords-form.jsx +2 -3
  50. package/client/components/setting-panel/list.jsx +3 -6
  51. package/client/components/setting-panel/setting-common.jsx +10 -14
  52. package/client/components/setting-panel/setting-modal.jsx +7 -11
  53. package/client/components/setting-panel/setting-terminal.jsx +13 -16
  54. package/client/components/setting-panel/start-session-select.jsx +1 -2
  55. package/client/components/setting-panel/tab-history.jsx +2 -3
  56. package/client/components/setting-sync/data-import.jsx +4 -7
  57. package/client/components/setting-sync/data-select-item.jsx +25 -0
  58. package/client/components/setting-sync/data-select.jsx +39 -0
  59. package/client/components/setting-sync/setting-sync-form.jsx +8 -12
  60. package/client/components/setting-sync/setting-sync.jsx +12 -1
  61. package/client/components/sftp/address-bar.jsx +1 -2
  62. package/client/components/sftp/confirm-modal-store.jsx +1 -2
  63. package/client/components/sftp/file-item.jsx +8 -10
  64. package/client/components/sftp/file-mode-modal.jsx +1 -2
  65. package/client/components/sftp/file-props-modal.jsx +1 -2
  66. package/client/components/sftp/list-table-ui.jsx +1 -2
  67. package/client/components/sftp/permission-render.jsx +1 -2
  68. package/client/components/sftp/sftp-entry.jsx +21 -7
  69. package/client/components/sftp/transfer-tag.jsx +1 -2
  70. package/client/components/shortcuts/shortcuts.jsx +5 -28
  71. package/client/components/sidebar/bookmark.jsx +6 -9
  72. package/client/components/sidebar/history.jsx +4 -6
  73. package/client/components/sidebar/index.jsx +9 -16
  74. package/client/components/sidebar/info-modal.jsx +10 -15
  75. package/client/components/sidebar/side-panel.jsx +3 -2
  76. package/client/components/sidebar/transfer-history-modal.jsx +3 -6
  77. package/client/components/sidebar/transfer-list-control.jsx +1 -2
  78. package/client/components/sidebar/transfer-list.jsx +1 -2
  79. package/client/components/sidebar/transfer-modal.jsx +2 -4
  80. package/client/components/sidebar/transport-ui.jsx +1 -2
  81. package/client/components/tabs/index.jsx +28 -20
  82. package/client/components/tabs/tab-title.jsx +1 -1
  83. package/client/components/tabs/tab.jsx +30 -8
  84. package/client/components/tabs/tabs.styl +3 -0
  85. package/client/components/tabs/window-control.jsx +4 -5
  86. package/client/components/terminal/index.jsx +6 -8
  87. package/client/components/terminal/term-search.jsx +7 -7
  88. package/client/components/terminal/terminal-interactive.jsx +2 -4
  89. package/client/components/terminal-info/activity.jsx +4 -5
  90. package/client/components/terminal-info/base.jsx +3 -4
  91. package/client/components/terminal-info/data-cols-parser.jsx +13 -11
  92. package/client/components/terminal-info/terminal-info.styl +5 -4
  93. package/client/components/terminal-theme/index.jsx +6 -9
  94. package/client/components/terminal-theme/theme-list.jsx +1 -2
  95. package/client/components/text-editor/text-editor-form.jsx +4 -8
  96. package/client/components/text-editor/text-editor.jsx +2 -3
  97. package/client/components/tree-list/bookmark-transport.jsx +4 -7
  98. package/client/components/tree-list/tree-list-item.jsx +4 -7
  99. package/client/components/tree-list/tree-list.jsx +3 -6
  100. package/client/components/tree-list/tree-list.styl +3 -2
  101. package/client/components/vnc/vnc-form.jsx +2 -4
  102. package/client/components/vnc/vnc-session.jsx +1 -2
  103. package/client/entry/basic.js +4 -6
  104. package/client/store/common.js +10 -12
  105. package/client/store/index.js +4 -7
  106. package/client/store/init-state.js +2 -3
  107. package/client/store/load-data.js +10 -0
  108. package/client/store/setting.js +2 -3
  109. package/client/store/sync.js +104 -54
  110. package/client/store/system-menu.js +4 -6
  111. package/client/store/terminal-theme.js +2 -4
  112. package/package.json +1 -1
@@ -22,12 +22,7 @@ import {
22
22
  } from '../../common/constants'
23
23
  import './info.styl'
24
24
 
25
- const { prefix } = window
26
- const e = prefix('control')
27
- const m = prefix('menu')
28
- const c = prefix('common')
29
- const a = prefix('app')
30
- const s = prefix('setting')
25
+ const e = window.translate
31
26
 
32
27
  export default class InfoModal extends Component {
33
28
  handleChangeTab = key => {
@@ -103,14 +98,14 @@ export default class InfoModal extends Component {
103
98
  }
104
99
  const title = (
105
100
  <div className='ant-modal-confirm-title font16'>
106
- <InfoCircleOutlined className='font20 mg1r' /> {m('about')} {name}
101
+ <InfoCircleOutlined className='font20 mg1r' /> {e('about')} {name}
107
102
  </div>
108
103
  )
109
104
  const attrs = {
110
105
  title,
111
106
  width: window.innerWidth - 100,
112
107
  maskClosable: true,
113
- okText: c('ok'),
108
+ okText: e('ok'),
114
109
  onCancel: onCloseAbout,
115
110
  footer: null,
116
111
  open: true,
@@ -119,11 +114,11 @@ export default class InfoModal extends Component {
119
114
  const items = [
120
115
  {
121
116
  key: infoTabs.info,
122
- label: m('about'),
117
+ label: e('about'),
123
118
  children: (
124
119
  <div>
125
120
  <LogoElem />
126
- <p className='mg2b'>{a('desc')}</p>
121
+ <p className='mg2b'>{e('desc')}</p>
127
122
  <p className='mg1b'>
128
123
  <UserOutlined /> <b className='mg1r'>{e('author')} ➾</b>
129
124
  <Link to={authorUrl} className='mg1l'>
@@ -143,7 +138,7 @@ export default class InfoModal extends Component {
143
138
  </Link>
144
139
  </p>
145
140
  <p className='mg1b'>
146
- <GlobalOutlined /> <b className='mg1r'>{s('language')} repo ➾</b>
141
+ <GlobalOutlined /> <b className='mg1r'>{e('language')} repo ➾</b>
147
142
  <Link to={langugeRepo} className='mg1l'>
148
143
  {langugeRepo}
149
144
  </Link>
@@ -155,25 +150,25 @@ export default class InfoModal extends Component {
155
150
  </Link>
156
151
  </p>
157
152
  <p className='mg1b'>
158
- <HighlightOutlined /> <b className='mg1r'>{a('changeLog')} ➾</b>
153
+ <HighlightOutlined /> <b className='mg1r'>{e('changeLog')} ➾</b>
159
154
  <Link to={releaseLink} className='mg1l'>
160
155
  {releaseLink}
161
156
  </Link>
162
157
  </p>
163
158
  <p className='mg1b'>
164
- <AlignLeftOutlined /> <b className='mg1r'>{a('knownIssues')} ➾</b>
159
+ <AlignLeftOutlined /> <b className='mg1r'>{e('knownIssues')} ➾</b>
165
160
  <Link to={knownIssuesLink} className='mg1l'>
166
161
  {knownIssuesLink}
167
162
  </Link>
168
163
  </p>
169
164
  <p className='mg1b'>
170
- <WarningOutlined /> <b className='mg1r'>{a('privacyNotice')} ➾</b>
165
+ <WarningOutlined /> <b className='mg1r'>{e('privacyNotice')} ➾</b>
171
166
  <Link to={privacyNoticeLink} className='mg1l'>
172
167
  {privacyNoticeLink}
173
168
  </Link>
174
169
  </p>
175
170
  <p className='mg1b'>
176
- <HeartOutlined /> <b className='mg1r'>{a('sponsorElecterm')} ➾</b>
171
+ <HeartOutlined /> <b className='mg1r'>{e('sponsorElecterm')} ➾</b>
177
172
  <Link to={sponsorLink} className='mg1l'>
178
173
  {sponsorLink}
179
174
  </Link>
@@ -1,6 +1,7 @@
1
1
  import { PureComponent } from 'react'
2
2
  export default class SidePanel extends PureComponent {
3
3
  handleMousedown = (e) => {
4
+ e.stopPropagation()
4
5
  this.dragStart = true
5
6
  this.clientX = e.clientX
6
7
  window.addEventListener('mouseup', this.handleMouseup)
@@ -13,8 +14,8 @@ export default class SidePanel extends PureComponent {
13
14
  clientX
14
15
  } = e
15
16
  let nw = clientX - this.clientX + this.props.leftSidebarWidth
16
- if (nw < 343) {
17
- nw = 343
17
+ if (nw < 150) {
18
+ nw = 150
18
19
  } else if (nw > 600) {
19
20
  nw = 600
20
21
  }
@@ -11,10 +11,7 @@ import './transfer-history.styl'
11
11
  import { get as _get } from 'lodash-es'
12
12
  import { filesize } from 'filesize'
13
13
 
14
- const { prefix } = window
15
- const e = prefix('transferHistory')
16
- const f = prefix('sftp')
17
- const m = prefix('menu')
14
+ const e = window.translate
18
15
  const timeRender = t => time(t)
19
16
  const sorterFactory = prop => {
20
17
  return (a, b) => {
@@ -59,7 +56,7 @@ export default class TransferHistoryModal extends Component {
59
56
  )
60
57
  }
61
58
  }, {
62
- title: m('host'),
59
+ title: e('host'),
63
60
  dataIndex: 'host',
64
61
  key: 'host',
65
62
  sorter: sorterFactory('host')
@@ -80,7 +77,7 @@ export default class TransferHistoryModal extends Component {
80
77
  },
81
78
  sorter: sorterFactory('toPath')
82
79
  }, {
83
- title: f('size'),
80
+ title: e('size'),
84
81
  dataIndex: 'size',
85
82
  key: 'size',
86
83
  sorter: sorterFactory('size'),
@@ -11,8 +11,7 @@ import { get } from 'lodash-es'
11
11
 
12
12
  const { Option } = Select
13
13
 
14
- const { prefix } = window
15
- const e = prefix('sftp')
14
+ const e = window.translate
16
15
 
17
16
  export default class TransferModalUI extends Component {
18
17
  state = {
@@ -9,8 +9,7 @@ import {
9
9
  import TransferModal from './transfer-modal'
10
10
  import './transfer.styl'
11
11
 
12
- const { prefix } = window
13
- const e = prefix('sftp')
12
+ const e = window.translate
14
13
 
15
14
  export default class TransferList extends Component {
16
15
  render () {
@@ -5,9 +5,7 @@ import {
5
5
  import Transports from './transfer-list-control'
6
6
  import TransportHistory from './transfer-history-modal'
7
7
 
8
- const { prefix } = window
9
- const e = prefix('sftp')
10
- const t = prefix('transferHistory')
8
+ const e = window.translate
11
9
 
12
10
  export default class TransferModal extends Component {
13
11
  renderTransfer = () => {
@@ -46,7 +44,7 @@ export default class TransferModal extends Component {
46
44
  }
47
45
  if (transferHistory.length) {
48
46
  tabs.push({
49
- title: t('transferHistory'),
47
+ title: e('transferHistory'),
50
48
  id: 'history',
51
49
  render: this.renderHistory
52
50
  })
@@ -10,8 +10,7 @@ import {
10
10
  } from '@ant-design/icons'
11
11
  import './transfer.styl'
12
12
 
13
- const { prefix } = window
14
- const e = prefix('sftp')
13
+ const e = window.translate
15
14
 
16
15
  export default function Transporter (props) {
17
16
  const {
@@ -31,16 +31,16 @@ import BookmarksList from '../sidebar/bookmark-select'
31
31
  import AppDrag from './app-drag'
32
32
  import classNames from 'classnames'
33
33
 
34
- const { prefix } = window
35
- const e = prefix('tabs')
36
- const c = prefix('control')
37
- const t = prefix('tabs')
34
+ const e = window.translate
38
35
  const MenuItem = Menu.Item
39
36
 
40
37
  export default class Tabs extends React.Component {
41
38
  constructor (props) {
42
39
  super(props)
43
40
  this.tabsRef = React.createRef()
41
+ this.state = {
42
+ overflow: false
43
+ }
44
44
  }
45
45
 
46
46
  componentDidMount () {
@@ -53,11 +53,10 @@ export default class Tabs extends React.Component {
53
53
  }
54
54
 
55
55
  componentDidUpdate (prevProps) {
56
- prevProps = prevProps || {}
57
56
  if (
58
57
  prevProps.currentTabId !== this.props.currentTabId ||
59
58
  prevProps.width !== this.props.width ||
60
- prevProps.tabs.map(d => d.title).join('#') !== this.props.tabs.map(d => d.title).join('#')
59
+ prevProps.tabs.length !== this.props.tabs.length
61
60
  ) {
62
61
  this.adjustScroll()
63
62
  }
@@ -72,12 +71,17 @@ export default class Tabs extends React.Component {
72
71
  }
73
72
 
74
73
  isOverflow = () => {
75
- const { tabs = [], width } = this.props
74
+ const { tabs = [] } = this.props
76
75
  const len = tabs.length
77
76
  const addBtnWidth = 22
78
- const tabsWidth = this.tabsWidth()
79
- const tabsWidthAll = tabMargin * len + 166 + tabsWidth
80
- return width < (tabsWidthAll + addBtnWidth)
77
+ const tabsWidth = this.tabsWidth() + tabMargin * len + addBtnWidth
78
+ const tabsInnerWidth = this.getInnerWidth()
79
+ return tabsWidth > tabsInnerWidth
80
+ }
81
+
82
+ getInnerWidth = () => {
83
+ const inner = document.querySelector('.tabs-inner')
84
+ return inner ? inner.clientWidth : 0
81
85
  }
82
86
 
83
87
  handleClickEvent = (e) => {
@@ -98,7 +102,7 @@ export default class Tabs extends React.Component {
98
102
  }
99
103
 
100
104
  adjustScroll = () => {
101
- const { width, tabs, currentTabId } = this.props
105
+ const { tabs, currentTabId } = this.props
102
106
  const index = findIndex(tabs, t => t.id === currentTabId)
103
107
  const tabsDomWith = Array.from(
104
108
  document.querySelectorAll('.tab')
@@ -106,10 +110,14 @@ export default class Tabs extends React.Component {
106
110
  return prev + c.clientWidth
107
111
  }, 0)
108
112
  const w = (index + 1) * tabMargin + 5 + tabsDomWith
109
- const scrollLeft = w > width - extraTabWidth
110
- ? w - width + extraTabWidth
113
+ const tabsInnerWidth = this.getInnerWidth()
114
+ const scrollLeft = w > tabsInnerWidth
115
+ ? w - tabsInnerWidth
111
116
  : 0
112
117
  this.dom.scrollLeft = scrollLeft
118
+ this.setState({
119
+ overflow: this.isOverflow()
120
+ })
113
121
  }
114
122
 
115
123
  handleScrollLeft = () => {
@@ -178,13 +186,13 @@ export default class Tabs extends React.Component {
178
186
  className={cls}
179
187
  onClick={onNewSsh}
180
188
  >
181
- <CodeFilled /> {c('newBookmark')}
189
+ <CodeFilled /> {e('newBookmark')}
182
190
  </div>
183
191
  <div
184
192
  className={cls}
185
193
  onClick={() => addTab()}
186
194
  >
187
- <RightSquareFilled /> {t('newTab')}
195
+ <RightSquareFilled /> {e('newTab')}
188
196
  </div>
189
197
  <BookmarksList
190
198
  store={window.store}
@@ -252,7 +260,7 @@ export default class Tabs extends React.Component {
252
260
  const { tabs = [], width } = this.props
253
261
  const len = tabs.length
254
262
  const tabsWidthAll = tabMargin * len + 10 + this.tabsWidth()
255
- const overflow = this.isOverflow()
263
+ const { overflow } = this.state
256
264
  const left = overflow
257
265
  ? '100%'
258
266
  : tabsWidthAll
@@ -291,9 +299,9 @@ export default class Tabs extends React.Component {
291
299
  })
292
300
  }
293
301
  {
294
- !overflow
295
- ? this.renderAddBtn()
296
- : null
302
+ overflow
303
+ ? null
304
+ : this.renderAddBtn()
297
305
  }
298
306
  </div>
299
307
  </div>
@@ -301,7 +309,7 @@ export default class Tabs extends React.Component {
301
309
  }
302
310
 
303
311
  render () {
304
- const overflow = this.isOverflow()
312
+ const { overflow } = this.state
305
313
  return (
306
314
  <div className='tabs' ref={this.tabsRef}>
307
315
  {this.renderContent()}
@@ -9,7 +9,7 @@ export default function tabTitle (props) {
9
9
  : {}
10
10
  return (
11
11
  <span className='tab-title'>
12
- <span style={styleTag}>♦</span> {tabCount}. {title}
12
+ <span style={styleTag}>●</span> {tabCount}. {title}
13
13
  </span>
14
14
  )
15
15
  }
@@ -23,10 +23,7 @@ import {
23
23
  } from '../../common/constants'
24
24
  import { shortcutDescExtend } from '../shortcuts/shortcut-handler.js'
25
25
 
26
- const { prefix } = window
27
- const e = prefix('tabs')
28
- const m = prefix('menu')
29
- const s = prefix('sftp')
26
+ const e = window.translate
30
27
  const onDragCls = 'ondrag-tab'
31
28
  const onDragOverCls = 'dragover-tab'
32
29
 
@@ -58,6 +55,31 @@ class Tab extends Component {
58
55
  clearTimeout(this.handler)
59
56
  }
60
57
 
58
+ shouldComponentUpdate (nextProps, nextState) {
59
+ return this.shouldUpdate(this.props, nextProps) || this.shouldUpdateState(this.state, nextState)
60
+ }
61
+
62
+ shouldUpdateState = (prevState, nextState) => {
63
+ return !isEqual(prevState, nextState)
64
+ }
65
+
66
+ shouldUpdate = (prevProps, nextProps) => {
67
+ // todo currentTabId still need improve
68
+ const pickKeys = [
69
+ 'currentTabId',
70
+ 'height',
71
+ 'isLast',
72
+ 'isMaximized',
73
+ 'activeTerminalId',
74
+ 'config',
75
+ 'tab',
76
+ 'width'
77
+ ]
78
+
79
+ // compare only the relevant props
80
+ return !isEqual(pick(prevProps, pickKeys), pick(nextProps, pickKeys))
81
+ }
82
+
61
83
  modifier = (...args) => {
62
84
  runIdle(() => this.setState(...args))
63
85
  }
@@ -290,7 +312,7 @@ class Tab extends Component {
290
312
  res.push({
291
313
  func: 'handleReloadTab',
292
314
  icon: 'Loading3QuartersOutlined',
293
- text: m('reload'),
315
+ text: e('reload'),
294
316
  subText: reloadShortcut
295
317
  })
296
318
  return res
@@ -363,8 +385,8 @@ class Tab extends Component {
363
385
  tunnel = `sock5://${sshTunnelLocalHost}:${sshTunnelLocalPort}`
364
386
  } else {
365
387
  tunnel = sshTunnel === 'forwardRemoteToLocal'
366
- ? `-> ${s('remote')}:${sshTunnelRemoteHost}:${sshTunnelRemotePort} -> ${sshTunnelLocalHost}:${sshTunnelLocalPort}`
367
- : `-> ${s('local')}:${sshTunnelLocalHost}:${sshTunnelLocalPort} -> ${sshTunnelRemoteHost}:${sshTunnelRemotePort}`
388
+ ? `-> ${e('remote')}:${sshTunnelRemoteHost}:${sshTunnelRemotePort} -> ${sshTunnelLocalHost}:${sshTunnelLocalPort}`
389
+ : `-> ${e('local')}:${sshTunnelLocalHost}:${sshTunnelLocalPort} -> ${sshTunnelRemoteHost}:${sshTunnelRemotePort}`
368
390
  }
369
391
  if (error) {
370
392
  tunnel = `error: ${tunnel}`
@@ -462,7 +484,7 @@ class Tab extends Component {
462
484
  <Loading3QuartersOutlined
463
485
  className='pointer tab-reload mg1r'
464
486
  onClick={this.handleReloadTab}
465
- title={m('reload')}
487
+ title={e('reload')}
466
488
  />
467
489
  <span className='tab-title'>
468
490
  {tabCount}. {title}
@@ -205,3 +205,6 @@
205
205
  .system-ui
206
206
  .window-controls
207
207
  display none
208
+ .tab-title-tag
209
+ margin-right 5px
210
+ font-size 14px
@@ -8,8 +8,7 @@ import {
8
8
  isMacJs
9
9
  } from '../../common/constants'
10
10
 
11
- const { prefix } = window
12
- const m = prefix('menu')
11
+ const e = window.translate
13
12
 
14
13
  export default class WindowControl extends Component {
15
14
  render () {
@@ -35,7 +34,7 @@ export default class WindowControl extends Component {
35
34
  return (
36
35
  <div className='window-controls'>
37
36
  <div className='window-control-box window-control-minimize' onClick={minimize}>
38
- <MinusOutlined title={m('minimize')} className='iblock font12 widnow-control-icon' />
37
+ <MinusOutlined title={e('minimize')} className='iblock font12 widnow-control-icon' />
39
38
  </div>
40
39
  <div
41
40
  className='window-control-box window-control-maximize'
@@ -45,7 +44,7 @@ export default class WindowControl extends Component {
45
44
  >
46
45
  <span
47
46
  title={
48
- isMaximized ? m('unmaximize') : m('maximize')
47
+ isMaximized ? e('unmaximize') : e('maximize')
49
48
  }
50
49
  className={
51
50
  'iblock font12 icon-maximize widnow-control-icon ' +
@@ -54,7 +53,7 @@ export default class WindowControl extends Component {
54
53
  />
55
54
  </div>
56
55
  <div className='window-control-box window-control-close' onClick={closeApp}>
57
- <CloseOutlined title={m('close')} className='iblock font12 widnow-control-icon' />
56
+ <CloseOutlined title={e('close')} className='iblock font12 widnow-control-icon' />
58
57
  </div>
59
58
  </div>
60
59
  )
@@ -53,9 +53,7 @@ import strip from '@electerm/strip-ansi'
53
53
  import { formatBytes } from '../../common/byte-format.js'
54
54
  import * as fs from './fs.js'
55
55
 
56
- const { prefix } = window
57
- const e = prefix('ssh')
58
- const m = prefix('menu')
56
+ const e = window.translate
59
57
 
60
58
  const computePos = (e) => {
61
59
  return {
@@ -837,14 +835,14 @@ class Term extends Component {
837
835
  {
838
836
  func: 'onCopy',
839
837
  icon: 'CopyOutlined',
840
- text: m('copy'),
838
+ text: e('copy'),
841
839
  disabled: !hasSlected,
842
840
  subText: copyShortcut
843
841
  },
844
842
  {
845
843
  func: 'onPaste',
846
844
  icon: 'SwitcherOutlined',
847
- text: m('paste'),
845
+ text: e('paste'),
848
846
  disabled: !copyed,
849
847
  subText: pasteShortcut
850
848
  },
@@ -1226,7 +1224,7 @@ class Term extends Component {
1226
1224
  }
1227
1225
 
1228
1226
  oncloseSocket = () => {
1229
- if (this.onClose || !this.props.tab.enableSsh) {
1227
+ if (this.onClose || this.props.tab.enableSsh === false) {
1230
1228
  return
1231
1229
  }
1232
1230
  this.setStatus(
@@ -1256,7 +1254,7 @@ class Term extends Component {
1256
1254
  this.props.delSplit(this.state.id)
1257
1255
  }}
1258
1256
  >
1259
- {m('close')}
1257
+ {e('close')}
1260
1258
  </Button>
1261
1259
  <Button
1262
1260
  icon={<ReloadOutlined />}
@@ -1267,7 +1265,7 @@ class Term extends Component {
1267
1265
  )
1268
1266
  }}
1269
1267
  >
1270
- {m('reload')}
1268
+ {e('reload')}
1271
1269
  </Button>
1272
1270
  </div>
1273
1271
  )
@@ -18,8 +18,7 @@ import copy from 'json-deep-copy'
18
18
  import { shortcutExtend } from '../shortcuts/shortcut-handler.js'
19
19
  import './term-search.styl'
20
20
 
21
- const { prefix } = window
22
- const s = prefix('ssh')
21
+ const e = window.translate
23
22
 
24
23
  class TermSearch extends Component {
25
24
  searchControls = [{
@@ -171,7 +170,7 @@ class TermSearch extends Component {
171
170
  return (
172
171
  <Tooltip
173
172
  key={id}
174
- title={s(id)}
173
+ title={e(id)}
175
174
  >
176
175
  <Icon
177
176
  className={cls}
@@ -197,10 +196,11 @@ class TermSearch extends Component {
197
196
  termSearchOpen,
198
197
  termSearch
199
198
  } = store
200
- if (!termSearchOpen) {
201
- return null
202
- }
203
- if (currentTab.pane === paneMap.fileManager) {
199
+ if (
200
+ !termSearchOpen ||
201
+ !currentTab ||
202
+ currentTab.pane === paneMap.fileManager
203
+ ) {
204
204
  return null
205
205
  }
206
206
  const props = {
@@ -9,9 +9,7 @@ import { tabActions } from '../../common/constants'
9
9
  import wait from '../../common/wait'
10
10
  import postMsg from '../../common/post-msg'
11
11
 
12
- const { prefix } = window
13
- const e = prefix('sftp')
14
- const c = prefix('common')
12
+ const e = window.translate
15
13
  const FormItem = Form.Item
16
14
 
17
15
  export default function TermInteractive () {
@@ -153,7 +151,7 @@ export default function TermInteractive () {
153
151
  className='mg1l'
154
152
  onClick={onIgnore}
155
153
  >
156
- {c('ignore')}
154
+ {e('ignore')}
157
155
  </Button>
158
156
  <Button
159
157
  className='mg1l'
@@ -7,8 +7,7 @@ import { isEmpty } from 'lodash-es'
7
7
  import { CloseCircleOutlined, BarsOutlined } from '@ant-design/icons'
8
8
  import colsParser from './data-cols-parser'
9
9
 
10
- const { prefix } = window
11
- const m = prefix('menu')
10
+ const e = window.translate
12
11
 
13
12
  export default function TerminalInfoActivities (props) {
14
13
  const { activities, isRemote, terminalInfos } = props
@@ -19,14 +18,14 @@ export default function TerminalInfoActivities (props) {
19
18
  col.unshift({
20
19
  dataIndex: 'kill',
21
20
  key: 'kill',
22
- title: m('close'),
21
+ title: e('close'),
23
22
  render: (txt, inst) => {
24
23
  return (
25
24
  <Tooltip
26
- title={m('close')}
25
+ title={e('close')}
27
26
  >
28
27
  <Popconfirm
29
- title={m('close') + ' pid:' + inst.pid + ' ?'}
28
+ title={e('close') + ' pid:' + inst.pid + ' ?'}
30
29
  onConfirm={() => props.killProcess(inst.pid)}
31
30
  >
32
31
  <CloseCircleOutlined
@@ -17,8 +17,7 @@ import postMsg from '../../common/post-msg'
17
17
  import { toggleTerminalLog, toggleTerminalLogTimestamp } from '../terminal/terminal-apis'
18
18
  import { ClockCircleOutlined, BorderlessTableOutlined, DatabaseOutlined, BarsOutlined, ApiOutlined, PartitionOutlined } from '@ant-design/icons'
19
19
 
20
- const { prefix } = window
21
- const st = prefix('setting')
20
+ const e = window.translate
22
21
 
23
22
  const mapper = {
24
23
  uptime: <ClockCircleOutlined />,
@@ -136,7 +135,7 @@ export default class TerminalInfoBase extends Component {
136
135
  if (!saveTerminalLogToFile) {
137
136
  return null
138
137
  }
139
- const name = st('addTimeStampToTermLog')
138
+ const name = e('addTimeStampToTermLog')
140
139
  return (
141
140
  <Switch
142
141
  checkedChildren={name}
@@ -186,7 +185,7 @@ export default class TerminalInfoBase extends Component {
186
185
  ? osResolve(appPath, 'electerm', 'session_logs')
187
186
  : window.et.sessionLogPath
188
187
  const path = osResolve(base, logName + '.log')
189
- const name = st('saveTerminalLogToFile')
188
+ const name = e('saveTerminalLogToFile')
190
189
  const to = saveTerminalLogToFile
191
190
  ? <ShowItem disabled={!saveTerminalLogToFile} to={path}>{path}</ShowItem>
192
191
  : path
@@ -2,9 +2,6 @@ import { copy } from '../../common/clipboard'
2
2
  import filesizeParser from 'filesize-parser'
3
3
  import { formatBytes } from '../../common/byte-format'
4
4
 
5
- const { prefix } = window
6
- const m = prefix('menu')
7
-
8
5
  const valueParserMaps = {
9
6
  size: v => v,
10
7
  used: filesizeParser,
@@ -19,19 +16,24 @@ function valueParse (obj, k) {
19
16
  return obj[k]
20
17
  }
21
18
 
19
+ function copyValue (event) {
20
+ copy(event.target.getAttribute('data-content'))
21
+ }
22
+
22
23
  export default (data) => {
23
24
  return Object.keys(data).map(k => {
24
25
  const rd = (txt) => {
25
26
  const r = k === 'mem' ? formatBytes(parseInt(txt, 10)) : txt
27
+ const itemProps = {
28
+ className: 'activity-item pointer',
29
+ 'data-content': r,
30
+ onClick: copyValue
31
+ }
26
32
  return (
27
- <div className='activity-item'>
28
- <span>{r}</span>
29
- <span
30
- className='pointer activity-item-copy mg1l bold color-blue'
31
- onClick={() => copy(txt)}
32
- >
33
- {m('copy')}
34
- </span>
33
+ <div
34
+ {...itemProps}
35
+ >
36
+ {r}
35
37
  </div>
36
38
  )
37
39
  }
@@ -29,10 +29,11 @@
29
29
  max-height 260px
30
30
  overflow-y scroll
31
31
  .activity-item
32
- .activity-item-copy
33
- display none
34
- &:hover .activity-item-copy
35
- display inline
32
+ max-height 1.6em
33
+ line-height 1.6
34
+ overflow hidden
35
+ &:hover
36
+ max-height none
36
37
  .info-panel-wrap-pin
37
38
  .toggle-info-panel-wrap
38
39
  color success