@electerm/electerm-react 1.39.88 → 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 (101) hide show
  1. package/client/common/constants.js +2 -1
  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 +2 -3
  7. package/client/components/batch-op/batch-op.jsx +18 -36
  8. package/client/components/bookmark-form/form-ssh-common.jsx +4 -7
  9. package/client/components/bookmark-form/form-tabs.jsx +4 -8
  10. package/client/components/bookmark-form/index.jsx +5 -9
  11. package/client/components/bookmark-form/local-form-ui.jsx +3 -6
  12. package/client/components/bookmark-form/proxy.jsx +1 -2
  13. package/client/components/bookmark-form/quick-command.jsx +7 -8
  14. package/client/components/bookmark-form/rdp-form-ui.jsx +2 -4
  15. package/client/components/bookmark-form/render-auth-ssh.jsx +1 -2
  16. package/client/components/bookmark-form/render-connection-hopping.jsx +9 -11
  17. package/client/components/bookmark-form/render-delayed-scripts.jsx +1 -2
  18. package/client/components/bookmark-form/render-ssh-tunnel.jsx +9 -12
  19. package/client/components/bookmark-form/serial-form-ui.jsx +4 -8
  20. package/client/components/bookmark-form/sftp-enable.jsx +1 -2
  21. package/client/components/bookmark-form/telnet-form-ui.jsx +2 -4
  22. package/client/components/bookmark-form/tree-delete.jsx +3 -4
  23. package/client/components/bookmark-form/use-quick-commands.jsx +5 -6
  24. package/client/components/bookmark-form/use-submit.jsx +1 -2
  25. package/client/components/bookmark-form/use-ui.jsx +4 -6
  26. package/client/components/bookmark-form/vnc-form-ui.jsx +2 -4
  27. package/client/components/bookmark-form/web-form-ui.jsx +2 -4
  28. package/client/components/common/markdown.jsx +1 -1
  29. package/client/components/context-menu/context-menu.jsx +3 -4
  30. package/client/components/context-menu/menu-btn.jsx +13 -18
  31. package/client/components/footer/batch-input.jsx +1 -2
  32. package/client/components/footer/footer-entry.jsx +2 -3
  33. package/client/components/main/error-wrapper.jsx +2 -4
  34. package/client/components/main/upgrade.jsx +2 -4
  35. package/client/components/main/upgrade.styl +4 -1
  36. package/client/components/profile/profile-form-elem.jsx +28 -10
  37. package/client/components/quick-commands/quick-commands-box.jsx +1 -2
  38. package/client/components/quick-commands/quick-commands-form-elem.jsx +7 -12
  39. package/client/components/quick-commands/quick-commands-list-form.jsx +5 -6
  40. package/client/components/quick-commands/quick-commands-list.jsx +2 -3
  41. package/client/components/quick-commands/quick-commands-select.jsx +1 -2
  42. package/client/components/rdp/rdp-session.jsx +0 -3
  43. package/client/components/rdp/resolution-form.jsx +3 -6
  44. package/client/components/session/session.jsx +2 -4
  45. package/client/components/session/sessions.jsx +4 -6
  46. package/client/components/setting-panel/keywords-form.jsx +2 -3
  47. package/client/components/setting-panel/list.jsx +3 -6
  48. package/client/components/setting-panel/setting-common.jsx +10 -14
  49. package/client/components/setting-panel/setting-modal.jsx +7 -11
  50. package/client/components/setting-panel/setting-terminal.jsx +13 -16
  51. package/client/components/setting-panel/start-session-select.jsx +1 -2
  52. package/client/components/setting-panel/tab-history.jsx +2 -3
  53. package/client/components/setting-sync/data-import.jsx +4 -7
  54. package/client/components/setting-sync/data-select.jsx +4 -16
  55. package/client/components/setting-sync/setting-sync-form.jsx +8 -12
  56. package/client/components/sftp/address-bar.jsx +1 -2
  57. package/client/components/sftp/confirm-modal-store.jsx +1 -2
  58. package/client/components/sftp/file-item.jsx +6 -8
  59. package/client/components/sftp/file-mode-modal.jsx +1 -2
  60. package/client/components/sftp/file-props-modal.jsx +1 -2
  61. package/client/components/sftp/list-table-ui.jsx +1 -2
  62. package/client/components/sftp/permission-render.jsx +1 -2
  63. package/client/components/sftp/sftp-entry.jsx +21 -7
  64. package/client/components/sftp/transfer-tag.jsx +1 -2
  65. package/client/components/shortcuts/shortcuts.jsx +5 -28
  66. package/client/components/sidebar/bookmark.jsx +6 -9
  67. package/client/components/sidebar/history.jsx +4 -6
  68. package/client/components/sidebar/index.jsx +9 -16
  69. package/client/components/sidebar/info-modal.jsx +10 -15
  70. package/client/components/sidebar/transfer-history-modal.jsx +3 -6
  71. package/client/components/sidebar/transfer-list-control.jsx +1 -2
  72. package/client/components/sidebar/transfer-list.jsx +1 -2
  73. package/client/components/sidebar/transfer-modal.jsx +2 -4
  74. package/client/components/sidebar/transport-ui.jsx +1 -2
  75. package/client/components/tabs/index.jsx +28 -20
  76. package/client/components/tabs/tab.jsx +5 -9
  77. package/client/components/tabs/window-control.jsx +4 -5
  78. package/client/components/terminal/index.jsx +5 -7
  79. package/client/components/terminal/term-search.jsx +2 -3
  80. package/client/components/terminal/terminal-interactive.jsx +2 -4
  81. package/client/components/terminal-info/activity.jsx +4 -5
  82. package/client/components/terminal-info/base.jsx +3 -4
  83. package/client/components/terminal-info/terminal-info.styl +1 -0
  84. package/client/components/terminal-theme/index.jsx +6 -9
  85. package/client/components/terminal-theme/theme-list.jsx +1 -2
  86. package/client/components/text-editor/text-editor-form.jsx +4 -8
  87. package/client/components/text-editor/text-editor.jsx +2 -3
  88. package/client/components/tree-list/bookmark-transport.jsx +4 -7
  89. package/client/components/tree-list/tree-list-item.jsx +4 -7
  90. package/client/components/tree-list/tree-list.jsx +3 -6
  91. package/client/components/vnc/vnc-form.jsx +2 -4
  92. package/client/components/vnc/vnc-session.jsx +1 -2
  93. package/client/entry/basic.js +4 -6
  94. package/client/store/common.js +10 -12
  95. package/client/store/index.js +4 -7
  96. package/client/store/init-state.js +2 -3
  97. package/client/store/load-data.js +10 -0
  98. package/client/store/setting.js +2 -3
  99. package/client/store/system-menu.js +4 -6
  100. package/client/store/terminal-theme.js +2 -4
  101. package/package.json +1 -1
