@electerm/electerm-react 1.100.60 → 1.101.16

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 (79) hide show
  1. package/client/components/bookmark-form/{bookmark-select.jsx → common/bookmark-select.jsx} +11 -44
  2. package/client/components/bookmark-form/{bookmark-category-select.jsx → common/category-select.jsx} +10 -4
  3. package/client/components/bookmark-form/{color-picker-item.jsx → common/color-picker-item.jsx} +2 -3
  4. package/client/components/bookmark-form/{color-picker.jsx → common/color-picker.jsx} +10 -46
  5. package/client/components/bookmark-form/{render-connection-hopping.jsx → common/connection-hopping.jsx} +7 -7
  6. package/client/components/bookmark-form/common/fields.jsx +202 -0
  7. package/client/components/bookmark-form/common/hex-input.jsx +22 -0
  8. package/client/components/bookmark-form/common/init-values.js +83 -0
  9. package/client/components/bookmark-form/common/profile-item.jsx +34 -0
  10. package/client/components/bookmark-form/{proxy.jsx → common/proxy.jsx} +1 -1
  11. package/client/components/bookmark-form/{use-quick-commands.jsx → common/quick-commands.jsx} +1 -1
  12. package/client/components/bookmark-form/common/rdp-alert.jsx +13 -0
  13. package/client/components/bookmark-form/common/render-auth-ssh.jsx +119 -0
  14. package/client/components/bookmark-form/{render-delayed-scripts.jsx → common/run-scripts.jsx} +6 -2
  15. package/client/components/bookmark-form/common/serial-path-selector.jsx +39 -0
  16. package/client/components/bookmark-form/{render-auth-ssh.jsx → common/ssh-auth-selector.jsx} +3 -4
  17. package/client/components/bookmark-form/common/ssh-auth-type-selector.jsx +38 -0
  18. package/client/components/bookmark-form/common/ssh-host-selector.jsx +61 -0
  19. package/client/components/bookmark-form/{render-ssh-tunnel.jsx → common/ssh-tunnels.jsx} +4 -4
  20. package/client/components/bookmark-form/common/submit-buttons.jsx +42 -0
  21. package/client/components/bookmark-form/{render-bg.jsx → common/terminal-background.jsx} +2 -2
  22. package/client/components/bookmark-form/{x11.jsx → common/x11.jsx} +2 -2
  23. package/client/components/bookmark-form/config/common-fields.js +305 -0
  24. package/client/components/bookmark-form/config/ftp.js +40 -0
  25. package/client/components/bookmark-form/config/local.js +96 -0
  26. package/client/components/bookmark-form/config/rdp.js +39 -0
  27. package/client/components/bookmark-form/config/serial.js +69 -0
  28. package/client/components/bookmark-form/config/session-config.js +23 -0
  29. package/client/components/bookmark-form/config/ssh.js +47 -0
  30. package/client/components/bookmark-form/config/telnet.js +40 -0
  31. package/client/components/bookmark-form/config/vnc.js +44 -0
  32. package/client/components/bookmark-form/config/web.js +45 -0
  33. package/client/components/bookmark-form/form-renderer.jsx +328 -0
  34. package/client/components/bookmark-form/index.jsx +32 -91
  35. package/client/components/bookmark-form/render-form.jsx +11 -0
  36. package/client/components/footer/footer-entry.jsx +1 -1
  37. package/client/components/main/main.jsx +12 -2
  38. package/client/components/profile/profile-form-ftp.jsx +35 -0
  39. package/client/components/profile/profile-form-ssh.jsx +3 -3
  40. package/client/components/profile/profile-form-telnet.jsx +1 -1
  41. package/client/components/profile/profile-tabs.jsx +4 -0
  42. package/client/components/setting-panel/setting-modal.jsx +1 -1
  43. package/client/components/setting-panel/setting-wrap.jsx +1 -1
  44. package/client/components/setting-panel/text-bg-modal.jsx +2 -2
  45. package/client/components/theme/theme-edit-slot.jsx +1 -1
  46. package/client/components/tree-list/category-color-picker.jsx +1 -1
  47. package/client/components/tree-list/move-item-modal.jsx +1 -1
  48. package/client/store/load-data.js +1 -1
  49. package/package.json +1 -1
  50. package/client/components/bookmark-form/form-ssh-common.jsx +0 -219
  51. package/client/components/bookmark-form/form-tabs.jsx +0 -66
  52. package/client/components/bookmark-form/ftp-form-ui.jsx +0 -160
  53. package/client/components/bookmark-form/ftp-form.jsx +0 -16
  54. package/client/components/bookmark-form/hex-input.jsx +0 -39
  55. package/client/components/bookmark-form/local-form-ui.jsx +0 -151
  56. package/client/components/bookmark-form/local-form.jsx +0 -16
  57. package/client/components/bookmark-form/profile-form-item.jsx +0 -43
  58. package/client/components/bookmark-form/quick-command-list.jsx +0 -31
  59. package/client/components/bookmark-form/quick-command.jsx +0 -227
  60. package/client/components/bookmark-form/rdp-form-ui.jsx +0 -179
  61. package/client/components/bookmark-form/rdp-form.jsx +0 -16
  62. package/client/components/bookmark-form/render-profile-item.jsx +0 -0
  63. package/client/components/bookmark-form/serial-form-ui.jsx +0 -309
  64. package/client/components/bookmark-form/serial-form.jsx +0 -20
  65. package/client/components/bookmark-form/sftp-enable.jsx +0 -41
  66. package/client/components/bookmark-form/ssh-form-ui.jsx +0 -121
  67. package/client/components/bookmark-form/ssh-form.jsx +0 -292
  68. package/client/components/bookmark-form/telnet-form-ui.jsx +0 -140
  69. package/client/components/bookmark-form/telnet-form.jsx +0 -16
  70. package/client/components/bookmark-form/use-form-funcs.jsx +0 -50
  71. package/client/components/bookmark-form/use-submit.jsx +0 -67
  72. package/client/components/bookmark-form/use-ui.jsx +0 -97
  73. package/client/components/bookmark-form/vnc-form-ui.jsx +0 -213
  74. package/client/components/bookmark-form/vnc-form.jsx +0 -16
  75. package/client/components/bookmark-form/web-form-ui.jsx +0 -143
  76. package/client/components/bookmark-form/web-form.jsx +0 -16
  77. /package/client/components/bookmark-form/{bookmark-group-tree-format.js → common/bookmark-group-tree-format.js} +0 -0
  78. /package/client/components/bookmark-form/{color-picker.styl → common/color-picker.styl} +0 -0
  79. /package/client/components/bookmark-form/{encodes.js → common/encodes.js} +0 -0
