@electerm/electerm-react 1.100.56 → 1.101.10

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 (84) hide show
  1. package/client/common/check-skip-src.js +16 -0
  2. package/client/components/bookmark-form/{bookmark-select.jsx → common/bookmark-select.jsx} +11 -44
  3. package/client/components/bookmark-form/{bookmark-category-select.jsx → common/category-select.jsx} +10 -4
  4. package/client/components/bookmark-form/{color-picker-item.jsx → common/color-picker-item.jsx} +2 -3
  5. package/client/components/bookmark-form/{color-picker.jsx → common/color-picker.jsx} +10 -46
  6. package/client/components/bookmark-form/{render-connection-hopping.jsx → common/connection-hopping.jsx} +7 -7
  7. package/client/components/bookmark-form/common/fields.jsx +202 -0
  8. package/client/components/bookmark-form/common/hex-input.jsx +22 -0
  9. package/client/components/bookmark-form/common/init-values.js +83 -0
  10. package/client/components/bookmark-form/common/profile-item.jsx +34 -0
  11. package/client/components/bookmark-form/{proxy.jsx → common/proxy.jsx} +1 -1
  12. package/client/components/bookmark-form/{use-quick-commands.jsx → common/quick-commands.jsx} +1 -1
  13. package/client/components/bookmark-form/common/rdp-alert.jsx +13 -0
  14. package/client/components/bookmark-form/common/render-auth-ssh.jsx +119 -0
  15. package/client/components/bookmark-form/{render-delayed-scripts.jsx → common/run-scripts.jsx} +6 -2
  16. package/client/components/bookmark-form/common/serial-path-selector.jsx +39 -0
  17. package/client/components/bookmark-form/{render-auth-ssh.jsx → common/ssh-auth-selector.jsx} +3 -4
  18. package/client/components/bookmark-form/common/ssh-auth-type-selector.jsx +38 -0
  19. package/client/components/bookmark-form/common/ssh-host-selector.jsx +61 -0
  20. package/client/components/bookmark-form/{render-ssh-tunnel.jsx → common/ssh-tunnels.jsx} +4 -4
  21. package/client/components/bookmark-form/common/submit-buttons.jsx +42 -0
  22. package/client/components/bookmark-form/{render-bg.jsx → common/terminal-background.jsx} +2 -2
  23. package/client/components/bookmark-form/{x11.jsx → common/x11.jsx} +2 -2
  24. package/client/components/bookmark-form/config/common-fields.js +305 -0
  25. package/client/components/bookmark-form/config/ftp.js +40 -0
  26. package/client/components/bookmark-form/config/local.js +96 -0
  27. package/client/components/bookmark-form/config/rdp.js +39 -0
  28. package/client/components/bookmark-form/config/serial.js +69 -0
  29. package/client/components/bookmark-form/config/session-config.js +23 -0
  30. package/client/components/bookmark-form/config/ssh.js +47 -0
  31. package/client/components/bookmark-form/config/telnet.js +40 -0
  32. package/client/components/bookmark-form/config/vnc.js +44 -0
  33. package/client/components/bookmark-form/config/web.js +45 -0
  34. package/client/components/bookmark-form/form-renderer.jsx +328 -0
  35. package/client/components/bookmark-form/index.jsx +32 -91
  36. package/client/components/bookmark-form/render-form.jsx +11 -0
  37. package/client/components/common/password.jsx +21 -12
  38. package/client/components/footer/footer-entry.jsx +1 -1
  39. package/client/components/main/main.jsx +12 -2
  40. package/client/components/main/upgrade.jsx +3 -3
  41. package/client/components/profile/profile-form-ftp.jsx +35 -0
  42. package/client/components/profile/profile-form-ssh.jsx +3 -3
  43. package/client/components/profile/profile-form-telnet.jsx +1 -1
  44. package/client/components/profile/profile-tabs.jsx +4 -0
  45. package/client/components/setting-panel/setting-modal.jsx +1 -1
  46. package/client/components/setting-panel/setting-wrap.jsx +1 -1
  47. package/client/components/setting-panel/text-bg-modal.jsx +2 -2
  48. package/client/components/sidebar/info-modal.jsx +3 -3
  49. package/client/components/theme/theme-edit-slot.jsx +1 -1
  50. package/client/components/tree-list/category-color-picker.jsx +1 -1
  51. package/client/components/tree-list/move-item-modal.jsx +1 -1
  52. package/client/entry/basic.js +6 -1
  53. package/client/store/load-data.js +1 -1
  54. package/package.json +1 -1
  55. package/client/components/bookmark-form/form-ssh-common.jsx +0 -219
  56. package/client/components/bookmark-form/form-tabs.jsx +0 -66
  57. package/client/components/bookmark-form/ftp-form-ui.jsx +0 -160
  58. package/client/components/bookmark-form/ftp-form.jsx +0 -16
  59. package/client/components/bookmark-form/hex-input.jsx +0 -39
  60. package/client/components/bookmark-form/local-form-ui.jsx +0 -151
  61. package/client/components/bookmark-form/local-form.jsx +0 -16
  62. package/client/components/bookmark-form/profile-form-item.jsx +0 -43
  63. package/client/components/bookmark-form/quick-command-list.jsx +0 -31
  64. package/client/components/bookmark-form/quick-command.jsx +0 -227
  65. package/client/components/bookmark-form/rdp-form-ui.jsx +0 -179
  66. package/client/components/bookmark-form/rdp-form.jsx +0 -16
  67. package/client/components/bookmark-form/render-profile-item.jsx +0 -0
  68. package/client/components/bookmark-form/serial-form-ui.jsx +0 -309
  69. package/client/components/bookmark-form/serial-form.jsx +0 -20
  70. package/client/components/bookmark-form/sftp-enable.jsx +0 -41
  71. package/client/components/bookmark-form/ssh-form-ui.jsx +0 -121
  72. package/client/components/bookmark-form/ssh-form.jsx +0 -292
  73. package/client/components/bookmark-form/telnet-form-ui.jsx +0 -140
  74. package/client/components/bookmark-form/telnet-form.jsx +0 -16
  75. package/client/components/bookmark-form/use-form-funcs.jsx +0 -50
  76. package/client/components/bookmark-form/use-submit.jsx +0 -67
  77. package/client/components/bookmark-form/use-ui.jsx +0 -97
  78. package/client/components/bookmark-form/vnc-form-ui.jsx +0 -213
  79. package/client/components/bookmark-form/vnc-form.jsx +0 -16
  80. package/client/components/bookmark-form/web-form-ui.jsx +0 -143
  81. package/client/components/bookmark-form/web-form.jsx +0 -16
  82. /package/client/components/bookmark-form/{bookmark-group-tree-format.js → common/bookmark-group-tree-format.js} +0 -0
  83. /package/client/components/bookmark-form/{color-picker.styl → common/color-picker.styl} +0 -0
  84. /package/client/components/bookmark-form/{encodes.js → common/encodes.js} +0 -0