@@ -37,11 +37,7 @@ import { ColorPickerItem } from './color-picker-item.jsx'
37
37
 
38
38
  const FormItem = Form.Item
39
39
  const { Option } = Select
40
- const { prefix } = window
41
- const e = prefix('form')
42
- const c = prefix('common')
43
- const s = prefix('setting')
44
- const m = prefix('menu')
40
+ const e = window.translate
45
41
 
46
42
  export default function SerialFormUi (props) {
47
43
  const [
@@ -124,7 +120,7 @@ export default function SerialFormUi (props) {
124
120
  </FormItem>
125
121
  <Spin spinning={loaddingSerials}>
126
122
  <span onClick={props.store.handleGetSerials}>
127
- <ReloadOutlined /> {m('reload')} serials
123
+ <ReloadOutlined /> {e('reload')} serials
128
124
  </span>
129
125
  </Spin>
130
126
  </FormItem>
@@ -262,7 +258,7 @@ export default function SerialFormUi (props) {
262
258
  </FormItem>
263
259
  <FormItem
264
260
  {...formItemLayout}
265
- label={c('bookmarkCategory')}
261
+ label={e('bookmarkCategory')}
266
262
  name='category'
267
263
  >
268
264
  <TreeSelect
@@ -285,7 +281,7 @@ export default function SerialFormUi (props) {
285
281
  },
286
282
  {
287
283
  key: 'settings',
288
- label: s('settings'),
284
+ label: e('settings'),
289
285
  forceRender: true,
290
286
  children: uis
291
287
  },
@@ -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 renderEnableSftp () {
13
12
  return [
@@ -25,9 +25,7 @@ import { defaultsDeep, uniqBy } from 'lodash-es'
25
25
  import './bookmark-form.styl'
26
26
 
27
27
  const FormItem = Form.Item
28
- const { prefix } = window
29
- const e = prefix('form')
30
- const s = prefix('setting')
28
+ const e = window.translate
31
29
 
32
30
  export default function TelnetFormUI (props) {
33
31
  const [
@@ -125,7 +123,7 @@ export default function TelnetFormUI (props) {
125
123
  },
126
124
  {
127
125
  key: 'settings',
128
- label: s('settings'),
126
+ label: e('settings'),
129
127
  forceRender: true,
130
128
  children: uis
131
129
  },
@@ -5,8 +5,7 @@ import {
5
5
  } from 'antd'
6
6
  import { defaultBookmarkGroupId, settingMap } from '../../common/constants'
7
7
 
8
- const { prefix } = window
9
- const m = prefix('common')
8
+ const e = window.translate
10
9
 
11
10
  export default class BookmarkTreeDelete extends StartSessionSelect {
12
11
  onExpand = (expandedKeys) => {
@@ -72,12 +71,12 @@ export default class BookmarkTreeDelete extends StartSessionSelect {
72
71
  disabled={!len}
73
72
  onClick={this.handleDel}
74
73
  >
75
- {m('delSelected')} ({len})
74
+ {e('delSelected')} ({len})
76
75
  </Button>
77
76
  <Button
78
77
  onClick={this.handleCancel}
79
78
  >
80
- {m('cancel')}
79
+ {e('cancel')}
81
80
  </Button>
82
81
  </div>
83
82
  <Tree {...rProps} />
@@ -18,8 +18,7 @@ import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons'
18
18
 
19
19
  const FormItem = Form.Item
20
20
  const FormList = Form.List
21
- const { prefix } = window
22
- const t = prefix('quickCommands')
21
+ const e = window.translate
23
22
 
24
23
  export default function useQuickCmds (form, formData) {
25
24
  function renderItem (field, i, add, remove) {
@@ -35,7 +34,7 @@ export default function useQuickCmds (form, formData) {
35
34
  fieldKey={[field.fieldKey, 'first']}
36
35
  rules={[{ required: true, max: 30 }]}
37
36
  >
38
- <Input placeholder={t('quickCommandName')} />
37
+ <Input placeholder={e('quickCommandName')} />
39
38
  </FormItem>
40
39
  <FormItem
41
40
  {...field}
@@ -43,7 +42,7 @@ export default function useQuickCmds (form, formData) {
43
42
  fieldKey={[field.fieldKey, 'first']}
44
43
  rules={[{ required: true, max: 300 }]}
45
44
  >
46
- <Input placeholder={t('quickCommand')} />
45
+ <Input placeholder={e('quickCommand')} />
47
46
  </FormItem>
48
47
  <MinusCircleOutlined onClick={() => remove(field.name)} />
49
48
  </Space>
@@ -52,7 +51,7 @@ export default function useQuickCmds (form, formData) {
52
51
  return (
53
52
  <FormList
54
53
  {...formItemLayout}
55
- label={t('quickCommands')}
54
+ label={e('quickCommands')}
56
55
  name='quickCommands'
57
56
  >
58
57
  {
@@ -71,7 +70,7 @@ export default function useQuickCmds (form, formData) {
71
70
  block
72
71
  icon={<PlusOutlined />}
73
72
  >
74
- {t('newQuickCommand')}
73
+ {e('newQuickCommand')}
75
74
  </Button>
76
75
  </FormItem>
77
76
  </div>
@@ -17,8 +17,7 @@ import { tailFormItemLayout } from '../../common/form-layout'
17
17
  import useFuncs from './use-form-funcs'
18
18
 
19
19
  const FormItem = Form.Item
20
- const { prefix } = window
21
- const e = prefix('form')
20
+ const e = window.translate
22
21
 
23
22
  export default function useBookmarkSubmit (props) {
24
23
  const [
@@ -19,9 +19,7 @@ import mapper from '../../common/auto-complete-data-mapper'
19
19
  import { defaultEnvLang } from '../../common/constants'
20
20
 
21
21
  const FormItem = Form.Item
22
- const { prefix } = window
23
- const e = prefix('form')
24
- const s = prefix('setting')
22
+ const e = window.translate
25
23
 
26
24
  export default function useBookmarkFormUI (props) {
27
25
  const {
@@ -66,7 +64,7 @@ export default function useBookmarkFormUI (props) {
66
64
  </FormItem>,
67
65
  <FormItem
68
66
  {...formItemLayout}
69
- label={s('fontFamily')}
67
+ label={e('fontFamily')}
70
68
  key='fontFamily'
71
69
  name='fontFamily'
72
70
  rules={[{
@@ -78,7 +76,7 @@ export default function useBookmarkFormUI (props) {
78
76
  <FormItem
79
77
  key='fontSize'
80
78
  {...formItemLayout}
81
- label={s('fontSize')}
79
+ label={e('fontSize')}
82
80
  name='fontSize'
83
81
  >
84
82
  <InputNumber
@@ -91,7 +89,7 @@ export default function useBookmarkFormUI (props) {
91
89
  <FormItem
92
90
  key='keepaliveInterval'
93
91
  {...formItemLayout}
94
- label={s('keepaliveIntervalDesc')}
92
+ label={e('keepaliveIntervalDesc')}
95
93
  name='keepaliveInterval'
96
94
  >
97
95
  <InputNumber
@@ -27,9 +27,7 @@ import renderProxy from './proxy'
27
27
  import ConnectionHopping from './render-connection-hopping.jsx'
28
28
 
29
29
  const FormItem = Form.Item
30
- const { prefix } = window
31
- const e = prefix('form')
32
- const c = prefix('common')
30
+ const e = window.translate
33
31
 
34
32
  export default function VncFormUi (props) {
35
33
  const [
@@ -180,7 +178,7 @@ export default function VncFormUi (props) {
180
178
  </FormItem>
181
179
  <FormItem
182
180
  {...formItemLayout}
183
- label={c('bookmarkCategory')}
181
+ label={e('bookmarkCategory')}
184
182
  name='category'
185
183
  >
186
184
  <TreeSelect
@@ -22,9 +22,7 @@ import formatBookmarkGroups from './bookmark-group-tree-format'
22
22
  import findBookmarkGroupId from '../../common/find-bookmark-group-id'
23
23
 
24
24
  const FormItem = Form.Item
25
- const { prefix } = window
26
- const e = prefix('form')
27
- const c = prefix('common')
25
+ const e = window.translate
28
26
 
29
27
  export default function LocalFormUi (props) {
30
28
  const [
@@ -91,7 +89,7 @@ export default function LocalFormUi (props) {
91
89
  </FormItem>
92
90
  <FormItem
93
91
  {...formItemLayout}
94
- label={c('bookmarkCategory')}
92
+ label={e('bookmarkCategory')}
95
93
  name='category'
96
94
  >
97
95
  <TreeSelect
@@ -18,7 +18,7 @@ export default ({ text = '' }) => {
18
18
  )
19
19
  }
20
20
  return (
21
- <div className='pd1y'>
21
+ <div className='markdown-wrap'>
22
22
  {
23
23
  arr.map(render)
24
24
  }
@@ -44,8 +44,7 @@ import {
44
44
  ReloadOutlined
45
45
  } from '@ant-design/icons'
46
46
 
47
- const { prefix } = window
48
- const c = prefix('common')
47
+ const e = window.translate
49
48
 
50
49
  export default class ContextMenu extends React.PureComponent {
51
50
  state = {
@@ -288,9 +287,9 @@ export default class ContextMenu extends React.PureComponent {
288
287
  )
289
288
  return (
290
289
  <Popconfirm
291
- cancelText={c('cancel')}
290
+ cancelText={e('cancel')}
292
291
  key={`context-item-${i}-${text}`}
293
- okText={c('ok')}
292
+ okText={e('ok')}
294
293
  title={title}
295
294
  onConfirm={(e) => this.onClick(e, item)}
296
295
  >
@@ -8,12 +8,7 @@ import { commonActions } from '../../common/constants'
8
8
  import { shortcutDescExtend } from '../shortcuts/shortcut-handler.js'
9
9
  import generate from '../../common/uid'
10
10
 
11
- const { prefix } = window
12
- const e = prefix('control')
13
- const m = prefix('menu')
14
- const c = prefix('common')
15
- const t = prefix('tabs')
16
- const s = prefix('setting')
11
+ const e = window.translate
17
12
  const logo = logoRef.replace(/^\//, '')
18
13
 
19
14
  class MenuBtn extends Component {
@@ -115,7 +110,7 @@ class MenuBtn extends Component {
115
110
  {
116
111
  func: 'addTab',
117
112
  icon: 'RightSquareFilled',
118
- text: t('newTab')
113
+ text: e('newTab')
119
114
  },
120
115
  {
121
116
  func: 'onNewWindow',
@@ -128,19 +123,19 @@ class MenuBtn extends Component {
128
123
  {
129
124
  noCloseMenu: true,
130
125
  icon: 'BookOutlined',
131
- text: c('bookmarks'),
126
+ text: e('bookmarks'),
132
127
  submenu: 'Bookmark'
133
128
  },
134
129
  {
135
130
  noCloseMenu: true,
136
131
  icon: 'ClockCircleOutlined',
137
- text: c('history'),
132
+ text: e('history'),
138
133
  submenu: 'History'
139
134
  },
140
135
  {
141
136
  noCloseMenu: true,
142
137
  icon: 'BarsOutlined',
143
- text: t('sessions'),
138
+ text: e('sessions'),
144
139
  submenu: 'Tabs'
145
140
  },
146
141
  // {
@@ -149,17 +144,17 @@ class MenuBtn extends Component {
149
144
  {
150
145
  func: 'openAbout',
151
146
  icon: 'InfoCircleOutlined',
152
- text: m('about')
147
+ text: e('about')
153
148
  },
154
149
  {
155
150
  func: 'openSetting',
156
151
  icon: 'SettingOutlined',
157
- text: s('settings')
152
+ text: e('settings')
158
153
  },
159
154
  {
160
155
  func: 'openDevTools',
161
156
  icon: 'LeftSquareFilled',
162
- text: m('toggledevtools')
157
+ text: e('toggledevtools')
163
158
  },
164
159
  // {
165
160
  // type: 'hr'
@@ -170,17 +165,17 @@ class MenuBtn extends Component {
170
165
  {
171
166
  func: 'minimize',
172
167
  icon: 'SwitcherFilled',
173
- text: m('minimize')
168
+ text: e('minimize')
174
169
  },
175
170
  {
176
171
  func: 'maximize',
177
172
  icon: 'LayoutFilled',
178
- text: m('maximize')
173
+ text: e('maximize')
179
174
  },
180
175
  {
181
176
  func: 'reload',
182
177
  icon: 'ReloadOutlined',
183
- text: m('reload')
178
+ text: e('reload')
184
179
  },
185
180
  // {
186
181
  // type: 'hr'
@@ -196,12 +191,12 @@ class MenuBtn extends Component {
196
191
  {
197
192
  func: 'restart',
198
193
  icon: 'RedoOutlined',
199
- text: m('restart')
194
+ text: e('restart')
200
195
  },
201
196
  {
202
197
  func: 'close',
203
198
  icon: 'CloseOutlined',
204
- text: m('close')
199
+ text: e('close')
205
200
  }
206
201
  ]
207
202
  }
@@ -13,8 +13,7 @@ import { batchInputLsKey, commonActions } from '../../common/constants'
13
13
  import postMsg from '../../common/post-msg'
14
14
  import classNames from 'classnames'
15
15
 
16
- const { prefix } = window
17
- const e = prefix('ssh')
16
+ const e = window.translate
18
17
 
19
18
  export default class BatchInput extends Component {
20
19
  state = {
@@ -14,8 +14,7 @@ const {
14
14
  Option
15
15
  } = Select
16
16
 
17
- const { prefix } = window
18
- const f = prefix('form')
17
+ const e = window.translate
19
18
 
20
19
  export default class FooterEntry extends Component {
21
20
  handleInfoPanel = () => {
@@ -80,7 +79,7 @@ export default class FooterEntry extends Component {
80
79
  style: {
81
80
  minWidth: 30
82
81
  },
83
- placeholder: f('encode'),
82
+ placeholder: e('encode'),
84
83
  defaultValue: this.props.currentTab?.encode,
85
84
  onSelect: this.handleSwitchEncoding,
86
85
  size: 'small',
@@ -5,9 +5,7 @@ import {
5
5
  logoPath1
6
6
  } from '../../common/constants'
7
7
 
8
- const { prefix } = window
9
- const e = prefix('main')
10
- const m = prefix('menu')
8
+ const e = window.translate
11
9
 
12
10
  export default class ErrorBoundary extends React.PureComponent {
13
11
  constructor (props) {
@@ -46,7 +44,7 @@ export default class ErrorBoundary extends React.PureComponent {
46
44
  className='iblock'
47
45
  icon={<ReloadOutlined />}
48
46
  >
49
- {m('reload')}
47
+ {e('reload')}
50
48
  </Button>
51
49
  </h1>
52
50
  <div className='pd1y'>{message}</div>
@@ -19,12 +19,10 @@ import Markdown from '../common/markdown'
19
19
  import downloadMirrors from '../../common/download-mirrors'
20
20
  import './upgrade.styl'
21
21
 
22
- const { prefix } = window
22
+ const e = window.translate
23
23
  const {
24
24
  homepage
25
25
  } = packInfo
26
- const e = prefix('updater')
27
- const c = prefix('common')
28
26
 
29
27
  export default class Upgrade extends PureComponent {
30
28
  state = {
@@ -347,7 +345,7 @@ export default class Upgrade extends PureComponent {
347
345
  >
348
346
  {
349
347
  upgrading
350
- ? <span>{`${e('upgrading')}... ${upgradePercent || 0}% ${c('cancel')}`}</span>
348
+ ? <span>{`${e('upgrading')}... ${upgradePercent || 0}% ${e('cancel')}`}</span>
351
349
  : e('upgrade')
352
350
  }
353
351
  </Button>
@@ -22,4 +22,7 @@
22
22
  .upgrade-panel-body
23
23
  padding 10px 15px
24
24
  .upgrade-panel-title
25
- border-bottom 1px solid darken(main, 30%)
25
+ border-bottom 1px solid darken(main, 30%)
26
+ .markdown-wrap
27
+ max-height 40vh
28
+ overflow-y auto
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  Form,
3
3
  message,
4
- Button
4
+ Button,
5
+ Input
5
6
  } from 'antd'
6
- import generate from '../../common/uid'
7
7
  import InputAutoFocus from '../common/input-auto-focus'
8
8
  import renderAuth from '../bookmark-form/render-auth-ssh'
9
9
  import { formItemLayout } from '../../common/form-layout'
@@ -11,19 +11,25 @@ import {
11
11
  settingMap
12
12
  } from '../../common/constants'
13
13
  const FormItem = Form.Item
14
- const { prefix } = window
15
- const e = prefix('form')
16
- const s = prefix('setting')
17
- const ss = prefix('sftp')
14
+ const e = window.translate
18
15
 
19
16
  export default function QuickCommandForm (props) {
20
17
  const [form] = Form.useForm()
21
- const { autofocustrigger } = props.store
18
+ const { autofocustrigger, profiles } = props.store
19
+ function genId () {
20
+ let count = profiles.length ? profiles.length : ''
21
+ let id = 'PROFILE' + count
22
+ while (profiles.find(d => d.id === id)) {
23
+ count = count + 1
24
+ id = 'PROFILE' + count
25
+ }
26
+ return id
27
+ }
22
28
  async function handleSubmit (res) {
23
29
  const { formData } = props
24
30
  const update1 = {
25
31
  ...res,
26
- id: generate()
32
+ id: genId()
27
33
  }
28
34
  if (formData.id) {
29
35
  props.store.editItem(formData.id, res, settingMap.profiles)
@@ -34,7 +40,7 @@ export default function QuickCommandForm (props) {
34
40
  name: e('profile')
35
41
  })
36
42
  }
37
- message.success(s('saved'))
43
+ message.success(e('saved'))
38
44
  }
39
45
  return (
40
46
  <Form
@@ -44,6 +50,7 @@ export default function QuickCommandForm (props) {
44
50
  layout='vertical'
45
51
  initialValues={props.formData}
46
52
  >
53
+ <p>ID: {props.formData.id || genId()}</p>
47
54
  <FormItem
48
55
  label={e('profileName')}
49
56
  {...formItemLayout}
@@ -60,6 +67,17 @@ export default function QuickCommandForm (props) {
60
67
  autofocustrigger={autofocustrigger}
61
68
  />
62
69
  </FormItem>
70
+ <FormItem
71
+ {...formItemLayout}
72
+ label={e('username')}
73
+ hasFeedback
74
+ name='username'
75
+ rules={[{
76
+ max: 128, message: '128 chars max'
77
+ }]}
78
+ >
79
+ <Input />
80
+ </FormItem>
63
81
  {
64
82
  renderAuth({
65
83
  store: props.store,
@@ -78,7 +96,7 @@ export default function QuickCommandForm (props) {
78
96
  type='primary'
79
97
  htmlType='submit'
80
98
  >
81
- {ss('submit')}
99
+ {e('submit')}
82
100
  </Button>
83
101
  </FormItem>
84
102
  </Form>
@@ -16,8 +16,7 @@ import {
16
16
  import classNames from 'classnames'
17
17
  import './qm.styl'
18
18
 
19
- const { prefix } = window
20
- const e = prefix('quickCommands')
19
+ const e = window.translate
21
20
  const addQuickCommands = 'addQuickCommands'
22
21
  const { Option } = Select
23
22
 
@@ -19,10 +19,7 @@ import {
19
19
 
20
20
  const FormItem = Form.Item
21
21
  const { Option } = Select
22
- const { prefix } = window
23
- const e = prefix('form')
24
- const t = prefix('quickCommands')
25
- const s = prefix('setting')
22
+ const e = window.translate
26
23
  const shortcutsDefaults = shortcutsDefaultsGen()
27
24
 
28
25
  export default function QuickCommandForm (props) {
@@ -38,7 +35,6 @@ export default function QuickCommandForm (props) {
38
35
  setShortcut(value)
39
36
  }
40
37
  const handleClear = () => {
41
- console.log('handleClear')
42
38
  form.setFieldsValue({
43
39
  shortcut: ''
44
40
  })
@@ -107,10 +103,10 @@ export default function QuickCommandForm (props) {
107
103
  store.addQuickCommand(update1)
108
104
  store.setSettingItem({
109
105
  id: '',
110
- name: t('newQuickCommand')
106
+ name: e('newQuickCommand')
111
107
  })
112
108
  }
113
- message.success(s('saved'))
109
+ message.success(e('saved'))
114
110
  }
115
111
  const initialValues = formData
116
112
  if (!initialValues.labels) {
@@ -123,7 +119,6 @@ export default function QuickCommandForm (props) {
123
119
  delay: 100
124
120
  }]
125
121
  }
126
- console.log('initialValues', initialValues, formData)
127
122
  const editorProps = {
128
123
  data: {
129
124
  name: uid,
@@ -144,7 +139,7 @@ export default function QuickCommandForm (props) {
144
139
  initialValues={initialValues}
145
140
  >
146
141
  <FormItem
147
- label={t('quickCommandName')}
142
+ label={e('quickCommandName')}
148
143
  rules={[{
149
144
  max: 60, message: '60 chars max'
150
145
  }, {
@@ -161,7 +156,7 @@ export default function QuickCommandForm (props) {
161
156
  {renderQm()}
162
157
  <FormItem
163
158
  name='labels'
164
- label={t('label')}
159
+ label={e('label')}
165
160
  >
166
161
  <Select
167
162
  mode='tags'
@@ -178,7 +173,7 @@ export default function QuickCommandForm (props) {
178
173
  </Select>
179
174
  </FormItem>
180
175
  <FormItem
181
- label={s('settingShortcuts')}
176
+ label={e('settingShortcuts')}
182
177
  name='shortcut'
183
178
  >
184
179
  <div>
@@ -189,7 +184,7 @@ export default function QuickCommandForm (props) {
189
184
  </div>
190
185
  </FormItem>
191
186
  <FormItem
192
- label={t('inputOnly')}
187
+ label={e('inputOnly')}
193
188
  name='inputOnly'
194
189
  valuePropName='checked'
195
190
  >
@@ -14,8 +14,7 @@ import { useRef } from 'react'
14
14
 
15
15
  const FormItem = Form.Item
16
16
  const FormList = Form.List
17
- const { prefix } = window
18
- const t = prefix('quickCommands')
17
+ const e = window.translate
19
18
 
20
19
  export default function renderQm () {
21
20
  const focused = useRef(0)
@@ -34,7 +33,7 @@ export default function renderQm () {
34
33
  min={1}
35
34
  step={1}
36
35
  max={65535}
37
- addonBefore={t('delay')}
36
+ addonBefore={e('delay')}
38
37
  placeholder={100}
39
38
  className='compact-input'
40
39
  />
@@ -47,7 +46,7 @@ export default function renderQm () {
47
46
  >
48
47
  <Input.TextArea
49
48
  rows={1}
50
- placeholder={t('quickCommand')}
49
+ placeholder={e('quickCommand')}
51
50
  className='compact-input qm-input'
52
51
  onFocus={() => {
53
52
  focused.current = i
@@ -100,7 +99,7 @@ export default function renderQm () {
100
99
  })
101
100
  const label = (
102
101
  <div>
103
- {t('commonCommands')}
102
+ {e('commonCommands')}
104
103
  <HelpIcon
105
104
  title={cmds}
106
105
  />
@@ -127,7 +126,7 @@ export default function renderQm () {
127
126
  block
128
127
  icon={<PlusOutlined />}
129
128
  >
130
- {t('quickCommand')}
129
+ {e('quickCommand')}
131
130
  </Button>
132
131
  </FormItem>
133
132
  </div>