@electerm/electerm-react 1.39.88 → 1.39.103

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 +6 -3
  2. package/client/common/create-title.jsx +2 -3
  3. package/client/common/init-setting-item.js +3 -6
  4. package/client/common/new-terminal.js +1 -2
  5. package/client/common/terminal-theme.js +2 -3
  6. package/client/components/auth/login.jsx +8 -3
  7. package/client/components/auth/login.styl +7 -1
  8. package/client/components/batch-op/batch-op.jsx +18 -36
  9. package/client/components/bookmark-form/form-ssh-common.jsx +6 -9
  10. package/client/components/bookmark-form/form-tabs.jsx +4 -8
  11. package/client/components/bookmark-form/index.jsx +5 -9
  12. package/client/components/bookmark-form/local-form-ui.jsx +4 -7
  13. package/client/components/bookmark-form/proxy.jsx +1 -2
  14. package/client/components/bookmark-form/quick-command.jsx +7 -8
  15. package/client/components/bookmark-form/rdp-form-ui.jsx +3 -5
  16. package/client/components/bookmark-form/render-auth-ssh.jsx +2 -3
  17. package/client/components/bookmark-form/render-connection-hopping.jsx +9 -11
  18. package/client/components/bookmark-form/render-delayed-scripts.jsx +2 -3
  19. package/client/components/bookmark-form/render-ssh-tunnel.jsx +9 -12
  20. package/client/components/bookmark-form/serial-form-ui.jsx +5 -9
  21. package/client/components/bookmark-form/sftp-enable.jsx +1 -2
  22. package/client/components/bookmark-form/telnet-form-ui.jsx +2 -4
  23. package/client/components/bookmark-form/tree-delete.jsx +3 -4
  24. package/client/components/bookmark-form/use-quick-commands.jsx +5 -6
  25. package/client/components/bookmark-form/use-submit.jsx +1 -2
  26. package/client/components/bookmark-form/use-ui.jsx +4 -6
  27. package/client/components/bookmark-form/vnc-form-ui.jsx +3 -5
  28. package/client/components/bookmark-form/web-form-ui.jsx +3 -5
  29. package/client/components/common/markdown.jsx +1 -1
  30. package/client/components/context-menu/context-menu.jsx +3 -4
  31. package/client/components/context-menu/menu-btn.jsx +13 -18
  32. package/client/components/footer/batch-input.jsx +2 -3
  33. package/client/components/footer/footer-entry.jsx +2 -3
  34. package/client/components/main/error-wrapper.jsx +2 -4
  35. package/client/components/main/upgrade.jsx +2 -4
  36. package/client/components/main/upgrade.styl +4 -1
  37. package/client/components/profile/profile-form-elem.jsx +28 -10
  38. package/client/components/quick-commands/quick-commands-box.jsx +1 -2
  39. package/client/components/quick-commands/quick-commands-form-elem.jsx +7 -12
  40. package/client/components/quick-commands/quick-commands-list-form.jsx +6 -7
  41. package/client/components/quick-commands/quick-commands-list.jsx +2 -3
  42. package/client/components/quick-commands/quick-commands-select.jsx +1 -2
  43. package/client/components/rdp/rdp-session.jsx +0 -3
  44. package/client/components/rdp/resolution-form.jsx +3 -6
  45. package/client/components/session/session.jsx +17 -6
  46. package/client/components/session/session.styl +5 -1
  47. package/client/components/session/sessions.jsx +4 -6
  48. package/client/components/setting-panel/keywords-form.jsx +2 -3
  49. package/client/components/setting-panel/list.jsx +3 -6
  50. package/client/components/setting-panel/setting-common.jsx +10 -14
  51. package/client/components/setting-panel/setting-modal.jsx +7 -11
  52. package/client/components/setting-panel/setting-terminal.jsx +13 -16
  53. package/client/components/setting-panel/start-session-select.jsx +1 -2
  54. package/client/components/setting-panel/tab-history.jsx +2 -3
  55. package/client/components/setting-sync/data-import.jsx +4 -7
  56. package/client/components/setting-sync/data-select.jsx +4 -16
  57. package/client/components/setting-sync/setting-sync-form.jsx +71 -48
  58. package/client/components/sftp/address-bar.jsx +1 -2
  59. package/client/components/sftp/confirm-modal-store.jsx +1 -2
  60. package/client/components/sftp/file-item.jsx +6 -8
  61. package/client/components/sftp/file-mode-modal.jsx +1 -2
  62. package/client/components/sftp/file-props-modal.jsx +1 -2
  63. package/client/components/sftp/list-table-ui.jsx +1 -2
  64. package/client/components/sftp/permission-render.jsx +1 -2
  65. package/client/components/sftp/sftp-entry.jsx +21 -7
  66. package/client/components/sftp/transfer-tag.jsx +1 -2
  67. package/client/components/shortcuts/shortcuts.jsx +5 -28
  68. package/client/components/sidebar/bookmark.jsx +6 -9
  69. package/client/components/sidebar/history.jsx +4 -6
  70. package/client/components/sidebar/index.jsx +9 -16
  71. package/client/components/sidebar/info-modal.jsx +10 -15
  72. package/client/components/sidebar/transfer-history-modal.jsx +3 -6
  73. package/client/components/sidebar/transfer-list-control.jsx +1 -2
  74. package/client/components/sidebar/transfer-list.jsx +1 -2
  75. package/client/components/sidebar/transfer-modal.jsx +2 -4
  76. package/client/components/sidebar/transport-ui.jsx +1 -2
  77. package/client/components/tabs/index.jsx +32 -22
  78. package/client/components/tabs/tab.jsx +5 -9
  79. package/client/components/tabs/window-control.jsx +4 -5
  80. package/client/components/terminal/index.jsx +5 -7
  81. package/client/components/terminal/term-search.jsx +2 -3
  82. package/client/components/terminal/terminal-interactive.jsx +2 -4
  83. package/client/components/terminal-info/activity.jsx +4 -5
  84. package/client/components/terminal-info/base.jsx +3 -4
  85. package/client/components/terminal-info/terminal-info.styl +1 -0
  86. package/client/components/terminal-theme/index.jsx +6 -9
  87. package/client/components/terminal-theme/theme-list.jsx +1 -2
  88. package/client/components/text-editor/text-editor-form.jsx +4 -8
  89. package/client/components/text-editor/text-editor.jsx +2 -3
  90. package/client/components/tree-list/bookmark-transport.jsx +4 -7
  91. package/client/components/tree-list/tree-list-item.jsx +4 -7
  92. package/client/components/tree-list/tree-list.jsx +3 -6
  93. package/client/components/vnc/vnc-form.jsx +2 -4
  94. package/client/components/vnc/vnc-session.jsx +1 -2
  95. package/client/entry/basic.js +4 -6
  96. package/client/store/common.js +10 -12
  97. package/client/store/index.js +4 -7
  98. package/client/store/init-state.js +2 -3
  99. package/client/store/load-data.js +10 -0
  100. package/client/store/setting.js +32 -5
  101. package/client/store/sync.js +10 -6
  102. package/client/store/system-menu.js +4 -6
  103. package/client/store/terminal-theme.js +2 -4
  104. package/package.json +1 -1
