@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
@@ -0,0 +1,305 @@
1
+ /**
2
+ * Common field definitions shared across multiple configs
3
+ * Reduces duplication and ensures consistency
4
+ */
5
+ import { terminalTypes } from '../../../common/constants'
6
+ import defaultSettings from '../../../common/default-setting'
7
+ import encodes from '../common/encodes'
8
+ import { isEmpty } from 'lodash-es'
9
+
10
+ const e = window.translate
11
+
12
+ // Common individual fields
13
+ export const commonFields = {
14
+ // Basic connection fields
15
+ host: {
16
+ type: 'colorTitle',
17
+ name: 'host',
18
+ label: e('host'),
19
+ rules: [{ required: true, message: e('host') + ' required' }]
20
+ },
21
+
22
+ colorTitle: {
23
+ type: 'colorTitle',
24
+ name: 'title',
25
+ label: e('title')
26
+ },
27
+
28
+ title: {
29
+ type: 'input',
30
+ name: 'title',
31
+ label: e('title')
32
+ },
33
+
34
+ username: {
35
+ type: 'input',
36
+ name: 'username',
37
+ label: e('username')
38
+ },
39
+
40
+ password: {
41
+ type: 'password',
42
+ name: 'password',
43
+ label: e('password')
44
+ },
45
+
46
+ port: {
47
+ type: 'number',
48
+ name: 'port',
49
+ label: e('port'),
50
+ rules: [{ required: true, message: 'port required' }]
51
+ },
52
+
53
+ description: {
54
+ type: 'textarea',
55
+ name: 'description',
56
+ label: e('description')
57
+ },
58
+
59
+ category: {
60
+ type: 'categorySelect',
61
+ name: 'category',
62
+ label: e('category')
63
+ },
64
+
65
+ type: {
66
+ type: 'input',
67
+ name: 'type',
68
+ label: 'type',
69
+ hidden: true
70
+ },
71
+
72
+ // SSH/Terminal specific fields
73
+ setEnv: {
74
+ type: 'input',
75
+ name: 'setEnv',
76
+ label: 'SetEnv',
77
+ props: { placeholder: 'SEC=xxx BEC=xxxx' }
78
+ },
79
+
80
+ startDirectoryLocal: {
81
+ type: 'input',
82
+ name: 'startDirectoryLocal',
83
+ label: `${e('startDirectory')}:${e('local')}`
84
+ },
85
+
86
+ startDirectory: {
87
+ type: 'input',
88
+ name: 'startDirectory',
89
+ label: `${e('startDirectory')}:${e('remote')}`
90
+ },
91
+
92
+ interactiveValues: {
93
+ type: 'textarea',
94
+ name: 'interactiveValues',
95
+ label: e('interactiveValues')
96
+ },
97
+
98
+ encode: {
99
+ type: 'select',
100
+ name: 'encode',
101
+ label: e('encode'),
102
+ options: encodes.map(k => ({ label: k.toUpperCase(), value: k }))
103
+ },
104
+
105
+ // Terminal UI settings
106
+ envLang: {
107
+ type: 'input',
108
+ name: 'envLang',
109
+ label: 'ENV:LANG',
110
+ rules: [{ max: 130, message: '130 chars max' }],
111
+ props: { placeholder: 'en_US.UTF-8' }
112
+ },
113
+
114
+ terminalType: {
115
+ type: 'autocomplete',
116
+ name: 'term',
117
+ label: e('terminalType'),
118
+ rules: [{ required: true, message: 'terminal type required' }],
119
+ options: terminalTypes.map(t => ({ label: t, value: t }))
120
+ },
121
+
122
+ displayRaw: {
123
+ type: 'switch',
124
+ name: 'displayRaw',
125
+ label: e('displayRaw'),
126
+ valuePropName: 'checked'
127
+ },
128
+
129
+ fontFamily: {
130
+ type: 'input',
131
+ name: 'fontFamily',
132
+ label: e('fontFamily'),
133
+ rules: [{ max: 130, message: '130 chars max' }],
134
+ props: { placeholder: defaultSettings.fontFamily }
135
+ },
136
+
137
+ fontSize: {
138
+ type: 'number',
139
+ name: 'fontSize',
140
+ label: e('fontSize'),
141
+ props: {
142
+ min: 9,
143
+ max: 65535,
144
+ step: 1,
145
+ placeholder: defaultSettings.fontSize
146
+ }
147
+ },
148
+
149
+ keepaliveInterval: {
150
+ type: 'number',
151
+ name: 'keepaliveInterval',
152
+ label: e('keepaliveIntervalDesc'),
153
+ props: {
154
+ min: 0,
155
+ max: 20000000,
156
+ step: 1000
157
+ }
158
+ },
159
+
160
+ terminalBackground: {
161
+ type: 'terminalBackground',
162
+ name: 'terminalBackground',
163
+ label: e('terminalBackgroundImage')
164
+ },
165
+
166
+ proxy: {
167
+ type: 'proxy',
168
+ name: '__proxy__',
169
+ label: e('proxy')
170
+ },
171
+
172
+ x11: {
173
+ type: 'x11',
174
+ name: '__x11__',
175
+ label: 'x11'
176
+ },
177
+
178
+ // Dynamic sections
179
+ quickCommands: {
180
+ type: 'quickCommands',
181
+ name: '__quick__',
182
+ label: ''
183
+ },
184
+
185
+ sshTunnels: {
186
+ type: 'sshTunnels',
187
+ name: '__tunnels__',
188
+ label: ''
189
+ },
190
+
191
+ connectionHopping: {
192
+ type: 'connectionHopping',
193
+ name: '__hopping__',
194
+ label: ''
195
+ },
196
+
197
+ runScripts: {
198
+ type: 'runScripts',
199
+ name: 'runScripts',
200
+ label: ''
201
+ }
202
+ }
203
+
204
+ // Common field groups for settings tabs
205
+ export const terminalSettings = [
206
+ commonFields.envLang,
207
+ commonFields.terminalType,
208
+ commonFields.displayRaw,
209
+ commonFields.fontFamily,
210
+ commonFields.fontSize,
211
+ commonFields.keepaliveInterval,
212
+ commonFields.terminalBackground
213
+ ]
214
+
215
+ export const sshSettings = [
216
+ {
217
+ type: 'switch',
218
+ name: 'enableSsh',
219
+ label: 'SSH',
220
+ valuePropName: 'checked'
221
+ },
222
+ {
223
+ type: 'switch',
224
+ name: 'enableSftp',
225
+ label: 'SFTP',
226
+ valuePropName: 'checked'
227
+ },
228
+ {
229
+ type: 'switch',
230
+ name: 'ignoreKeyboardInteractive',
231
+ label: e('ignoreKeyboardInteractive'),
232
+ valuePropName: 'checked'
233
+ },
234
+ ...terminalSettings.slice(0, -1), // All except terminalBackground
235
+ commonFields.proxy,
236
+ commonFields.x11,
237
+ commonFields.terminalBackground
238
+ ]
239
+
240
+ // Common auth fields
241
+ export const basicAuthFields = [
242
+ commonFields.host,
243
+ commonFields.username,
244
+ commonFields.password,
245
+ commonFields.port,
246
+ commonFields.category,
247
+ commonFields.title,
248
+ commonFields.description,
249
+ commonFields.type
250
+ ]
251
+
252
+ export const sshAuthFields = [
253
+ commonFields.category,
254
+ commonFields.title,
255
+ { ...commonFields.host, type: 'sshHostSelector' },
256
+ commonFields.username,
257
+ { type: 'sshAuthTypeSelector', name: 'authType', label: '' },
258
+ { type: 'sshAuthSelector', name: '__auth__', label: '', formItemName: 'password' },
259
+ commonFields.port,
260
+ commonFields.runScripts,
261
+ commonFields.description,
262
+ commonFields.setEnv,
263
+ commonFields.startDirectoryLocal,
264
+ commonFields.startDirectory,
265
+ commonFields.interactiveValues,
266
+ commonFields.encode,
267
+ commonFields.type
268
+ ]
269
+
270
+ // Telnet auth fields - similar to SSH but with filtered auth types (no privateKey)
271
+ export const telnetAuthFields = [
272
+ commonFields.category,
273
+ commonFields.host,
274
+ commonFields.username,
275
+ commonFields.password,
276
+ { type: 'profileItem', name: '__profile__', label: '', profileFilter: d => !isEmpty(d.telnet) },
277
+ commonFields.port,
278
+ commonFields.title,
279
+ commonFields.description,
280
+ commonFields.setEnv,
281
+ commonFields.startDirectoryLocal,
282
+ commonFields.startDirectory,
283
+ commonFields.interactiveValues,
284
+ commonFields.encode,
285
+ commonFields.type
286
+ ]
287
+
288
+ // Common tab configurations - functions to ensure translation happens at render time
289
+ export const quickCommandsTab = () => ({
290
+ key: 'quickCommands',
291
+ label: e('quickCommands'),
292
+ fields: [commonFields.quickCommands]
293
+ })
294
+
295
+ export const sshTunnelTab = () => ({
296
+ key: 'tunnel',
297
+ label: e('sshTunnel'),
298
+ fields: [commonFields.sshTunnels]
299
+ })
300
+
301
+ export const connectionHoppingTab = () => ({
302
+ key: 'connectionHopping',
303
+ label: e('connectionHopping'),
304
+ fields: [commonFields.connectionHopping]
305
+ })
@@ -0,0 +1,40 @@
1
+ import { formItemLayout } from '../../../common/form-layout.js'
2
+ import { terminalFtpType } from '../../../common/constants.js'
3
+ import { createBaseInitValues } from '../common/init-values.js'
4
+ import { commonFields } from './common-fields.js'
5
+ import { isEmpty } from 'lodash-es'
6
+
7
+ const e = window.translate
8
+
9
+ const ftpConfig = {
10
+ key: 'ftp',
11
+ type: terminalFtpType,
12
+ initValues: (props) => {
13
+ return createBaseInitValues(props, terminalFtpType, {
14
+ port: 21,
15
+ user: '',
16
+ password: '',
17
+ secure: false
18
+ })
19
+ },
20
+ layout: formItemLayout,
21
+ tabs: () => [
22
+ {
23
+ key: 'auth',
24
+ label: e('auth'),
25
+ fields: [
26
+ commonFields.category,
27
+ commonFields.colorTitle,
28
+ { type: 'input', name: 'host', label: e('host'), rules: [{ required: true, message: e('host') + ' required' }] },
29
+ commonFields.port,
30
+ { type: 'profileItem', name: '__profile__', label: '', profileFilter: d => !isEmpty(d.ftp) },
31
+ { type: 'input', name: 'user', label: e('username') },
32
+ { type: 'password', name: 'password', label: e('password') },
33
+ { type: 'switch', name: 'secure', label: e('secure'), valuePropName: 'checked' },
34
+ commonFields.type
35
+ ]
36
+ }
37
+ ]
38
+ }
39
+
40
+ export default ftpConfig
@@ -0,0 +1,96 @@
1
+ import { formItemLayout } from '../../../common/form-layout.js'
2
+ import { terminalLocalType, terminalTypes } from '../../../common/constants.js'
3
+ import { createBaseInitValues, getTerminalDefaults, getSshDefaults } from '../common/init-values.js'
4
+ import defaultSettings from '../../../common/default-setting.js'
5
+ import { commonFields } from './common-fields.js'
6
+
7
+ const e = window.translate
8
+
9
+ const localConfig = {
10
+ key: 'local',
11
+ type: terminalLocalType,
12
+ initValues: (props) => {
13
+ const { store } = props
14
+ return createBaseInitValues(props, terminalLocalType, {
15
+ ...getTerminalDefaults(store),
16
+ ...getSshDefaults()
17
+ })
18
+ },
19
+ layout: formItemLayout,
20
+ tabs: () => [
21
+ {
22
+ key: 'auth',
23
+ label: e('auth'),
24
+ fields: [
25
+ commonFields.category,
26
+ commonFields.colorTitle,
27
+ commonFields.description,
28
+ { type: 'runScripts', name: 'runScripts', label: '' },
29
+ { type: 'input', name: 'type', label: 'type', hidden: true }
30
+ ]
31
+ },
32
+ {
33
+ key: 'settings',
34
+ label: e('settings'),
35
+ fields: [
36
+ {
37
+ type: 'input',
38
+ name: 'env.LANG',
39
+ label: 'ENV:LANG',
40
+ props: { maxLength: 130 }
41
+ },
42
+ {
43
+ type: 'autocomplete',
44
+ name: 'term',
45
+ label: e('terminalType'),
46
+ rules: [{ required: true, message: 'terminal type required' }],
47
+ options: terminalTypes.map(t => ({ label: t, value: t }))
48
+ },
49
+ {
50
+ type: 'switch',
51
+ name: 'displayRaw',
52
+ label: e('displayRaw'),
53
+ valuePropName: 'checked'
54
+ },
55
+ {
56
+ type: 'input',
57
+ name: 'fontFamily',
58
+ label: e('fontFamily'),
59
+ rules: [{ max: 130, message: '130 chars max' }],
60
+ props: { placeholder: defaultSettings.fontFamily }
61
+ },
62
+ {
63
+ type: 'number',
64
+ name: 'fontSize',
65
+ label: e('fontSize'),
66
+ props: {
67
+ min: 9,
68
+ max: 65535,
69
+ step: 1,
70
+ placeholder: defaultSettings.fontSize
71
+ }
72
+ },
73
+ {
74
+ type: 'number',
75
+ name: 'keepaliveInterval',
76
+ label: e('keepaliveIntervalDesc'),
77
+ props: {
78
+ min: 0,
79
+ max: 20000000,
80
+ step: 1000
81
+ }
82
+ },
83
+ { type: 'terminalBackground', name: 'terminalBackground', label: e('terminalBackgroundImage') }
84
+ ]
85
+ },
86
+ {
87
+ key: 'quickCommands',
88
+ label: e('quickCommands'),
89
+ fields: [
90
+ { type: 'quickCommands', name: '__quick__', label: '' }
91
+ ]
92
+ }
93
+ ]
94
+ }
95
+
96
+ export default localConfig
@@ -0,0 +1,39 @@
1
+ import { formItemLayout } from '../../../common/form-layout.js'
2
+ import { terminalRdpType } from '../../../common/constants.js'
3
+ import { createBaseInitValues } from '../common/init-values.js'
4
+ import { isEmpty } from 'lodash-es'
5
+ import { commonFields } from './common-fields.js'
6
+
7
+ const e = window.translate
8
+
9
+ const rdpConfig = {
10
+ key: 'rdp',
11
+ type: terminalRdpType,
12
+ initValues: (props) => {
13
+ return createBaseInitValues(props, terminalRdpType, {
14
+ port: 3389
15
+ })
16
+ },
17
+ layout: formItemLayout,
18
+ tabs: () => [
19
+ {
20
+ key: 'auth',
21
+ label: e('auth'),
22
+ fields: [
23
+ { type: 'rdpWarning', name: 'rdpWarning' },
24
+ commonFields.category,
25
+ commonFields.colorTitle,
26
+ { type: 'input', name: 'host', label: e('host'), rules: [{ required: true, message: e('host') + ' required' }] },
27
+ commonFields.port,
28
+ { type: 'profileItem', name: '__profile__', label: '', profileFilter: d => !isEmpty(d.rdp) },
29
+ { ...commonFields.username, rules: [{ required: true, message: e('username') + ' required' }] },
30
+ { ...commonFields.password, rules: [{ required: true, message: e('password') + ' required' }] },
31
+ commonFields.description,
32
+ { type: 'input', name: 'domain', label: e('domain') },
33
+ commonFields.type
34
+ ]
35
+ }
36
+ ]
37
+ }
38
+
39
+ export default rdpConfig
@@ -0,0 +1,69 @@
1
+ import { formItemLayout } from '../../../common/form-layout.js'
2
+ import { terminalSerialType, commonBaudRates, commonDataBits, commonStopBits, commonParities } from '../../../common/constants.js'
3
+ import defaultSettings from '../../../common/default-setting.js'
4
+ import { createBaseInitValues, getTerminalBackgroundDefaults } from '../common/init-values.js'
5
+ import { commonFields } from './common-fields.js'
6
+
7
+ const e = window.translate
8
+
9
+ const serialConfig = {
10
+ key: 'serial',
11
+ type: terminalSerialType,
12
+ initValues: (props) => {
13
+ return createBaseInitValues(props, terminalSerialType, {
14
+ baudRate: 9600,
15
+ dataBits: 8,
16
+ lock: true,
17
+ stopBits: 1,
18
+ parity: 'none',
19
+ rtscts: false,
20
+ xon: false,
21
+ xoff: false,
22
+ xany: false,
23
+ term: defaultSettings.terminalType,
24
+ displayRaw: false,
25
+ runScripts: [{}],
26
+ ignoreKeyboardInteractive: false,
27
+ ...getTerminalBackgroundDefaults(defaultSettings)
28
+ })
29
+ },
30
+ layout: formItemLayout,
31
+ tabs: () => [
32
+ {
33
+ key: 'auth',
34
+ label: e('auth'),
35
+ fields: [
36
+ commonFields.category,
37
+ commonFields.colorTitle,
38
+ { type: 'serialPathSelector', name: 'path', label: 'path', rules: [{ required: true, message: 'path required' }] },
39
+ { type: 'autocomplete', name: 'baudRate', label: 'baudRate', options: commonBaudRates.map(d => ({ value: d })) },
40
+ { type: 'select', name: 'dataBits', label: 'dataBits', options: commonDataBits.map(d => ({ value: d, label: d })) },
41
+ { type: 'select', name: 'stopBits', label: 'stopBits', options: commonStopBits.map(d => ({ value: d, label: d })) },
42
+ { type: 'select', name: 'parity', label: 'parity', options: commonParities.map(d => ({ value: d, label: d })) },
43
+ { type: 'switch', name: 'lock', label: 'lock', valuePropName: 'checked' },
44
+ { type: 'switch', name: 'rtscts', label: 'rtscts', valuePropName: 'checked' },
45
+ { type: 'switch', name: 'xon', label: 'xon', valuePropName: 'checked' },
46
+ { type: 'switch', name: 'xoff', label: 'xoff', valuePropName: 'checked' },
47
+ { type: 'switch', name: 'xany', label: 'xany', valuePropName: 'checked' },
48
+ commonFields.description,
49
+ { type: 'input', name: 'type', label: 'type', hidden: true }
50
+ ]
51
+ },
52
+ {
53
+ key: 'settings',
54
+ label: e('settings'),
55
+ fields: [
56
+ { type: 'terminalBackground', name: 'terminalBackground', label: e('terminalBackgroundImage') }
57
+ ]
58
+ },
59
+ {
60
+ key: 'quickCommands',
61
+ label: e('quickCommands'),
62
+ fields: [
63
+ { type: 'quickCommands', name: '__quick__', label: '' }
64
+ ]
65
+ }
66
+ ]
67
+ }
68
+
69
+ export default serialConfig
@@ -0,0 +1,23 @@
1
+ // Config for each session type to drive rendering
2
+ import { connectionMap } from '../../../common/constants'
3
+ import ssh from './ssh'
4
+ import web from './web'
5
+ import vnc from './vnc'
6
+ import telnet from './telnet'
7
+ import serial from './serial'
8
+ import local from './local'
9
+ import rdp from './rdp'
10
+ import ftp from './ftp'
11
+
12
+ const sessionConfig = {
13
+ [connectionMap.ssh]: ssh,
14
+ [connectionMap.telnet]: telnet,
15
+ [connectionMap.serial]: serial,
16
+ [connectionMap.local]: local,
17
+ [connectionMap.vnc]: vnc,
18
+ [connectionMap.rdp]: rdp,
19
+ [connectionMap.ftp]: ftp,
20
+ [connectionMap.web]: web
21
+ }
22
+
23
+ export default sessionConfig
@@ -0,0 +1,47 @@
1
+ // SSH config using common fields
2
+ import { formItemLayout } from '../../../common/form-layout.js'
3
+ import { connectionMap, authTypeMap, defaultEnvLang } from '../../../common/constants.js'
4
+ import defaultSetting from '../../../common/default-setting.js'
5
+ import { createBaseInitValues, getTerminalDefaults, getSshDefaults, getTerminalBackgroundDefaults } from '../common/init-values.js'
6
+ import { sshAuthFields, sshSettings, quickCommandsTab, sshTunnelTab, connectionHoppingTab } from './common-fields.js'
7
+
8
+ const e = window.translate
9
+
10
+ const sshConfig = {
11
+ key: connectionMap.ssh,
12
+ type: connectionMap.ssh,
13
+ initValues: (props) => {
14
+ const { store } = props
15
+ return createBaseInitValues(props, connectionMap.ssh, {
16
+ port: 22,
17
+ authType: authTypeMap.password,
18
+ id: '',
19
+ envLang: defaultEnvLang,
20
+ enableSftp: true,
21
+ sshTunnels: [],
22
+ connectionHoppings: [],
23
+ serverHostKey: [],
24
+ cipher: [],
25
+ ...getTerminalDefaults(store),
26
+ ...getSshDefaults(),
27
+ ...getTerminalBackgroundDefaults(defaultSetting)
28
+ })
29
+ },
30
+ layout: formItemLayout,
31
+ tabs: () => [
32
+ {
33
+ key: 'auth',
34
+ label: e('auth'),
35
+ fields: sshAuthFields
36
+ },
37
+ {
38
+ key: 'settings',
39
+ label: e('settings'),
40
+ fields: sshSettings
41
+ },
42
+ quickCommandsTab(),
43
+ sshTunnelTab(),
44
+ connectionHoppingTab()
45
+ ]
46
+ }
47
+ export default sshConfig
@@ -0,0 +1,40 @@
1
+ import { formItemLayout } from '../../../common/form-layout.js'
2
+ import { terminalTelnetType, authTypeMap } from '../../../common/constants.js'
3
+ import defaultSettings from '../../../common/default-setting.js'
4
+ import { createBaseInitValues, getSshDefaults, getTerminalBackgroundDefaults } from '../common/init-values.js'
5
+ import { telnetAuthFields, terminalSettings, quickCommandsTab } from './common-fields.js'
6
+
7
+ const e = window.translate
8
+
9
+ const telnetConfig = {
10
+ key: 'telnet',
11
+ type: terminalTelnetType,
12
+ initValues: (props) => {
13
+ return createBaseInitValues(props, terminalTelnetType, {
14
+ port: 23,
15
+ id: '',
16
+ username: 'root',
17
+ password: 'guest',
18
+ authType: authTypeMap.password,
19
+ term: defaultSettings.terminalType,
20
+ ...getSshDefaults(),
21
+ ...getTerminalBackgroundDefaults(defaultSettings)
22
+ })
23
+ },
24
+ layout: formItemLayout,
25
+ tabs: () => [
26
+ {
27
+ key: 'auth',
28
+ label: e('auth'),
29
+ fields: telnetAuthFields
30
+ },
31
+ {
32
+ key: 'settings',
33
+ label: e('settings'),
34
+ fields: terminalSettings
35
+ },
36
+ quickCommandsTab()
37
+ ]
38
+ }
39
+
40
+ export default telnetConfig