@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
@@ -3,26 +3,14 @@ import {
3
3
  } from '../../common/constants'
4
4
  import DataSelectItem from './data-select-item'
5
5
 
6
- const { prefix } = window
7
- const e = prefix('common')
8
- const f = prefix('config')
9
- const t = prefix('terminalThemes')
10
- const q = prefix('quickCommands')
11
-
12
- const translateMap = {
13
- settings: f,
14
- terminalThemes: t,
15
- quickCommands: q,
16
- bookmarks: e,
17
- addressBookmarks: e
18
- }
6
+ const e = window.translate
19
7
 
20
8
  export default function DataSelect (props) {
21
9
  const {
22
10
  dataSyncSelected
23
11
  } = props
24
- function onChange (e) {
25
- const key = e.target['data-key']
12
+ function onChange (evt) {
13
+ const key = evt.target['data-key']
26
14
  window.store.toggleDataSyncSelected(key)
27
15
  }
28
16
  return (
@@ -31,7 +19,7 @@ export default function DataSelect (props) {
31
19
  Object.keys(syncDataMaps)
32
20
  .map(d => {
33
21
  const checked = dataSyncSelected.includes(d)
34
- const title = translateMap[d](d)
22
+ const title = e(d)
35
23
  const boxProps = {
36
24
  checked,
37
25
  onChange,
@@ -16,11 +16,7 @@ import './sync.styl'
16
16
  import HelpIcon from '../common/help-icon'
17
17
 
18
18
  const FormItem = Form.Item
19
- const { prefix } = window
20
- const e = prefix('form')
21
- const ss = prefix('settingSync')
22
- const s = prefix('setting')
23
- const sh = prefix('ssh')
19
+ const e = window.translate
24
20
 
25
21
  export default function SyncForm (props) {
26
22
  const [form] = Form.useForm()
@@ -28,8 +24,11 @@ export default function SyncForm (props) {
28
24
  useConditionalEffect(() => {
29
25
  form.resetFields()
30
26
  }, delta && delta.prev && !eq(delta.prev, delta.curr))
31
-
27
+ const { syncType } = props
32
28
  function disabled () {
29
+ if (syncType === syncTypes.cloud) {
30
+ return !props.formData.token
31
+ }
33
32
  const {
34
33
  token,
35
34
  gistId
@@ -44,10 +43,15 @@ export default function SyncForm (props) {
44
43
  }
45
44
  if (res.gistId) {
46
45
  up[syncType + 'GistId'] = res.gistId
46
+ } else if (syncType === syncTypes.cloud) {
47
+ up[syncType + 'GistId'] = 'cloud'
47
48
  }
48
49
  up[syncType + 'SyncPassword'] = res.syncPassword || ''
49
50
  if (res.apiUrl) {
50
51
  up[syncType + 'ApiUrl'] = res.apiUrl
52
+ } else if (syncType === syncTypes.cloud) {
53
+ up[syncType + 'ApiUrl'] = 'https://electerm-cloud.html5beta.com/api/sync'
54
+ // up[syncType + 'ApiUrl'] = 'http://127.0.0.1:5678/api/sync'
51
55
  }
52
56
  props.store.updateSyncSetting(up)
53
57
  const test = await props.store.testSyncToken(syncType, res.gistId)
@@ -56,7 +60,7 @@ export default function SyncForm (props) {
56
60
  message: 'token invalid'
57
61
  })
58
62
  }
59
- if (!res.gistId) {
63
+ if (!res.gistId && syncType !== syncTypes.custom && syncType !== syncTypes.cloud) {
60
64
  props.store.createGist(syncType)
61
65
  }
62
66
  }
@@ -97,7 +101,7 @@ export default function SyncForm (props) {
97
101
  const {
98
102
  lastSyncTime = ''
99
103
  } = props.formData
100
- const { syncType } = props
104
+
101
105
  const isCustom = syncType === syncTypes.custom
102
106
  const timeFormatted = lastSyncTime
103
107
  ? dayjs(lastSyncTime).format('YYYY-MM-DD HH:mm:ss')
@@ -128,6 +132,15 @@ export default function SyncForm (props) {
128
132
  return 'sync-input-' + name + '-' + syncType
129
133
  }
130
134
  function createUrlItem () {
135
+ if (syncType === syncTypes.cloud) {
136
+ return (
137
+ <p>
138
+ <Link to='https://electerm-cloud.html5beta.com'>
139
+ https://electerm-cloud.html5beta.com[Beta]
140
+ </Link>
141
+ </p>
142
+ )
143
+ }
131
144
  if (syncType !== syncTypes.custom) {
132
145
  return null
133
146
  }
@@ -154,33 +167,13 @@ export default function SyncForm (props) {
154
167
  : 'gist ID'
155
168
  const tokenLabel = createLabel('token', desc)
156
169
  const gistLabel = createLabel('gist', idDesc)
157
- const syncPasswordName = s('encrypt') + ' ' + e('password')
170
+ const syncPasswordName = e('encrypt') + ' ' + e('password')
158
171
  const syncPasswordLabel = createLabel(syncPasswordName, '')
159
- return (
160
- <Form
161
- onFinish={save}
162
- form={form}
163
- className='form-wrap pd1x'
164
- name={'setting-sync-form' + syncType}
165
- layout='vertical'
166
- initialValues={props.formData}
167
- >
168
- {createUrlItem()}
169
- <FormItem
170
- label={tokenLabel}
171
- hasFeedback
172
- name='token'
173
- rules={[{
174
- max: 100, message: '100 chars max'
175
- }, {
176
- required: true, message: createPlaceHolder('token') + ' required'
177
- }]}
178
- >
179
- <Input.Password
180
- placeholder={createPlaceHolder('token')}
181
- id={createId('token')}
182
- />
183
- </FormItem>
172
+ function createIdItem () {
173
+ if (syncType === syncTypes.cloud) {
174
+ return null
175
+ }
176
+ return (
184
177
  <FormItem
185
178
  label={gistLabel}
186
179
  name='gistId'
@@ -193,6 +186,13 @@ export default function SyncForm (props) {
193
186
  id={createId('gistId')}
194
187
  />
195
188
  </FormItem>
189
+ )
190
+ }
191
+ function createPasswordItem () {
192
+ if (syncType === syncTypes.cloud) {
193
+ return null
194
+ }
195
+ return (
196
196
  <FormItem
197
197
  label={syncPasswordLabel}
198
198
  hasFeedback
@@ -205,16 +205,39 @@ export default function SyncForm (props) {
205
205
  placeholder={syncType + ' ' + syncPasswordName}
206
206
  />
207
207
  </FormItem>
208
- {/* <FormItem
209
- {...formItemLayout}
210
- label={ss('autoSync')}
208
+ )
209
+ }
210
+ return (
211
+ <Form
212
+ onFinish={save}
213
+ form={form}
214
+ className='form-wrap pd1x'
215
+ name={'setting-sync-form' + syncType}
216
+ layout='vertical'
217
+ initialValues={props.formData}
218
+ >
219
+ {createUrlItem()}
220
+ <FormItem
221
+ label={tokenLabel}
222
+ hasFeedback
223
+ name='token'
224
+ rules={[{
225
+ max: 1100, message: '1100 chars max'
226
+ }, {
227
+ required: true, message: createPlaceHolder('token') + ' required'
228
+ }]}
211
229
  >
212
- <Switch
213
- checked={autoSync}
214
- disabled={this.disabled()}
215
- onChange={this.onChangeAutoSync}
230
+ <Input.Password
231
+ placeholder={createPlaceHolder('token')}
232
+ id={createId('token')}
216
233
  />
217
- </FormItem> */}
234
+ </FormItem>
235
+ {
236
+ createIdItem()
237
+ }
238
+ {
239
+ createPasswordItem()
240
+ }
218
241
  <FormItem>
219
242
  <p>
220
243
  <Button
@@ -231,14 +254,14 @@ export default function SyncForm (props) {
231
254
  className='mg1r'
232
255
  loading={isSyncingSetting}
233
256
  icon='swap'
234
- >{ss('sync')}</Button> */}
257
+ >{e('sync')}</Button> */}
235
258
  <Button
236
259
  type='dashed'
237
260
  onClick={upload}
238
261
  disabled={disabled()}
239
- className='mg1r mg1b'
262
+ className='mg1r mg1b sync-btn-up'
240
263
  icon={<ArrowUpOutlined />}
241
- >{ss('uploadSettings')}
264
+ >{e('uploadSettings')}
242
265
  </Button>
243
266
  <Button
244
267
  type='dashed'
@@ -246,7 +269,7 @@ export default function SyncForm (props) {
246
269
  disabled={disabled()}
247
270
  className='mg1r mg1b sync-btn-down'
248
271
  icon={<ArrowDownOutlined />}
249
- >{ss('downloadSettings')}
272
+ >{e('downloadSettings')}
250
273
  </Button>
251
274
  <Button
252
275
  type='dashed'
@@ -254,11 +277,11 @@ export default function SyncForm (props) {
254
277
  disabled={disabled()}
255
278
  className='mg1r mg1b sync-btn-clear'
256
279
  icon={<ClearOutlined />}
257
- >{sh('clear')}
280
+ >{e('clear')}
258
281
  </Button>
259
282
  </p>
260
283
  <p>
261
- {ss('lastSyncTime')}: {timeFormatted}
284
+ {e('lastSyncTime')}: {timeFormatted}
262
285
  </p>
263
286
  <p>
264
287
  {renderGistUrl()}
@@ -16,8 +16,7 @@ import {
16
16
  import classnames from 'classnames'
17
17
  import AddrBookmark from './address-bookmark'
18
18
 
19
- const { prefix } = window
20
- const e = prefix('sftp')
19
+ const e = window.translate
21
20
 
22
21
  function renderAddonBefore (props, realPath) {
23
22
  const {
@@ -14,8 +14,7 @@ import {
14
14
  } from '../../common/constants'
15
15
  import postMessage from '../../common/post-msg'
16
16
 
17
- const { prefix } = window
18
- const e = prefix('sftp')
17
+ const e = window.translate
19
18
 
20
19
  function formatTimeAuto (strOrDigit) {
21
20
  if (isString(strOrDigit)) {
@@ -36,9 +36,7 @@ import { filesize } from 'filesize'
36
36
  import { createTransferProps } from './transfer-common'
37
37
  import generate from '../../common/uid'
38
38
 
39
- const { prefix } = window
40
- const e = prefix('sftp')
41
- const m = prefix('menu')
39
+ const e = window.translate
42
40
 
43
41
  const computePos = (e) => {
44
42
  return {
@@ -945,7 +943,7 @@ export default class FileSection extends React.Component {
945
943
  const shouldShowSelectedMenu = id &&
946
944
  len > 1 &&
947
945
  some(selectedFiles, d => d.id === id)
948
- const delTxt = shouldShowSelectedMenu ? `${e('deleteAll')}(${len})` : m('del')
946
+ const delTxt = shouldShowSelectedMenu ? `${e('deleteAll')}(${len})` : e('del')
949
947
  const canPaste = hasFileInClipboardText()
950
948
  const showEdit = !isDirectory && id &&
951
949
  size < maxEditFileSize
@@ -1018,20 +1016,20 @@ export default class FileSection extends React.Component {
1018
1016
  res.push({
1019
1017
  func: 'onCopy',
1020
1018
  icon: 'CopyOutlined',
1021
- text: m('copy'),
1019
+ text: e('copy'),
1022
1020
  subText: `${ctrlOrCmd}+c`
1023
1021
  })
1024
1022
  res.push({
1025
1023
  func: 'onCut',
1026
1024
  icon: 'FileExcelOutlined',
1027
- text: m('cut'),
1025
+ text: e('cut'),
1028
1026
  subText: `${ctrlOrCmd}+x`
1029
1027
  })
1030
1028
  }
1031
1029
  res.push({
1032
1030
  func: 'onPaste',
1033
1031
  icon: 'CopyOutlined',
1034
- text: m('paste'),
1032
+ text: e('paste'),
1035
1033
  disabled: !canPaste,
1036
1034
  subText: `${ctrlOrCmd}+v`
1037
1035
  })
@@ -1044,7 +1042,7 @@ export default class FileSection extends React.Component {
1044
1042
  res.push({
1045
1043
  func: 'onCopyPath',
1046
1044
  icon: 'CopyOutlined',
1047
- text: m('copyFilePath')
1045
+ text: e('copyFilePath')
1048
1046
  })
1049
1047
  }
1050
1048
  if (enableSsh !== false || isLocal) {
@@ -13,8 +13,7 @@ import renderPermission from './permission-render'
13
13
  import postMessage from '../../common/post-msg'
14
14
  import FileIcon from './file-icon'
15
15
 
16
- const { prefix } = window
17
- const e = prefix('sftp')
16
+ const e = window.translate
18
17
  const formatTime = time
19
18
 
20
19
  export default class FileMode extends React.PureComponent {
@@ -22,8 +22,7 @@ import postMsg from '../../common/post-msg'
22
22
  import { filesize } from 'filesize'
23
23
  import { runCmd } from '../terminal/terminal-apis'
24
24
 
25
- const { prefix } = window
26
- const e = prefix('sftp')
25
+ const e = window.translate
27
26
  const formatTime = time
28
27
 
29
28
  export default function FileInfoModal () {
@@ -29,8 +29,7 @@ import {
29
29
  } from '@ant-design/icons'
30
30
  import IconHolder from '../context-menu/icon-holder'
31
31
 
32
- const { prefix } = window
33
- const e = prefix('sftp')
32
+ const e = window.translate
34
33
 
35
34
  export default class FileListTable extends Component {
36
35
  constructor (props) {
@@ -5,8 +5,7 @@
5
5
  import { Button, Space } from 'antd'
6
6
  import { isFunction, noop } from 'lodash-es'
7
7
 
8
- const { prefix } = window
9
- const e = prefix('permission')
8
+ const e = window.translate
10
9
 
11
10
  export default (perm, _onClick) => {
12
11
  const {
@@ -36,9 +36,7 @@ import AddressBar from './address-bar'
36
36
  import getProxy from '../../common/get-proxy'
37
37
  import './sftp.styl'
38
38
 
39
- const { prefix } = window
40
- const e = prefix('sftp')
41
- const c = prefix('common')
39
+ const e = window.translate
42
40
 
43
41
  const buildTree = arr => {
44
42
  return arr.reduce((prev, curr) => {
@@ -390,8 +388,8 @@ export default class Sftp extends Component {
390
388
  onDel = (type, files) => {
391
389
  this.onDelete = true
392
390
  Modal.confirm({
393
- cancelText: c('cancel'),
394
- okText: c('ok'),
391
+ cancelText: e('cancel'),
392
+ okText: e('ok'),
395
393
  title: this.renderDelConfirmTitle(files),
396
394
  onOk: () => this.delFiles(type, files)
397
395
  })
@@ -845,6 +843,22 @@ export default class Sftp extends Component {
845
843
  }, () => this[`${type}List`](undefined, undefined, oldPath))
846
844
  }
847
845
 
846
+ parsePath = (type, pth) => {
847
+ const reg = /^%([^%]+)%/
848
+ if (!reg.test(pth)) {
849
+ return pth
850
+ }
851
+ const m = pth.match(reg)
852
+ if (!m || !m[1]) {
853
+ return pth
854
+ }
855
+ const envName = m[1]
856
+ const envPath = window.pre.env[envName]
857
+ if (envPath) {
858
+ return pth.replace(reg, envPath)
859
+ }
860
+ }
861
+
848
862
  onGoto = (type, e) => {
849
863
  e && e.preventDefault()
850
864
  if (type === typeMap.remote && !this.sftp) {
@@ -853,14 +867,14 @@ export default class Sftp extends Component {
853
867
  const n = `${type}Path`
854
868
  const nt = n + 'Temp'
855
869
  const oldPath = this.state[type + 'Path']
856
- const np = this.state[nt]
870
+ const np = this.parsePath(type, this.state[nt])
857
871
  if (!isValidPath(np)) {
858
872
  return notification.warning({
859
873
  message: 'path not valid'
860
874
  })
861
875
  }
862
876
  this.setState({
863
- [n]: this.state[nt]
877
+ [n]: np
864
878
  }, () => this[`${type}List`](undefined, undefined, oldPath))
865
879
  }
866
880
 
@@ -4,8 +4,7 @@
4
4
  */
5
5
 
6
6
  import './transfer-tag.styl'
7
- const { prefix } = window
8
- const e = prefix('sftp')
7
+ const e = window.translate
9
8
 
10
9
  export default function TransferTag (props) {
11
10
  const {
@@ -10,12 +10,7 @@ import {
10
10
  isMacJs as isMac
11
11
  } from '../../common/constants.js'
12
12
 
13
- const { prefix } = window
14
- const e = prefix('form')
15
- const c = prefix('control')
16
- const m = prefix('menu')
17
- const ss = prefix('ssh')
18
- const s = prefix('setting')
13
+ const e = window.translate
19
14
  const shortcutsDefaults = shortcutsDefaultsGen()
20
15
 
21
16
  export default class Shortcuts extends Component {
@@ -105,30 +100,12 @@ export default class Shortcuts extends Component {
105
100
  key: 'name',
106
101
  render: (name) => {
107
102
  const [a, b] = name.split('_')
108
- const pre = a === 'terminal' ? `[${ss('terminal')}] ` : ''
109
- if (
110
- [
111
- 'clear', 'selectAll', 'search', 'split'
112
- ].includes(b)
113
- ) {
114
- return pre + ss(b)
115
- } else if (b === 'copy') {
116
- return pre + m(b)
117
- } else if (b === 'newBookmark') {
118
- return pre + c(b)
119
- } else if (b.includes('zoomin')) {
120
- return pre + m('zoomin')
121
- } else if (b.includes('zoomout')) {
122
- return pre + m('zoomout')
123
- } else if (['togglefullscreen'].includes(b)) {
124
- return pre + m(b)
125
- } else {
126
- return pre + s(b)
127
- }
103
+ const pre = a === 'terminal' ? `[${e('terminal')}] ` : ''
104
+ return pre + e(b)
128
105
  }
129
106
  },
130
107
  {
131
- title: s('settingShortcuts'),
108
+ title: e('settingShortcuts'),
132
109
  dataIndex: 'shortcut',
133
110
  key: 'shortcut',
134
111
  render: (shortcut, inst) => {
@@ -174,7 +151,7 @@ export default class Shortcuts extends Component {
174
151
  <Button
175
152
  onClick={this.handleResetAll}
176
153
  >
177
- {s('resetAllToDefault')}
154
+ {e('resetAllToDefault')}
178
155
  </Button>
179
156
  </div>
180
157
  </div>
@@ -8,10 +8,7 @@ import { pick } from 'lodash-es'
8
8
  import { ArrowsAltOutlined, EditOutlined, PlusCircleOutlined, ShrinkOutlined, PushpinOutlined } from '@ant-design/icons'
9
9
  import { Tooltip } from 'antd'
10
10
 
11
- const { prefix } = window
12
- const c = prefix('common')
13
- const m = prefix('menu')
14
- const e = prefix('control')
11
+ const e = window.translate
15
12
 
16
13
  export default class BookmarkPanel extends Component {
17
14
  render () {
@@ -42,29 +39,29 @@ export default class BookmarkPanel extends Component {
42
39
  >
43
40
  <div className='pd1y pd2t pd2x'>
44
41
  <div className='fix'>
45
- <div className='fleft'>{c('bookmarks')}</div>
42
+ <div className='fleft'>{e('bookmarks')}</div>
46
43
  <div className='fright'>
47
44
  <Tooltip title={e('newBookmark')}>
48
45
  <PlusCircleOutlined
49
46
  {...pop1}
50
47
  />
51
48
  </Tooltip>
52
- <Tooltip title={`${m('edit')} ${c('bookmarks')}`}>
49
+ <Tooltip title={`${e('edit')} ${e('bookmarks')}`}>
53
50
  <EditOutlined
54
51
  {...pop1}
55
52
  />
56
53
  </Tooltip>
57
- <Tooltip title={c('expandAll')}>
54
+ <Tooltip title={e('expandAll')}>
58
55
  <ArrowsAltOutlined
59
56
  {...pop2}
60
57
  />
61
58
  </Tooltip>
62
- <Tooltip title={c('collapseAll')}>
59
+ <Tooltip title={e('collapseAll')}>
63
60
  <ShrinkOutlined
64
61
  {...pop3}
65
62
  />
66
63
  </Tooltip>
67
- <Tooltip title={c('pin')}>
64
+ <Tooltip title={e('pin')}>
68
65
  <PushpinOutlined
69
66
  {...prps1}
70
67
  onClick={store.handlePin}
@@ -8,9 +8,7 @@ import { pick } from 'lodash-es'
8
8
  import { EditOutlined, PushpinOutlined } from '@ant-design/icons'
9
9
  import { Tooltip } from 'antd'
10
10
 
11
- const { prefix } = window
12
- const c = prefix('common')
13
- const m = prefix('menu')
11
+ const e = window.translate
14
12
 
15
13
  export default class HistoryPanel extends Component {
16
14
  render () {
@@ -35,15 +33,15 @@ export default class HistoryPanel extends Component {
35
33
  >
36
34
  <div className='pd1y pd2t pd2x'>
37
35
  <div className='fix'>
38
- <div className='fleft'>{c('history')}</div>
36
+ <div className='fleft'>{e('history')}</div>
39
37
  <div className='fleft'>
40
- <Tooltip title={`${m('edit')} ${c('history')}`}>
38
+ <Tooltip title={`${e('edit')} ${e('history')}`}>
41
39
  <EditOutlined
42
40
  className='font16 mg1x mg2l pointer iblock control-icon icon-do-edit'
43
41
  onClick={store.handleEditHistory}
44
42
  />
45
43
  </Tooltip>
46
- <Tooltip title={c('pin')}>
44
+ <Tooltip title={e('pin')}>
47
45
  <PushpinOutlined
48
46
  {...prps1}
49
47
  onClick={store.handlePin}
@@ -26,14 +26,7 @@ import SideIcon from './side-icon'
26
26
  import SidePanel from './side-panel'
27
27
  import './sidebar.styl'
28
28
 
29
- const { prefix } = window
30
- const e = prefix('control')
31
- const c = prefix('common')
32
- const m = prefix('menu')
33
- const t = prefix('terminalThemes')
34
- const u = prefix('updater')
35
- const ss = prefix('settingSync')
36
- const b = prefix('batchOp')
29
+ const e = window.translate
37
30
 
38
31
  export default class Sidebar extends Component {
39
32
  handler = null
@@ -141,7 +134,7 @@ export default class Sidebar extends Component {
141
134
  />
142
135
  </SideIcon>
143
136
  <SideIcon
144
- title={c(settingMap.bookmarks)}
137
+ title={e(settingMap.bookmarks)}
145
138
  active={bookmarksActive}
146
139
  >
147
140
  <BookOutlined
@@ -152,7 +145,7 @@ export default class Sidebar extends Component {
152
145
  />
153
146
  </SideIcon>
154
147
  <SideIcon
155
- title={c(settingMap.history)}
148
+ title={e(settingMap.history)}
156
149
  active={historyActive}
157
150
  >
158
151
  <ClockCircleOutlined
@@ -164,7 +157,7 @@ export default class Sidebar extends Component {
164
157
  </SideIcon>
165
158
  <TransferList store={store} />
166
159
  <SideIcon
167
- title={t(settingMap.terminalThemes)}
160
+ title={e(settingMap.terminalThemes)}
168
161
  active={themeActive}
169
162
  >
170
163
  <PictureOutlined
@@ -173,13 +166,13 @@ export default class Sidebar extends Component {
173
166
  />
174
167
  </SideIcon>
175
168
  <SideIcon
176
- title={c(settingMap.setting)}
169
+ title={e(settingMap.setting)}
177
170
  active={settingActive}
178
171
  >
179
172
  <SettingOutlined className='iblock font20 control-icon' onClick={openSetting} />
180
173
  </SideIcon>
181
174
  <SideIcon
182
- title={ss('settingSync')}
175
+ title={e('settingSync')}
183
176
  active={syncActive}
184
177
  >
185
178
  <CloudSyncOutlined
@@ -189,13 +182,13 @@ export default class Sidebar extends Component {
189
182
  />
190
183
  </SideIcon>
191
184
  <SideIcon
192
- title={b('batchOp')}
185
+ title={e('batchOp')}
193
186
  active={showBatchOp}
194
187
  >
195
188
  <BarsOutlined className='iblock font20 control-icon' onClick={toggleBatchOp} />
196
189
  </SideIcon>
197
190
  <SideIcon
198
- title={m('about')}
191
+ title={e('about')}
199
192
  active={showInfoModal}
200
193
  >
201
194
  <InfoCircleOutlined
@@ -207,7 +200,7 @@ export default class Sidebar extends Component {
207
200
  !checkingRemoteVersion && !showUpgradeModal && shouldUpgrade
208
201
  ? (
209
202
  <Tooltip
210
- title={`${u('upgrading')} ${upgradePercent || 0}%`}
203
+ title={`${e('upgrading')} ${upgradePercent || 0}%`}
211
204
  placement='right'
212
205
  >
213
206
  <div