@@ -1,213 +0,0 @@
1
- /**
2
- * web form
3
- */
4
-
5
- import { useEffect } from 'react'
6
- import {
7
- Input,
8
- Form,
9
- InputNumber,
10
- Switch,
11
- Tabs
12
- } from 'antd'
13
- import { formItemLayout } from '../../common/form-layout'
14
- import {
15
- newBookmarkIdPrefix,
16
- terminalVncType
17
- } from '../../common/constants'
18
- import useSubmit from './use-submit'
19
- import copy from 'json-deep-copy'
20
- import { defaults, isEmpty } from 'lodash-es'
21
- import Password from '../common/password'
22
- import { ColorPickerItem } from './color-picker-item.jsx'
23
- import { getColorFromCategory } from '../../common/get-category-color.js'
24
- import findBookmarkGroupId from '../../common/find-bookmark-group-id'
25
- import renderProxy from './proxy'
26
- import ConnectionHopping from './render-connection-hopping.jsx'
27
- import ProfileItem from './profile-form-item'
28
- import BookmarkCategorySelect from './bookmark-category-select.jsx'
29
-
30
- const FormItem = Form.Item
31
- const e = window.translate
32
-
33
- export default function VncFormUi (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 {
47
- id = ''
48
- } = props.formData
49
- const {
50
- bookmarkGroups = [],
51
- currentBookmarkGroupId
52
- } = props
53
- let initialValues = copy(props.formData)
54
- const initBookmarkGroupId = !id.startsWith(newBookmarkIdPrefix)
55
- ? findBookmarkGroupId(bookmarkGroups, id)
56
- : currentBookmarkGroupId
57
- const defaultValues = {
58
- type: terminalVncType,
59
- port: 5900,
60
- category: initBookmarkGroupId,
61
- color: getColorFromCategory(bookmarkGroups, currentBookmarkGroupId),
62
- viewOnly: false,
63
- scaleViewport: true,
64
- connectionHoppings: []
65
- }
66
- initialValues = defaults(initialValues, defaultValues)
67
-
68
- function renderTabs (props) {
69
- const items = [
70
- {
71
- key: 'auth',
72
- label: e('auth'),
73
- forceRender: true,
74
- children: renderCommon()
75
- },
76
- {
77
- key: 'connectionHopping',
78
- label: e('connectionHopping'),
79
- forceRender: true,
80
- children: renderHopping()
81
- }
82
- ]
83
- return (
84
- <Tabs
85
- items={items}
86
- />
87
- )
88
- }
89
-
90
- function renderHopping () {
91
- return (
92
- <ConnectionHopping
93
- {...props}
94
- form={form}
95
- />
96
- )
97
- }
98
-
99
- function renderCommon () {
100
- const {
101
- bookmarkGroups = []
102
- } = props
103
- return (
104
- <div className='pd1x'>
105
- <FormItem
106
- {...formItemLayout}
107
- label={e('title')}
108
- hasFeedback
109
- >
110
- <FormItem noStyle name='title'>
111
- <Input addonBefore={<ColorPickerItem />} />
112
- </FormItem>
113
- </FormItem>
114
- <FormItem
115
- {...formItemLayout}
116
- label={e('host')}
117
- hasFeedback
118
- name='host'
119
- required
120
- >
121
- <Input />
122
- </FormItem>
123
- <FormItem
124
- {...formItemLayout}
125
- label={e('port')}
126
- hasFeedback
127
- name='port'
128
- rules={[{
129
- required: true, message: 'port required'
130
- }]}
131
- >
132
- <InputNumber
133
- placeholder={e('port')}
134
- min={1}
135
- max={65535}
136
- step={1}
137
- />
138
- </FormItem>
139
- <FormItem
140
- {...formItemLayout}
141
- label={e('viewOnly')}
142
- name='viewOnly'
143
- valuePropName='checked'
144
- >
145
- <Switch />
146
- </FormItem>
147
- <FormItem
148
- {...formItemLayout}
149
- label={e('scaleViewport')}
150
- name='scaleViewport'
151
- valuePropName='checked'
152
- >
153
- <Switch />
154
- </FormItem>
155
- <ProfileItem
156
- store={props.store}
157
- profileFilter={d => !isEmpty(d.vnc)}
158
- />
159
- <FormItem
160
- {...formItemLayout}
161
- label={e('username')}
162
- hasFeedback
163
- name='username'
164
- >
165
- <Input />
166
- </FormItem>
167
- <FormItem
168
- {...formItemLayout}
169
- label={e('password')}
170
- hasFeedback
171
- name='password'
172
- >
173
- <Password />
174
- </FormItem>
175
- <FormItem
176
- {...formItemLayout}
177
- label={e('description')}
178
- name='description'
179
- hasFeedback
180
- >
181
- <Input.TextArea autoSize={{ minRows: 1 }} />
182
- </FormItem>
183
- <BookmarkCategorySelect
184
- bookmarkGroups={bookmarkGroups}
185
- form={form}
186
- />
187
- {
188
- renderProxy(props)
189
- }
190
- <FormItem
191
- {...formItemLayout}
192
- label='type'
193
- name='type'
194
- className='hide'
195
- >
196
- <Input />
197
- </FormItem>
198
- </div>
199
- )
200
- }
201
-
202
- return (
203
- <Form
204
- form={form}
205
- onFinish={handleFinish}
206
- initialValues={initialValues}
207
- name='vnc-form'
208
- >
209
- {renderTabs()}
210
- {submitUi}
211
- </Form>
212
- )
213
- }
@@ -1,16 +0,0 @@
1
- /**
2
- * bookmark form
3
- */
4
- import BookmarkForm from './ssh-form'
5
- import VncFormUi from './vnc-form-ui'
6
-
7
- export default class VncForm extends BookmarkForm {
8
- render () {
9
- return (
10
- <VncFormUi
11
- {...this.props}
12
- {...this.getProps()}
13
- />
14
- )
15
- }
16
- }
@@ -1,143 +0,0 @@
1
- /**
2
- * web form
3
- */
4
-
5
- import { useEffect } from 'react'
6
- import {
7
- Input,
8
- Form,
9
- Switch
10
- } from 'antd'
11
- import { formItemLayout } from '../../common/form-layout'
12
- import {
13
- newBookmarkIdPrefix,
14
- terminalWebType
15
- } from '../../common/constants'
16
- import useSubmit from './use-submit'
17
- import copy from 'json-deep-copy'
18
- import { defaults } from 'lodash-es'
19
- import { ColorPickerItem } from './color-picker-item.jsx'
20
- import { getColorFromCategory } from '../../common/get-category-color.js'
21
- import findBookmarkGroupId from '../../common/find-bookmark-group-id'
22
- import BookmarkCategorySelect from './bookmark-category-select.jsx'
23
-
24
- const FormItem = Form.Item
25
- const e = window.translate
26
-
27
- export default function LocalFormUi (props) {
28
- const [
29
- form,
30
- handleFinish,
31
- submitUi
32
- ] = useSubmit(props)
33
- useEffect(() => {
34
- if (props.formData.id.startsWith(newBookmarkIdPrefix)) {
35
- form.setFieldsValue({
36
- category: props.currentBookmarkGroupId
37
- })
38
- }
39
- }, [props.currentBookmarkGroupId])
40
- const {
41
- id = ''
42
- } = props.formData
43
- const {
44
- bookmarkGroups = [],
45
- currentBookmarkGroupId
46
- } = props
47
- const initBookmarkGroupId = !id.startsWith(newBookmarkIdPrefix)
48
- ? findBookmarkGroupId(bookmarkGroups, id)
49
- : currentBookmarkGroupId
50
- let initialValues = copy(props.formData)
51
- const defaultValues = {
52
- type: terminalWebType,
53
- category: initBookmarkGroupId,
54
- color: getColorFromCategory(bookmarkGroups, currentBookmarkGroupId)
55
- }
56
- initialValues = defaults(initialValues, defaultValues)
57
- function renderCommon () {
58
- const {
59
- bookmarkGroups = []
60
- } = props
61
- return (
62
- <div className='pd1x'>
63
- <FormItem
64
- {...formItemLayout}
65
- label={e('title')}
66
- hasFeedback
67
- >
68
- <FormItem noStyle name='title'>
69
- <Input addonBefore={<ColorPickerItem />} />
70
- </FormItem>
71
- </FormItem>
72
- <FormItem
73
- {...formItemLayout}
74
- label={e('URL')}
75
- hasFeedback
76
- name='url'
77
- required
78
- rules={[
79
- {
80
- required: true,
81
- message: e('Please input URL')
82
- },
83
- {
84
- validator: (_, value) =>
85
- /^[a-z\d.+-]+:\/\/[^\s/$.?#].[^\s]*$/i.test(value)
86
- ? Promise.resolve()
87
- : Promise.reject(new Error(e('URL must start with http:// or https://')))
88
- }
89
- ]}
90
- >
91
- <Input />
92
- </FormItem>
93
- <FormItem
94
- {...formItemLayout}
95
- label={e('description')}
96
- name='description'
97
- hasFeedback
98
- >
99
- <Input.TextArea autoSize={{ minRows: 1 }} />
100
- </FormItem>
101
- <BookmarkCategorySelect
102
- bookmarkGroups={bookmarkGroups}
103
- form={form}
104
- />
105
- <FormItem
106
- {...formItemLayout}
107
- label={e('useragent')}
108
- name='useragent'
109
- >
110
- <Input />
111
- </FormItem>
112
- <FormItem
113
- {...formItemLayout}
114
- label='hideAddressBar'
115
- name='hideAddressBar'
116
- valuePropName='checked'
117
- >
118
- <Switch />
119
- </FormItem>
120
- <FormItem
121
- {...formItemLayout}
122
- label='type'
123
- name='type'
124
- className='hide'
125
- >
126
- <Input />
127
- </FormItem>
128
- </div>
129
- )
130
- }
131
-
132
- return (
133
- <Form
134
- form={form}
135
- onFinish={handleFinish}
136
- initialValues={initialValues}
137
- name='web-form'
138
- >
139
- {renderCommon()}
140
- {submitUi}
141
- </Form>
142
- )
143
- }
@@ -1,16 +0,0 @@
1
- /**
2
- * bookmark form
3
- */
4
- import BookmarkForm from './ssh-form'
5
- import WebFormUi from './web-form-ui'
6
-
7
- export default class WebForm extends BookmarkForm {
8
- render () {
9
- return (
10
- <WebFormUi
11
- {...this.props}
12
- {...this.getProps()}
13
- />
14
- )
15
- }
16
- }