@@ -1,309 +0,0 @@
1
- /**
2
- * bookmark form
3
- */
4
-
5
- import { useEffect } from 'react'
6
- import { ReloadOutlined } from '@ant-design/icons'
7
- import {
8
- Tabs,
9
- Spin,
10
- Input,
11
- Select,
12
- Switch,
13
- AutoComplete,
14
- Form
15
- } from 'antd'
16
- import { formItemLayout } from '../../common/form-layout'
17
- import parseInt10 from '../../common/parse-int10'
18
- import {
19
- commonBaudRates,
20
- commonDataBits,
21
- commonStopBits,
22
- commonParities,
23
- terminalSerialType,
24
- newBookmarkIdPrefix
25
- } from '../../common/constants'
26
- import defaultSettings from '../../common/default-setting'
27
- import findBookmarkGroupId from '../../common/find-bookmark-group-id'
28
- import useSubmit from './use-submit'
29
- import useUI from './use-ui'
30
- import useQm from './use-quick-commands'
31
- import copy from 'json-deep-copy'
32
- import renderTermBg from './render-bg'
33
- import { defaults } from 'lodash-es'
34
- import { getColorFromCategory } from '../../common/get-category-color.js'
35
- import { ColorPickerItem } from './color-picker-item.jsx'
36
- import BookmarkCategorySelect from './bookmark-category-select.jsx'
37
-
38
- const FormItem = Form.Item
39
- const { Option } = Select
40
- const e = window.translate
41
-
42
- export default function SerialFormUi (props) {
43
- const [
44
- form,
45
- handleFinish,
46
- submitUi
47
- ] = useSubmit(props)
48
- useEffect(() => {
49
- if (props.formData.id.startsWith(newBookmarkIdPrefix)) {
50
- form.setFieldsValue({
51
- category: props.currentBookmarkGroupId
52
- })
53
- }
54
- }, [props.currentBookmarkGroupId])
55
- const qms = useQm(form, props.formData)
56
- const uis = useUI(props)
57
- const {
58
- id = ''
59
- } = props.formData
60
- const {
61
- bookmarkGroups = [],
62
- currentBookmarkGroupId
63
- } = props
64
- const initBookmarkGroupId = !id.startsWith(newBookmarkIdPrefix)
65
- ? findBookmarkGroupId(bookmarkGroups, id)
66
- : currentBookmarkGroupId
67
- let initialValues = copy(props.formData)
68
- const defaultValues = {
69
- color: getColorFromCategory(bookmarkGroups, currentBookmarkGroupId),
70
- baudRate: 9600,
71
- dataBits: 8,
72
- lock: true,
73
- stopBits: 1,
74
- parity: 'none',
75
- rtscts: false,
76
- xon: false,
77
- xoff: false,
78
- xany: false,
79
- type: terminalSerialType,
80
- term: defaultSettings.terminalType,
81
- displayRaw: false,
82
- category: initBookmarkGroupId,
83
- runScripts: [{}],
84
- ignoreKeyboardInteractive: false
85
- }
86
- initialValues = defaults(initialValues, defaultValues)
87
- function renderCommon () {
88
- const {
89
- bookmarkGroups = [],
90
- serials = [],
91
- loaddingSerials
92
- } = props
93
- return (
94
- <div className='pd1x'>
95
- <FormItem
96
- {...formItemLayout}
97
- label={e('title')}
98
- name='title'
99
- hasFeedback
100
- >
101
- <Input addonBefore={<ColorPickerItem />} />
102
- </FormItem>
103
- <FormItem
104
- {...formItemLayout}
105
- label='path'
106
- rules={[{
107
- required: true, message: 'path required'
108
- }]}
109
- normalize={props.trim}
110
- >
111
- <FormItem noStyle name='path'>
112
- <AutoComplete
113
- options={serials.map(d => {
114
- return {
115
- value: d.path
116
- }
117
- })}
118
- />
119
- </FormItem>
120
- <Spin spinning={loaddingSerials}>
121
- <span onClick={props.store.handleGetSerials}>
122
- <ReloadOutlined /> {e('reload')} serials
123
- </span>
124
- </Spin>
125
- </FormItem>
126
- <FormItem
127
- {...formItemLayout}
128
- label='baudRate'
129
- name='baudRate'
130
- normalize={parseInt10}
131
- >
132
- <AutoComplete
133
- options={commonBaudRates.map(d => {
134
- return {
135
- value: d + ''
136
- }
137
- })}
138
- />
139
- </FormItem>
140
- <FormItem
141
- {...formItemLayout}
142
- label='dataBits'
143
- name='dataBits'
144
- normalize={parseInt10}
145
- >
146
- <Select>
147
- {
148
- commonDataBits.map(s => {
149
- return (
150
- <Option
151
- value={s}
152
- key={s}
153
- >
154
- {s}
155
- </Option>
156
- )
157
- })
158
- }
159
- </Select>
160
- </FormItem>
161
- <FormItem
162
- {...formItemLayout}
163
- label='stopBits'
164
- name='stopBits'
165
- normalize={parseInt}
166
- >
167
- <Select>
168
- {
169
- commonStopBits.map(s => {
170
- return (
171
- <Option
172
- value={s}
173
- key={s}
174
- >
175
- {s}
176
- </Option>
177
- )
178
- })
179
- }
180
- </Select>
181
- </FormItem>
182
- <FormItem
183
- {...formItemLayout}
184
- label='parity'
185
- name='parity'
186
- >
187
- <Select>
188
- {
189
- commonParities.map(s => {
190
- return (
191
- <Option
192
- value={s}
193
- key={s}
194
- >
195
- {s}
196
- </Option>
197
- )
198
- })
199
- }
200
- </Select>
201
- </FormItem>
202
- <FormItem
203
- {...formItemLayout}
204
- label='lock'
205
- name='lock'
206
- valuePropName='checked'
207
- >
208
- <Switch />
209
- </FormItem>
210
- <FormItem
211
- {...formItemLayout}
212
- label='rtscts'
213
- name='rtscts'
214
- valuePropName='checked'
215
- >
216
- <Switch />
217
- </FormItem>
218
- <FormItem
219
- {...formItemLayout}
220
- label='xon'
221
- name='xon'
222
- valuePropName='checked'
223
- >
224
- <Switch />
225
- </FormItem>
226
- <FormItem
227
- {...formItemLayout}
228
- label='xoff'
229
- name='xoff'
230
- valuePropName='checked'
231
- >
232
- <Switch />
233
- </FormItem>
234
- <FormItem
235
- {...formItemLayout}
236
- label='xany'
237
- name='xany'
238
- valuePropName='checked'
239
- >
240
- <Switch />
241
- </FormItem>
242
- <FormItem
243
- {...formItemLayout}
244
- label={e('description')}
245
- name='description'
246
- hasFeedback
247
- >
248
- <Input.TextArea autoSize={{ minRows: 1 }} />
249
- </FormItem>
250
- <FormItem
251
- {...formItemLayout}
252
- label={e('type')}
253
- name='type'
254
- className='hide'
255
- >
256
- <Input />
257
- </FormItem>
258
- <BookmarkCategorySelect
259
- bookmarkGroups={bookmarkGroups}
260
- form={form}
261
- formItemLayout={formItemLayout}
262
- />
263
- </div>
264
- )
265
- }
266
-
267
- function renderTabs () {
268
- const items = [
269
- {
270
- key: 'auth',
271
- label: e('auth'),
272
- forceRender: true,
273
- children: renderCommon()
274
- },
275
- {
276
- key: 'settings',
277
- label: e('settings'),
278
- forceRender: true,
279
- children: (
280
- <>
281
- {uis}
282
- {renderTermBg(form)}
283
- </>
284
- )
285
- },
286
- {
287
- key: 'quickCommands',
288
- label: e('quickCommands'),
289
- forceRender: true,
290
- children: qms
291
- }
292
- ]
293
- return (
294
- <Tabs items={items} />
295
- )
296
- }
297
-
298
- return (
299
- <Form
300
- form={form}
301
- onFinish={handleFinish}
302
- initialValues={initialValues}
303
- name='serial-form'
304
- >
305
- {renderTabs()}
306
- {submitUi}
307
- </Form>
308
- )
309
- }
@@ -1,20 +0,0 @@
1
- /**
2
- * bookmark form
3
- */
4
- import BookmarkForm from './ssh-form'
5
- import SerialFormUi from './serial-form-ui'
6
-
7
- export default class SerialForm extends BookmarkForm {
8
- componentDidMount () {
9
- this.props.store.handleGetSerials()
10
- }
11
-
12
- render () {
13
- return (
14
- <SerialFormUi
15
- {...this.props}
16
- {...this.getProps()}
17
- />
18
- )
19
- }
20
- }
@@ -1,41 +0,0 @@
1
- import {
2
- Form,
3
- Switch
4
- } from 'antd'
5
-
6
- import { formItemLayout } from '../../common/form-layout'
7
-
8
- const FormItem = Form.Item
9
- const e = window.translate
10
-
11
- export default function renderEnableSftp () {
12
- return [
13
- <FormItem
14
- {...formItemLayout}
15
- label='SSH'
16
- name='enableSsh'
17
- key='ssh'
18
- valuePropName='checked'
19
- >
20
- <Switch />
21
- </FormItem>,
22
- <FormItem
23
- {...formItemLayout}
24
- label='SFTP'
25
- name='enableSftp'
26
- key='sftp'
27
- valuePropName='checked'
28
- >
29
- <Switch />
30
- </FormItem>,
31
- <FormItem
32
- {...formItemLayout}
33
- label={e('ignoreKeyboardInteractive')}
34
- name='ignoreKeyboardInteractive'
35
- key='ignoreKeyboardInteractive'
36
- valuePropName='checked'
37
- >
38
- <Switch />
39
- </FormItem>
40
- ]
41
- }
@@ -1,121 +0,0 @@
1
- /**
2
- * bookmark form
3
- */
4
- import { useState, useEffect } from 'react'
5
- import {
6
- Form
7
- } from 'antd'
8
- import {
9
- authTypeMap,
10
- newBookmarkIdPrefix,
11
- defaultEnvLang
12
- } from '../../common/constants'
13
- import encodes from './encodes'
14
- import findBookmarkGroupId from '../../common/find-bookmark-group-id'
15
- import useSubmit from './use-submit'
16
- import useUI from './use-ui'
17
- import useQm from './use-quick-commands'
18
- import copy from 'json-deep-copy'
19
- import { defaultsDeep, pick } from 'lodash-es'
20
- import renderTabs from './form-tabs'
21
- import renderCommon from './form-ssh-common'
22
- import renderEnableSftp from './sftp-enable'
23
- import renderProxy from './proxy'
24
- import renderX11 from './x11'
25
- import renderAuth from './render-auth-ssh'
26
- import renderTermBg from './render-bg'
27
- import renderSshTunnel from './render-ssh-tunnel'
28
- import renderConnectionHopping from './render-connection-hopping'
29
- import { getColorFromCategory } from '../../common/get-category-color.js'
30
- import defaultSetting from '../../common/default-setting'
31
- import './bookmark-form.styl'
32
-
33
- export default function BookmarkFormUI (props) {
34
- const [
35
- form,
36
- handleFinish,
37
- submitUi
38
- ] = useSubmit(props)
39
- useEffect(() => {
40
- if ((props.formData.id || '').startsWith(newBookmarkIdPrefix)) {
41
- form.setFieldsValue({
42
- category: props.currentBookmarkGroupId
43
- })
44
- }
45
- }, [props.currentBookmarkGroupId])
46
- const [authType, setAuthType] = useState(props.formData.authType || authTypeMap.password)
47
- const qms = useQm(form, props.formData)
48
- const uis = useUI(props)
49
- const {
50
- id = ''
51
- } = props.formData
52
- const {
53
- bookmarkGroups = [],
54
- currentBookmarkGroupId
55
- } = props
56
- const initBookmarkGroupId = !id.startsWith(newBookmarkIdPrefix)
57
- ? findBookmarkGroupId(bookmarkGroups, id)
58
- : currentBookmarkGroupId
59
- let initialValues = copy(props.formData)
60
- const defaultValues = {
61
- port: 22,
62
- authType: authTypeMap.password,
63
- id: '',
64
- color: getColorFromCategory(bookmarkGroups, currentBookmarkGroupId),
65
- term: props.store.config.terminalType,
66
- displayRaw: false,
67
- encode: encodes[0],
68
- envLang: defaultEnvLang,
69
- enableSsh: true,
70
- enableSftp: true,
71
- sshTunnels: [],
72
- runScripts: [{}],
73
- category: initBookmarkGroupId,
74
- connectionHoppings: [],
75
- serverHostKey: [],
76
- cipher: [],
77
- terminalBackground: pick(defaultSetting, [
78
- 'terminalBackgroundImagePath',
79
- 'terminalBackgroundFilterOpacity',
80
- 'terminalBackgroundFilterBlur',
81
- 'terminalBackgroundFilterBrightness',
82
- 'terminalBackgroundFilterGrayscale',
83
- 'terminalBackgroundFilterContrast',
84
- 'terminalBackgroundText',
85
- 'terminalBackgroundTextSize',
86
- 'terminalBackgroundTextColor',
87
- 'terminalBackgroundTextFontFamily'
88
- ])
89
- }
90
- initialValues = defaultsDeep(initialValues, defaultValues)
91
- function onChangeAuthType (e) {
92
- setAuthType(e.target.value)
93
- }
94
- const tprops = {
95
- ...props,
96
- uis,
97
- qms,
98
- onChangeAuthType,
99
- form,
100
- authType,
101
- renderCommon,
102
- renderEnableSftp,
103
- renderProxy,
104
- renderX11,
105
- renderAuth,
106
- renderSshTunnel,
107
- renderConnectionHopping,
108
- renderTermBg
109
- }
110
- return (
111
- <Form
112
- form={form}
113
- name='ssh-form'
114
- onFinish={handleFinish}
115
- initialValues={initialValues}
116
- >
117
- {renderTabs(tprops)}
118
- {submitUi}
119
- </Form>
120
- )
121
- }