@@ -217,12 +217,14 @@ export const baseUpdateCheckUrls = [
217
217
  export const syncTypes = buildConst([
218
218
  'github',
219
219
  'gitee',
220
- 'custom'
220
+ 'custom',
221
+ 'cloud'
221
222
  ])
222
223
  export const syncTokenCreateUrls = {
223
224
  gitee: 'https://gitee.com/github-zxdong262/electerm/wikis/Create%20personal%20access%20token?sort_id=3028409',
224
225
  github: 'https://github.com/electerm/electerm/wiki/Create-personal-access-token',
225
- custom: 'https://github.com/electerm/electerm/wiki/Custom-sync-server'
226
+ custom: 'https://github.com/electerm/electerm/wiki/Custom-sync-server',
227
+ cloud: 'https://electerm-cloud.html5beta.com'
226
228
  }
227
229
  export const settingSyncId = 'setting-sync'
228
230
  export const settingTerminalId = 'setting-terminal'
@@ -354,8 +356,9 @@ export const cwdId = '=__+__'
354
356
  export const zmodemTransferPackSize = 1024 * 1024 * 2
355
357
  export const syncDataMaps = {
356
358
  settings: ['config'],
357
- bookmarks: ['bookmarks', 'bookmarkGroups', 'profiles'],
359
+ bookmarks: ['bookmarks', 'bookmarkGroups'],
358
360
  terminalThemes: ['terminalThemes'],
359
361
  quickCommands: ['quickCommands'],
362
+ profiles: ['profiles'],
360
363
  addressBookmarks: ['addressBookmarks']
361
364
  }
@@ -6,8 +6,7 @@ import {
6
6
  terminalLocalType
7
7
  } from './constants'
8
8
 
9
- const { prefix } = window
10
- const p = prefix('sftp')
9
+ const e = window.translate
11
10
 
12
11
  function maskHost (hostOrIp = '') {
13
12
  if (/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(hostOrIp)) {
@@ -46,7 +45,7 @@ export default function createTitle (res, hide = true) {
46
45
  if (type) {
47
46
  f = `[${type}]${f}`
48
47
  }
49
- return f || p(terminalLocalType)
48
+ return f || e(terminalLocalType)
50
49
  }
51
50
 
52
51
  export function createTitleTag (obj) {
@@ -9,11 +9,8 @@ import {
9
9
  } from './constants'
10
10
  import { buildNewTheme } from '../common/terminal-theme'
11
11
 
12
- const { prefix } = window
13
- const e = prefix('control')
12
+ const e = window.translate
14
13
  const newQuickCommand = 'newQuickCommand'
15
- const q = prefix('quickCommands')
16
- const f = prefix('form')
17
14
 
18
15
  export default (arr, tab) => {
19
16
  if (tab === settingMap.history) {
@@ -27,12 +24,12 @@ export default (arr, tab) => {
27
24
  } else if (tab === settingMap.quickCommands) {
28
25
  return {
29
26
  id: '',
30
- name: q(newQuickCommand)
27
+ name: encodeURIComponent(newQuickCommand)
31
28
  }
32
29
  } else if (tab === settingMap.profiles) {
33
30
  return {
34
31
  id: '',
35
- name: f(settingMap.profiles)
32
+ name: e(settingMap.profiles)
36
33
  }
37
34
  }
38
35
  }
@@ -7,8 +7,7 @@ import {
7
7
  paneMap
8
8
  } from './constants'
9
9
 
10
- const { prefix } = window
11
- const e = prefix('control')
10
+ const e = window.translate
12
11
  window.et.tabCount = 0
13
12
 
14
13
  export function updateCount (tab) {
@@ -5,8 +5,7 @@
5
5
  import { defaultTheme, settingMap } from '../common/constants'
6
6
  import download from '../common/download'
7
7
  import copy from 'json-deep-copy'
8
- const { prefix } = window
9
- const t = prefix('terminalThemes')
8
+ const e = window.translate
10
9
  const terminalPrefix = 'terminal:'
11
10
  export const requiredThemeProps = [
12
11
  'main',
@@ -64,7 +63,7 @@ export const buildNewTheme = (theme = defaultTheme) => {
64
63
  copy(theme),
65
64
  {
66
65
  id: '',
67
- name: t('newTheme')
66
+ name: e('newTheme')
68
67
  }
69
68
  )
70
69
  }
@@ -10,10 +10,11 @@ import {
10
10
  ArrowRightOutlined
11
11
  } from '@ant-design/icons'
12
12
  import Main from '../main/main.jsx'
13
+ import AppDrag from '../tabs/app-drag'
14
+ import WindowControl from '../tabs/window-control'
13
15
  import './login.styl'
14
16
 
15
- const { prefix } = window
16
- const f = prefix('form')
17
+ const e = window.translate
17
18
 
18
19
  window.store = store
19
20
 
@@ -91,6 +92,10 @@ export default class Login extends Component {
91
92
  } = this.state
92
93
  return (
93
94
  <div className='login-wrap'>
95
+ <AppDrag />
96
+ <WindowControl
97
+ store={window.store}
98
+ />
94
99
  <div className='pd3 aligncenter'>
95
100
  <LogoElem />
96
101
  <div className='pd3 aligncenter'>
@@ -98,7 +103,7 @@ export default class Login extends Component {
98
103
  value={pass}
99
104
  readOnly={loading}
100
105
  onChange={this.handlePassChange}
101
- placeholder={f('password')}
106
+ placeholder={e('password')}
102
107
  addonAfter={this.renderAfter()}
103
108
  onPressEnter={this.handleSubmit}
104
109
  />
@@ -4,4 +4,10 @@
4
4
  top 0
5
5
  width 100%
6
6
  height 100%
7
- background #fff
7
+ background #fff
8
+ .app-drag
9
+ position fixed
10
+ right 0
11
+ top 0
12
+ width 100%
13
+ height 30px
@@ -32,11 +32,7 @@ import wait from '../../common/wait'
32
32
  import { getFolderFromFilePath } from '../sftp/file-read'
33
33
  import resolveFilePath from '../../common/resolve'
34
34
 
35
- const { prefix } = window
36
- const f = prefix('form')
37
- const t = prefix('transferHistory')
38
- const c = prefix('common')
39
- const m = prefix('menu')
35
+ const e = window.translate
40
36
 
41
37
  export default class BatchOp extends Component {
42
38
  state = {
@@ -50,13 +46,13 @@ export default class BatchOp extends Component {
50
46
  }
51
47
 
52
48
  exampleColumns = [
53
- { title: f('host'), dataIndex: 'host', key: 'host' },
54
- { title: f('port'), dataIndex: 'port', key: 'port', responsive: ['md'] },
55
- { title: f('username'), dataIndex: 'username', key: 'username', responsive: ['lg'] },
56
- { title: f('password'), dataIndex: 'password', key: 'password', responsive: ['xl'] },
49
+ { title: e('host'), dataIndex: 'host', key: 'host' },
50
+ { title: e('port'), dataIndex: 'port', key: 'port', responsive: ['md'] },
51
+ { title: e('username'), dataIndex: 'username', key: 'username', responsive: ['lg'] },
52
+ { title: e('password'), dataIndex: 'password', key: 'password', responsive: ['xl'] },
57
53
  { title: 'Command', dataIndex: 'command', key: 'command', responsive: ['lg'] },
58
- { title: t('localPath'), dataIndex: 'localPath', key: 'localPath', responsive: ['xl'] },
59
- { title: t('remotePath'), dataIndex: 'remotePath', key: 'remotePath', responsive: ['xl'] },
54
+ { title: e('localPath'), dataIndex: 'localPath', key: 'localPath', responsive: ['xl'] },
55
+ { title: e('remotePath'), dataIndex: 'remotePath', key: 'remotePath', responsive: ['xl'] },
60
56
  { title: 'Action', dataIndex: 'action', key: 'action', responsive: ['md'] },
61
57
  { title: 'Command After', dataIndex: 'commandAfter', key: 'commandAfter', responsive: ['xl'] }
62
58
  ]
@@ -209,7 +205,7 @@ export default class BatchOp extends Component {
209
205
  await runCmd(tab.pid, tab.sessionId, conf.cmdAfterTransfer)
210
206
  this.updateState('run cmd2 done', index)
211
207
  }
212
- this.updateState(c('finished'), index)
208
+ this.updateState(e('finished'), index)
213
209
  document.querySelector('.tabs .tab.active .tab-close .anticon').click()
214
210
  }
215
211
 
@@ -462,7 +458,7 @@ export default class BatchOp extends Component {
462
458
  <Button
463
459
  onClick={this.handleExec}
464
460
  loading={this.state.working}
465
- >{c('execute')}
461
+ >{e('execute')}
466
462
  </Button>
467
463
  </div>
468
464
  )
@@ -471,22 +467,8 @@ export default class BatchOp extends Component {
471
467
  translate = k => {
472
468
  if (k === 'index') {
473
469
  return 'NO.'
474
- } else if (
475
- [
476
- 'host',
477
- 'port',
478
- 'username',
479
- 'password'
480
- ].includes(k)
481
- ) {
482
- return f(k)
483
- } else if (
484
- k.includes('Path')
485
- ) {
486
- return t(k)
487
- } else {
488
- return c(k)
489
470
  }
471
+ return e(k)
490
472
  }
491
473
 
492
474
  renderContent () {
@@ -509,12 +491,12 @@ export default class BatchOp extends Component {
509
491
  <div>
510
492
  <div className='pd1y'>
511
493
  <h2>
512
- {c('batchOperation')}
494
+ {e('batchOperation')}
513
495
  <HelpIcon
514
496
  link={batchOpHelpLink}
515
497
  />
516
498
  </h2>
517
- <div className='pd1y'>{c('examples')}:</div>
499
+ <div className='pd1y'>{e('examples')}:</div>
518
500
  <Table
519
501
  {...exampleTableProps}
520
502
  />
@@ -546,7 +528,7 @@ export default class BatchOp extends Component {
546
528
  type='dashed'
547
529
  disabled={disabled}
548
530
  >
549
- {c('importFromCSV')}
531
+ {e('importFromCSV')}
550
532
  </Button>
551
533
  </Upload>
552
534
  </div>
@@ -565,7 +547,7 @@ export default class BatchOp extends Component {
565
547
  loading={loading}
566
548
  disabled={disabled}
567
549
  htmlType='button'
568
- >{c('addToQueue')}
550
+ >{e('addToQueue')}
569
551
  </Button>
570
552
  </div>
571
553
  <div className='fright'>
@@ -575,7 +557,7 @@ export default class BatchOp extends Component {
575
557
  disabled={disabled || !tasks.length}
576
558
  type='primary'
577
559
  htmlType='button'
578
- >{c('execute')}
560
+ >{e('execute')}
579
561
  </Button>
580
562
  </div>
581
563
  </div>
@@ -632,7 +614,7 @@ export default class BatchOp extends Component {
632
614
  })
633
615
  if (tab === 'tasks') {
634
616
  columns.push({
635
- title: m('del'),
617
+ title: e('del'),
636
618
  dataIndex: 'op',
637
619
  key: 'op',
638
620
  render: (k, rec) => {
@@ -644,7 +626,7 @@ export default class BatchOp extends Component {
644
626
  className='act-del pointer'
645
627
  onClick={() => this.handleDel(rec)}
646
628
  >
647
- {m('del')}
629
+ {e('del')}
648
630
  </span>
649
631
  )
650
632
  }
@@ -657,7 +639,7 @@ export default class BatchOp extends Component {
657
639
  }
658
640
  })
659
641
  const len = data.length
660
- const title = `${c(tab)}(${len})`
642
+ const title = `${e(tab)}(${len})`
661
643
  return {
662
644
  key: tab,
663
645
  label: title,
@@ -28,10 +28,7 @@ const RadioButton = Radio.Button
28
28
  const RadioGroup = Radio.Group
29
29
  const FormItem = Form.Item
30
30
  const { Option } = Select
31
- const { prefix } = window
32
- const e = prefix('form')
33
- const c = prefix('common')
34
- const sf = prefix('sftp')
31
+ const e = window.translate
35
32
 
36
33
  export default function renderCommon (props) {
37
34
  const {
@@ -146,7 +143,7 @@ export default function renderCommon (props) {
146
143
  </FormItem>
147
144
  <FormItem
148
145
  {...formItemLayout}
149
- label={c('bookmarkCategory')}
146
+ label={e('bookmarkCategory')}
150
147
  name='category'
151
148
  >
152
149
  <TreeSelect
@@ -169,7 +166,7 @@ export default function renderCommon (props) {
169
166
  name='description'
170
167
  hasFeedback
171
168
  >
172
- <Input.TextArea rows={1} />
169
+ <Input.TextArea autoSize={{ minRows: 1 }} />
173
170
  </FormItem>
174
171
  <FormItem
175
172
  {...formItemLayout}
@@ -181,14 +178,14 @@ export default function renderCommon (props) {
181
178
  <FormItem
182
179
  {...formItemLayout}
183
180
  name='startDirectoryLocal'
184
- label={`${e('startDirectory')}:${sf('local')}`}
181
+ label={`${e('startDirectory')}:${e('local')}`}
185
182
  >
186
183
  <Input />
187
184
  </FormItem>
188
185
  <FormItem
189
186
  {...formItemLayout}
190
187
  name='startDirectory'
191
- label={`${e('startDirectory')}:${sf('remote')}`}
188
+ label={`${e('startDirectory')}:${e('remote')}`}
192
189
  >
193
190
  <Input />
194
191
  </FormItem>
@@ -199,7 +196,7 @@ export default function renderCommon (props) {
199
196
  hasFeedback
200
197
  >
201
198
  <Input.TextArea
202
- rows={1}
199
+ autoSize={{ minRows: 1 }}
203
200
  />
204
201
  </FormItem>
205
202
  {renderRunScripts()}
@@ -7,16 +7,12 @@ import {
7
7
  import { sshTunnelHelpLink } from '../../common/constants'
8
8
  import HelpIcon from '../common/help-icon'
9
9
 
10
- const { prefix } = window
11
- const e = prefix('form')
12
- const s = prefix('setting')
13
- const h = prefix('ssh')
14
- const q = prefix('quickCommands')
10
+ const e = window.translate
15
11
 
16
12
  export default function renderTabs (props) {
17
13
  const tunnelTag = (
18
14
  <span>
19
- {h('sshTunnel')}
15
+ {e('sshTunnel')}
20
16
  <HelpIcon
21
17
  link={sshTunnelHelpLink}
22
18
  />
@@ -31,7 +27,7 @@ export default function renderTabs (props) {
31
27
  },
32
28
  {
33
29
  key: 'settings',
34
- label: s('settings'),
30
+ label: e('settings'),
35
31
  forceRender: true,
36
32
  children: (
37
33
  <div>
@@ -44,7 +40,7 @@ export default function renderTabs (props) {
44
40
  },
45
41
  {
46
42
  key: 'quickCommands',
47
- label: q('quickCommands'),
43
+ label: e('quickCommands'),
48
44
  forceRender: true,
49
45
  children: props.qms
50
46
  },
@@ -29,11 +29,7 @@ import {
29
29
  BookOutlined
30
30
  } from '@ant-design/icons'
31
31
 
32
- const { prefix } = window
33
- const c = prefix('common')
34
- const m = prefix('menu')
35
- const s = prefix('setting')
36
- const p = prefix('sftp')
32
+ const e = window.translate
37
33
 
38
34
  export default class BookmarkIndex extends Component {
39
35
  constructor (props) {
@@ -102,7 +98,7 @@ export default class BookmarkIndex extends Component {
102
98
  keys.map(k => {
103
99
  const v = connectionMap[k]
104
100
  return (
105
- <Radio.Button key={v} value={v}>{p(v)}</Radio.Button>
101
+ <Radio.Button key={v} value={v}>{e(v)}</Radio.Button>
106
102
  )
107
103
  })
108
104
  }
@@ -156,9 +152,9 @@ export default class BookmarkIndex extends Component {
156
152
  <span>
157
153
  {
158
154
  (!isNew
159
- ? m('edit')
160
- : s('new')
161
- ) + ' ' + c(settingMap.bookmarks)
155
+ ? e('edit')
156
+ : e('new')
157
+ ) + ' ' + e(settingMap.bookmarks)
162
158
  }
163
159
  </span>
164
160
  {this.renderTitle(formData, isNew)}
@@ -26,10 +26,7 @@ import { ColorPickerItem } from './color-picker-item.jsx'
26
26
  import { getRandomDefaultColor } from '../../common/rand-hex-color.js'
27
27
 
28
28
  const FormItem = Form.Item
29
- const { prefix } = window
30
- const e = prefix('form')
31
- const c = prefix('common')
32
- const s = prefix('setting')
29
+ const e = window.translate
33
30
 
34
31
  export default function LocalFormUi (props) {
35
32
  const [
@@ -90,11 +87,11 @@ export default function LocalFormUi (props) {
90
87
  name='description'
91
88
  hasFeedback
92
89
  >
93
- <Input.TextArea rows={1} />
90
+ <Input.TextArea autoSize={{ minRows: 1 }} />
94
91
  </FormItem>
95
92
  <FormItem
96
93
  {...formItemLayout}
97
- label={c('bookmarkCategory')}
94
+ label={e('bookmarkCategory')}
98
95
  name='category'
99
96
  >
100
97
  <TreeSelect
@@ -125,7 +122,7 @@ export default function LocalFormUi (props) {
125
122
  },
126
123
  {
127
124
  key: 'settings',
128
- label: s('settings'),
125
+ label: e('settings'),
129
126
  forceRender: true,
130
127
  children: uis
131
128
  },
@@ -6,8 +6,7 @@ import {
6
6
  import { formItemLayout } from '../../common/form-layout'
7
7
 
8
8
  const FormItem = Form.Item
9
- const { prefix } = window
10
- const e = prefix('form')
9
+ const e = window.translate
11
10
 
12
11
  export default function renderProxy (props) {
13
12
  const proxyTree = props.bookmarks
@@ -18,8 +18,7 @@ import generate from '../../common/uid'
18
18
  import eq from 'fast-deep-equal'
19
19
 
20
20
  const InputGroup = Space.Compact
21
- const { prefix } = window
22
- const t = prefix('quickCommands')
21
+ const e = window.translate
23
22
 
24
23
  export default class QuickCommandItem extends PureComponent {
25
24
  constructor (props) {
@@ -156,19 +155,19 @@ export default class QuickCommandItem extends PureComponent {
156
155
  onChange={this.handleChangeName}
157
156
  className='width-40'
158
157
  title={item.name}
159
- placeholder={t('quickCommandName')}
158
+ placeholder={e('quickCommandName')}
160
159
  />
161
160
  <Input
162
161
  value={item.command}
163
162
  onChange={this.handleChangeCommand}
164
163
  className='width-60'
165
- placeholder={t('quickCommand')}
164
+ placeholder={e('quickCommand')}
166
165
  title={item.command}
167
166
  />
168
167
  </InputGroup>
169
168
  </Col>
170
169
  <Col span={3}>
171
- <Tooltip title={t('inputOnly')}>
170
+ <Tooltip title={e('inputOnly')}>
172
171
  <Switch
173
172
  checked={!!item.inputOnly}
174
173
  onChange={this.handleChangeInputOnly}
@@ -192,7 +191,7 @@ export default class QuickCommandItem extends PureComponent {
192
191
  readOnly
193
192
  className='width-40'
194
193
  title={item.name}
195
- placeholder={t('quickCommandName')}
194
+ placeholder={e('quickCommandName')}
196
195
  />
197
196
  <Input
198
197
  value={item.command}
@@ -203,10 +202,10 @@ export default class QuickCommandItem extends PureComponent {
203
202
  </InputGroup>
204
203
  </Col>
205
204
  <Col span={3}>
206
- <Tooltip title={t('inputOnly')}>
205
+ <Tooltip title={e('inputOnly')}>
207
206
  <Switch
208
207
  checked={!!item.inputOnly}
209
- title={t('inputOnly')}
208
+ title={e('inputOnly')}
210
209
  readOnly
211
210
  />
212
211
  </Tooltip>
@@ -25,9 +25,7 @@ import formatBookmarkGroups from './bookmark-group-tree-format'
25
25
  import findBookmarkGroupId from '../../common/find-bookmark-group-id'
26
26
 
27
27
  const FormItem = Form.Item
28
- const { prefix } = window
29
- const e = prefix('form')
30
- const c = prefix('common')
28
+ const e = window.translate
31
29
 
32
30
  export default function RdpFormUi (props) {
33
31
  const [
@@ -128,7 +126,7 @@ export default function RdpFormUi (props) {
128
126
  name='description'
129
127
  hasFeedback
130
128
  >
131
- <Input.TextArea rows={1} />
129
+ <Input.TextArea autoSize={{ minRows: 1 }} />
132
130
  </FormItem>
133
131
  <FormItem
134
132
  {...formItemLayout}
@@ -140,7 +138,7 @@ export default function RdpFormUi (props) {
140
138
  </FormItem>
141
139
  <FormItem
142
140
  {...formItemLayout}
143
- label={c('bookmarkCategory')}
141
+ label={e('bookmarkCategory')}
144
142
  name='category'
145
143
  >
146
144
  <TreeSelect
@@ -15,8 +15,7 @@ import './bookmark-form.styl'
15
15
 
16
16
  const { TextArea } = Input
17
17
  const FormItem = Form.Item
18
- const { prefix } = window
19
- const e = prefix('form')
18
+ const e = window.translate
20
19
 
21
20
  export default function renderAuth (props) {
22
21
  const {
@@ -104,7 +103,7 @@ export default function renderAuth (props) {
104
103
  <FormItem noStyle name='privateKey'>
105
104
  <TextArea
106
105
  placeholder={e('privateKeyDesc')}
107
- rows={1}
106
+ autoSize={{ minRows: 1 }}
108
107
  />
109
108
  </FormItem>
110
109
  <Upload
@@ -21,9 +21,7 @@ import { useState } from 'react'
21
21
  const FormItem = Form.Item
22
22
  const RadioButton = Radio.Button
23
23
  const RadioGroup = Radio.Group
24
- const { prefix } = window
25
- const f = prefix('form')
26
- const m = prefix('menu')
24
+ const e = window.translate
27
25
 
28
26
  export default function renderConnectionHopping (props) {
29
27
  const {
@@ -89,7 +87,7 @@ export default function renderConnectionHopping (props) {
89
87
  key: 'index',
90
88
  render: (k) => k
91
89
  }, {
92
- title: f('connectionHopping'),
90
+ title: e('connectionHopping'),
93
91
  key: 'connectionHopping',
94
92
  render: (k, item) => {
95
93
  const pass = item.password ? ':*****' : ''
@@ -99,7 +97,7 @@ export default function renderConnectionHopping (props) {
99
97
  return <span>{useProfile}{item.username}{pass}@{item.host}:{item.port}{pk}{ph}</span>
100
98
  }
101
99
  }, {
102
- title: m('del'),
100
+ title: e('del'),
103
101
  key: 'op',
104
102
  dataIndex: 'id',
105
103
  render: (id) => {
@@ -148,7 +146,7 @@ export default function renderConnectionHopping (props) {
148
146
  {renderList()}
149
147
  <FormItem
150
148
  {...formItemLayout}
151
- label={f('host')}
149
+ label={e('host')}
152
150
  hasFeedback
153
151
  rules={[{
154
152
  max: 520, message: '520 chars max'
@@ -162,7 +160,7 @@ export default function renderConnectionHopping (props) {
162
160
  </FormItem>
163
161
  <FormItem
164
162
  {...formItemLayout}
165
- label={f('port')}
163
+ label={e('port')}
166
164
  hasFeedback
167
165
  name='port'
168
166
  rules={[{
@@ -170,7 +168,7 @@ export default function renderConnectionHopping (props) {
170
168
  }]}
171
169
  >
172
170
  <InputNumber
173
- placeholder={f('port')}
171
+ placeholder={e('port')}
174
172
  min={1}
175
173
  max={65535}
176
174
  step={1}
@@ -178,7 +176,7 @@ export default function renderConnectionHopping (props) {
178
176
  </FormItem>
179
177
  <FormItem
180
178
  {...formItemLayout}
181
- label={f('username')}
179
+ label={e('username')}
182
180
  hasFeedback
183
181
  name='username'
184
182
  rules={[{
@@ -202,7 +200,7 @@ export default function renderConnectionHopping (props) {
202
200
  authTypes.map(t => {
203
201
  return (
204
202
  <RadioButton value={t} key={t}>
205
- {f(t)}
203
+ {e(t)}
206
204
  </RadioButton>
207
205
  )
208
206
  })
@@ -221,7 +219,7 @@ export default function renderConnectionHopping (props) {
221
219
  icon={<PlusOutlined />}
222
220
  onClick={onSubmit}
223
221
  >
224
- {f('connectionHopping')}
222
+ {e('connectionHopping')}
225
223
  </Button>
226
224
  </FormItem>
227
225
  </Form>
@@ -10,8 +10,7 @@ import { formItemLayout } from '../../common/form-layout'
10
10
 
11
11
  const FormItem = Form.Item
12
12
  const FormList = Form.List
13
- const { prefix } = window
14
- const e = prefix('form')
13
+ const e = window.translate
15
14
 
16
15
  export default function renderRunScripts () {
17
16
  function renderItem (field, i, add, remove) {
@@ -41,7 +40,7 @@ export default function renderRunScripts () {
41
40
  className='mg2x'
42
41
  >
43
42
  <Input.TextArea
44
- rows={1}
43
+ autoSize={{ minRows: 1 }}
45
44
  placeholder={e('loginScript')}
46
45
  className='compact-input'
47
46
  />