@electerm/electerm-react 1.39.109 → 1.40.1

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 (39) hide show
  1. package/client/common/constants.js +0 -1
  2. package/client/components/bookmark-form/bookmark-select.jsx +96 -0
  3. package/client/components/bookmark-form/color-picker.jsx +18 -9
  4. package/client/components/bookmark-form/form-ssh-common.jsx +4 -2
  5. package/client/components/bookmark-form/profile-form-item.jsx +43 -0
  6. package/client/components/bookmark-form/rdp-form-ui.jsx +10 -9
  7. package/client/components/bookmark-form/render-auth-ssh.jsx +6 -3
  8. package/client/components/bookmark-form/render-connection-hopping.jsx +15 -1
  9. package/client/components/bookmark-form/render-profile-item.jsx +0 -0
  10. package/client/components/bookmark-form/telnet-form-ui.jsx +19 -40
  11. package/client/components/bookmark-form/vnc-form-ui.jsx +6 -1
  12. package/client/components/bookmark-form/web-form-ui.jsx +1 -1
  13. package/client/components/profile/profile-form-elem.jsx +14 -28
  14. package/client/components/profile/profile-form-rdp.jsx +31 -0
  15. package/client/components/profile/profile-form-ssh.jsx +41 -0
  16. package/client/components/profile/profile-form-telnet.jsx +35 -0
  17. package/client/components/profile/profile-form-vnc.jsx +31 -0
  18. package/client/components/profile/profile-tabs.jsx +32 -0
  19. package/client/components/quick-commands/on-drop.js +19 -0
  20. package/client/components/quick-commands/quick-commands-box.jsx +2 -17
  21. package/client/components/quick-commands/quick-commands-list.jsx +4 -19
  22. package/client/components/rdp/rdp-session.jsx +3 -9
  23. package/client/components/setting-panel/keywords-form.jsx +5 -0
  24. package/client/components/setting-panel/keywords-transport.jsx +32 -0
  25. package/client/components/setting-panel/setting-terminal.jsx +16 -1
  26. package/client/components/setting-panel/tab-themes.jsx +2 -2
  27. package/client/components/sftp/file-item.jsx +2 -2
  28. package/client/components/terminal/attach-addon-custom.js +12 -11
  29. package/client/components/terminal/index.jsx +40 -6
  30. package/client/components/theme/theme-edit-slot.jsx +28 -0
  31. package/client/components/theme/theme-editor.jsx +37 -0
  32. package/client/components/{terminal-theme/index.jsx → theme/theme-form.jsx} +103 -34
  33. package/client/components/theme/theme-form.styl +10 -0
  34. package/client/components/vnc/vnc-session.jsx +2 -1
  35. package/client/store/common.js +25 -4
  36. package/client/store/sync.js +4 -4
  37. package/package.json +1 -1
  38. /package/client/components/{terminal-theme → theme}/terminal-theme-list.styl +0 -0
  39. /package/client/components/{terminal-theme → theme}/theme-list.jsx +0 -0
@@ -324,7 +324,6 @@ export const sshTunnelHelpLink = 'https://github.com/electerm/electerm/wiki/How-
324
324
  export const batchOpHelpLink = 'https://github.com/electerm/electerm/wiki/batch-operation'
325
325
  export const proxyHelpLink = 'https://github.com/electerm/electerm/wiki/proxy-format'
326
326
  export const regexHelpLink = 'https://github.com/electerm/electerm/wiki/Terminal-keywords-highlight-regular-expression-exmaples'
327
- export const rdpHelpLink = 'https://github.com/electerm/electerm/wiki/RDP-limitation'
328
327
  export const modals = {
329
328
  hide: 0,
330
329
  setting: 1,
@@ -0,0 +1,96 @@
1
+ // bookmark select tree
2
+ import createTitle from '../../common/create-title'
3
+ import { TreeSelect } from 'antd'
4
+
5
+ const e = window.translate
6
+
7
+ function buildTreeData (bookmarkGroups, tree) {
8
+ const cats = bookmarkGroups
9
+ const btree = cats
10
+ .reduce((p, k) => {
11
+ return {
12
+ ...p,
13
+ [k.id]: k
14
+ }
15
+ }, {})
16
+ function buildSubCats (id) {
17
+ const x = btree[id]
18
+ if (!x) {
19
+ return ''
20
+ }
21
+ const y = {
22
+ key: x.id,
23
+ value: x.id,
24
+ title: x.title
25
+ }
26
+ y.children = [
27
+ ...(x.bookmarkGroupIds || []).map(buildSubCats),
28
+ ...(x.bookmarkIds || []).map(buildLeaf)
29
+ ].filter(d => d)
30
+ if (y.children && !y.children.length) {
31
+ delete y.children
32
+ }
33
+ return y
34
+ }
35
+ function buildLeaf (id) {
36
+ const x = tree[id]
37
+ if (!x) {
38
+ return ''
39
+ }
40
+ return {
41
+ value: x.id,
42
+ key: x.id,
43
+ title: createTitle(x)
44
+ }
45
+ }
46
+ const level1 = cats.filter(d => d.level !== 2)
47
+ .map(d => {
48
+ const r = {
49
+ title: d.title,
50
+ value: d.id,
51
+ key: d.id,
52
+ children: [
53
+ ...(d.bookmarkGroupIds || []).map(buildSubCats),
54
+ ...(d.bookmarkIds || []).map(buildLeaf)
55
+ ].filter(d => d)
56
+ }
57
+ if (!r.children.length) {
58
+ return ''
59
+ }
60
+ return r
61
+ }).filter(d => d)
62
+ return level1
63
+ }
64
+
65
+ export default function BookmarkSelect (props) {
66
+ const {
67
+ bookmarks,
68
+ bookmarkGroups
69
+ } = props
70
+ const tree = bookmarks
71
+ .reduce((p, k) => {
72
+ return {
73
+ ...p,
74
+ [k.id]: k
75
+ }
76
+ }, {})
77
+
78
+ function onSelect (id) {
79
+ const item = tree[id]
80
+ if (item) {
81
+ item.bookmarkId = item.id
82
+ props.onSelect(item)
83
+ }
84
+ }
85
+ const treeData = buildTreeData(bookmarkGroups, tree)
86
+ const treeProps = {
87
+ treeData,
88
+ onChange: onSelect,
89
+ placeholder: e('chooseFromBookmarks'),
90
+ showSearch: true,
91
+ value: undefined
92
+ }
93
+ return (
94
+ <TreeSelect {...treeProps} />
95
+ )
96
+ }
@@ -1,6 +1,6 @@
1
1
  import React, { useState } from 'react'
2
2
  import { Popover } from 'antd'
3
- import { HexColorPicker } from 'react-colorful'
3
+ import { HexColorPicker, RgbaColorPicker } from 'react-colorful'
4
4
  import { defaultColors, getRandomHexColor } from '../../common/rand-hex-color.js'
5
5
  import { HexInput } from './hex-input.jsx'
6
6
  import './color-picker.styl'
@@ -20,6 +20,7 @@ export const ColorPicker = React.forwardRef((props, ref) => {
20
20
  }
21
21
 
22
22
  function renderContent () {
23
+ const Picker = props.isRgba ? RgbaColorPicker : HexColorPicker
23
24
  return (
24
25
  <div className='color-picker-box'>
25
26
  <div className='fix'>
@@ -55,7 +56,7 @@ export const ColorPicker = React.forwardRef((props, ref) => {
55
56
  }
56
57
  </div>
57
58
  <div className='fright'>
58
- <HexColorPicker
59
+ <Picker
59
60
  color={value}
60
61
  onChange={handleChange}
61
62
  />
@@ -71,6 +72,20 @@ export const ColorPicker = React.forwardRef((props, ref) => {
71
72
  )
72
73
  }
73
74
 
75
+ const inner = (
76
+ <div
77
+ ref={ref}
78
+ className='color-picker-choose'
79
+ style={{
80
+ backgroundColor: value
81
+ }}
82
+ />
83
+ )
84
+
85
+ if (props.disabled) {
86
+ return inner
87
+ }
88
+
74
89
  return (
75
90
  <Popover
76
91
  content={renderContent()}
@@ -79,13 +94,7 @@ export const ColorPicker = React.forwardRef((props, ref) => {
79
94
  placement='bottomLeft'
80
95
  onOpenChange={handleVisibleChange}
81
96
  >
82
- <div
83
- ref={ref}
84
- className='color-picker-choose'
85
- style={{
86
- backgroundColor: value
87
- }}
88
- />
97
+ {inner}
89
98
  </Popover>
90
99
  )
91
100
  })
@@ -36,9 +36,11 @@ export default function renderCommon (props) {
36
36
  bookmarkGroups = [],
37
37
  ips,
38
38
  form,
39
- onChangeAuthType
39
+ onChangeAuthType,
40
+ filterAuthType = a => a
40
41
  } = props
41
42
  const tree = formatBookmarkGroups(bookmarkGroups)
43
+ const authTypesFiltered = authTypes.filter(filterAuthType)
42
44
 
43
45
  // ips is ipaddress string[]
44
46
  function renderIps () {
@@ -115,7 +117,7 @@ export default function renderCommon (props) {
115
117
  buttonStyle='solid'
116
118
  >
117
119
  {
118
- authTypes.map(t => {
120
+ authTypesFiltered.map(t => {
119
121
  return (
120
122
  <RadioButton value={t} key={t}>
121
123
  {e(t)}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * bookmark form
3
+ */
4
+ import {
5
+ Form,
6
+ Select
7
+ } from 'antd'
8
+ import { formItemLayout } from '../../common/form-layout'
9
+ import './bookmark-form.styl'
10
+
11
+ const FormItem = Form.Item
12
+ const e = window.translate
13
+
14
+ export default function ProfileItem (props) {
15
+ const {
16
+ store,
17
+ profileFilter = (d) => d
18
+ } = props
19
+ const opts = {
20
+ options: store.profiles
21
+ .filter(profileFilter)
22
+ .map(d => {
23
+ return {
24
+ label: d.name,
25
+ value: d.id
26
+ }
27
+ }),
28
+ placeholder: e('profiles'),
29
+ allowClear: true
30
+ }
31
+ return (
32
+ <FormItem
33
+ {...formItemLayout}
34
+ label={e('profiles')}
35
+ name='profile'
36
+ hasFeedback
37
+ >
38
+ <Select
39
+ {...opts}
40
+ />
41
+ </FormItem>
42
+ )
43
+ }
@@ -12,17 +12,16 @@ import {
12
12
  import { formItemLayout } from '../../common/form-layout'
13
13
  import {
14
14
  newBookmarkIdPrefix,
15
- terminalRdpType,
16
- rdpHelpLink
15
+ terminalRdpType
17
16
  } from '../../common/constants'
18
17
  import useSubmit from './use-submit'
19
18
  import copy from 'json-deep-copy'
20
- import Link from '../common/external-link.jsx'
21
- import { defaults } from 'lodash-es'
19
+ import { defaults, isEmpty } from 'lodash-es'
22
20
  import { ColorPickerItem } from './color-picker-item.jsx'
23
21
  import { getRandomDefaultColor } from '../../common/rand-hex-color.js'
24
22
  import formatBookmarkGroups from './bookmark-group-tree-format'
25
23
  import findBookmarkGroupId from '../../common/find-bookmark-group-id'
24
+ import ProfileItem from './profile-form-item'
26
25
 
27
26
  const FormItem = Form.Item
28
27
  const e = window.translate
@@ -56,6 +55,7 @@ export default function RdpFormUi (props) {
56
55
  port: 3389,
57
56
  category: initBookmarkGroupId,
58
57
  color: getRandomDefaultColor()
58
+
59
59
  }
60
60
  initialValues = defaults(initialValues, defaultValues)
61
61
  function renderCommon () {
@@ -65,9 +65,6 @@ export default function RdpFormUi (props) {
65
65
  const tree = formatBookmarkGroups(bookmarkGroups)
66
66
  return (
67
67
  <div className='pd1x'>
68
- <p className='alignright'>
69
- <Link to={rdpHelpLink}>Wiki: {rdpHelpLink}</Link>
70
- </p>
71
68
  <FormItem
72
69
  {...formItemLayout}
73
70
  label={e('title')}
@@ -102,11 +99,15 @@ export default function RdpFormUi (props) {
102
99
  step={1}
103
100
  />
104
101
  </FormItem>
102
+ <ProfileItem
103
+ store={props.store}
104
+ profileFilter={d => !isEmpty(d.rdp)}
105
+ />
105
106
  <FormItem
106
107
  {...formItemLayout}
107
- label={e('username')}
108
+ label={e('userName')}
108
109
  hasFeedback
109
- name='username'
110
+ name='userName'
110
111
  required
111
112
  >
112
113
  <Input />
@@ -21,7 +21,9 @@ export default function renderAuth (props) {
21
21
  const {
22
22
  store,
23
23
  form,
24
- authType
24
+ authType,
25
+ formItemName = 'password',
26
+ profileFilter = (d) => d
25
27
  } = props
26
28
  const beforeUpload = async (file) => {
27
29
  const privateKey = await window.fs.readFile(file.path)
@@ -50,7 +52,7 @@ export default function renderAuth (props) {
50
52
  <FormItem
51
53
  {...formItemLayout}
52
54
  label={e('password')}
53
- name='password'
55
+ name={formItemName}
54
56
  hasFeedback
55
57
  rules={[{
56
58
  max: 1024, message: '1024 chars max'
@@ -67,6 +69,7 @@ export default function renderAuth (props) {
67
69
  if (authType === 'profiles') {
68
70
  const opts = {
69
71
  options: store.profiles
72
+ .filter(profileFilter)
70
73
  .map(d => {
71
74
  return {
72
75
  label: d.name,
@@ -74,7 +77,7 @@ export default function renderAuth (props) {
74
77
  }
75
78
  }),
76
79
  placeholder: e('profiles'),
77
- allowClear: false
80
+ allowClear: true
78
81
  }
79
82
  return (
80
83
  <FormItem
@@ -17,6 +17,7 @@ import {
17
17
  authTypeMap
18
18
  } from '../../common/constants'
19
19
  import { useState } from 'react'
20
+ import BookmarkSelect from './bookmark-select'
20
21
 
21
22
  const FormItem = Form.Item
22
23
  const RadioButton = Radio.Button
@@ -129,7 +130,13 @@ export default function renderConnectionHopping (props) {
129
130
  </FormItem>
130
131
  )
131
132
  }
132
-
133
+ const treeProps = {
134
+ bookmarks: store.bookmarks.filter(d => {
135
+ return d.host && d.port && d.username
136
+ }),
137
+ bookmarkGroups: store.bookmarkGroups,
138
+ onSelect: handleFinish
139
+ }
133
140
  return (
134
141
  <div>
135
142
  <FormItem
@@ -144,6 +151,13 @@ export default function renderConnectionHopping (props) {
144
151
  initialValues={initialValues}
145
152
  >
146
153
  {renderList()}
154
+ <FormItem
155
+ {...formItemLayout}
156
+ label={e('chooseFromBookmarks')}
157
+ className='mg60b'
158
+ >
159
+ <BookmarkSelect {...treeProps} />
160
+ </FormItem>
147
161
  <FormItem
148
162
  {...formItemLayout}
149
163
  label={e('host')}
@@ -1,16 +1,17 @@
1
1
  /**
2
2
  * bookmark form
3
3
  */
4
- import { useEffect } from 'react'
4
+
5
5
  import {
6
6
  Input,
7
7
  Tabs,
8
- AutoComplete,
9
8
  Form
10
9
  } from 'antd'
10
+ import { useState, useEffect } from 'react'
11
11
  import {
12
12
  newBookmarkIdPrefix,
13
- terminalTelnetType
13
+ terminalTelnetType,
14
+ authTypeMap
14
15
  } from '../../common/constants'
15
16
  import { formItemLayout } from '../../common/form-layout'
16
17
  import findBookmarkGroupId from '../../common/find-bookmark-group-id'
@@ -21,7 +22,8 @@ import useQm from './use-quick-commands'
21
22
  import renderCommon from './form-ssh-common'
22
23
  import { getRandomDefaultColor } from '../../common/rand-hex-color.js'
23
24
  import copy from 'json-deep-copy'
24
- import { defaultsDeep, uniqBy } from 'lodash-es'
25
+ import { defaultsDeep, isEmpty } from 'lodash-es'
26
+ import renderAuth from './render-auth-ssh'
25
27
  import './bookmark-form.styl'
26
28
 
27
29
  const FormItem = Form.Item
@@ -33,6 +35,7 @@ export default function TelnetFormUI (props) {
33
35
  handleFinish,
34
36
  submitUi
35
37
  ] = useSubmit(props)
38
+ const [authType, setAuthType] = useState(props.formData.authType || authTypeMap.password)
36
39
  useEffect(() => {
37
40
  if ((props.formData.id || '').startsWith(newBookmarkIdPrefix)) {
38
41
  form.setFieldsValue({
@@ -53,6 +56,9 @@ export default function TelnetFormUI (props) {
53
56
  ? findBookmarkGroupId(bookmarkGroups, id)
54
57
  : currentBookmarkGroupId
55
58
  let initialValues = copy(props.formData)
59
+ function onChangeAuthType (e) {
60
+ setAuthType(e.target.value)
61
+ }
56
62
  const defaultValues = {
57
63
  port: 23,
58
64
  id: '',
@@ -63,47 +69,20 @@ export default function TelnetFormUI (props) {
63
69
  term: defaultSettings.terminalType,
64
70
  displayRaw: false,
65
71
  type: terminalTelnetType,
66
- category: initBookmarkGroupId
72
+ category: initBookmarkGroupId,
73
+ authType: authTypeMap.password
67
74
  }
68
75
  initialValues = defaultsDeep(initialValues, defaultValues)
69
- function renderAuth () {
70
- const opts = {
71
- options: uniqBy(
72
- props.store.bookmarks
73
- .filter(d => d.password),
74
- (d) => d.password
75
- )
76
- .map(d => {
77
- return {
78
- label: `${d.title ? `(${d.title})` : ''}${d.username || ''}:${d.host}-******`,
79
- value: d.password
80
- }
81
- }),
82
- placeholder: e('password'),
83
- allowClear: false
84
- }
85
- return (
86
- <FormItem
87
- {...formItemLayout}
88
- label={e('password')}
89
- name='password'
90
- hasFeedback
91
- rules={[{
92
- max: 1024, message: '1024 chars max'
93
- }]}
94
- >
95
- <AutoComplete
96
- {...opts}
97
- >
98
- <Input.Password />
99
- </AutoComplete>
100
- </FormItem>
101
- )
102
- }
76
+
103
77
  const tprops = {
104
78
  ...props,
105
79
  renderAuth,
106
- form
80
+ authType,
81
+ onChangeAuthType,
82
+ form,
83
+ bookmarkType: terminalTelnetType,
84
+ filterAuthType: a => a !== 'privateKey',
85
+ profileFilter: d => !isEmpty(d.telnet)
107
86
  }
108
87
 
109
88
  function renderTabs () {
@@ -18,13 +18,14 @@ import {
18
18
  } from '../../common/constants'
19
19
  import useSubmit from './use-submit'
20
20
  import copy from 'json-deep-copy'
21
- import { defaults } from 'lodash-es'
21
+ import { defaults, isEmpty } from 'lodash-es'
22
22
  import { ColorPickerItem } from './color-picker-item.jsx'
23
23
  import { getRandomDefaultColor } from '../../common/rand-hex-color.js'
24
24
  import formatBookmarkGroups from './bookmark-group-tree-format'
25
25
  import findBookmarkGroupId from '../../common/find-bookmark-group-id'
26
26
  import renderProxy from './proxy'
27
27
  import ConnectionHopping from './render-connection-hopping.jsx'
28
+ import ProfileItem from './profile-form-item'
28
29
 
29
30
  const FormItem = Form.Item
30
31
  const e = window.translate
@@ -152,6 +153,10 @@ export default function VncFormUi (props) {
152
153
  >
153
154
  <Switch />
154
155
  </FormItem>
156
+ <ProfileItem
157
+ store={props.store}
158
+ profileFilter={d => !isEmpty(d.vnc)}
159
+ />
155
160
  <FormItem
156
161
  {...formItemLayout}
157
162
  label={e('username')}
@@ -77,7 +77,7 @@ export default function LocalFormUi (props) {
77
77
  name='url'
78
78
  required
79
79
  >
80
- <Input addonBefore={<ColorPickerItem />} />
80
+ <Input />
81
81
  </FormItem>
82
82
  <FormItem
83
83
  {...formItemLayout}
@@ -1,20 +1,23 @@
1
+ import { useState } from 'react'
1
2
  import {
2
3
  Form,
3
4
  message,
4
- Button,
5
- Input
5
+ Button
6
6
  } from 'antd'
7
7
  import InputAutoFocus from '../common/input-auto-focus'
8
- import renderAuth from '../bookmark-form/render-auth-ssh'
9
8
  import { formItemLayout } from '../../common/form-layout'
10
9
  import {
11
10
  settingMap
12
11
  } from '../../common/constants'
12
+
13
+ import ProfileTabs from './profile-tabs'
14
+
13
15
  const FormItem = Form.Item
14
16
  const e = window.translate
15
17
 
16
- export default function QuickCommandForm (props) {
18
+ export default function ProfileFormElem (props) {
17
19
  const [form] = Form.useForm()
20
+ const [activeTab, setActiveTab] = useState('ssh')
18
21
  const { autofocustrigger, profiles } = props.store
19
22
  function genId () {
20
23
  let count = profiles.length ? profiles.length : ''
@@ -42,6 +45,12 @@ export default function QuickCommandForm (props) {
42
45
  }
43
46
  message.success(e('saved'))
44
47
  }
48
+ const tabsProps = {
49
+ activeTab,
50
+ onChangeTab: setActiveTab,
51
+ form,
52
+ store: props.store
53
+ }
45
54
  return (
46
55
  <Form
47
56
  form={form}
@@ -67,30 +76,7 @@ export default function QuickCommandForm (props) {
67
76
  autofocustrigger={autofocustrigger}
68
77
  />
69
78
  </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>
81
- {
82
- renderAuth({
83
- store: props.store,
84
- form,
85
- authType: 'password'
86
- })
87
- }
88
- {
89
- renderAuth({
90
- store: props.store,
91
- form
92
- })
93
- }
79
+ <ProfileTabs {...tabsProps} />
94
80
  <FormItem>
95
81
  <Button
96
82
  type='primary'
@@ -0,0 +1,31 @@
1
+ import {
2
+ Form,
3
+ Input
4
+ } from 'antd'
5
+ import { formItemLayout } from '../../common/form-layout'
6
+
7
+ const FormItem = Form.Item
8
+ const e = window.translate
9
+
10
+ export default function ProfileFormRdp (props) {
11
+ return (
12
+ <>
13
+ <FormItem
14
+ {...formItemLayout}
15
+ label={e('username')}
16
+ hasFeedback
17
+ name={['rdp', 'userName']}
18
+ >
19
+ <Input />
20
+ </FormItem>
21
+ <FormItem
22
+ {...formItemLayout}
23
+ label={e('password')}
24
+ hasFeedback
25
+ name={['rdp', 'password']}
26
+ >
27
+ <Input.Password />
28
+ </FormItem>
29
+ </>
30
+ )
31
+ }
@@ -0,0 +1,41 @@
1
+ import {
2
+ Form,
3
+ Input
4
+ } from 'antd'
5
+ import renderAuth from '../bookmark-form/render-auth-ssh'
6
+ import { formItemLayout } from '../../common/form-layout'
7
+
8
+ const FormItem = Form.Item
9
+ const e = window.translate
10
+
11
+ export default function ProfileFormSsh (props) {
12
+ const { form } = props.store
13
+ return (
14
+ <>
15
+ <FormItem
16
+ {...formItemLayout}
17
+ label={e('username')}
18
+ hasFeedback
19
+ name='username'
20
+ rules={[{
21
+ max: 128, message: '128 chars max'
22
+ }]}
23
+ >
24
+ <Input />
25
+ </FormItem>
26
+ {
27
+ renderAuth({
28
+ store: props.store,
29
+ form,
30
+ authType: 'password'
31
+ })
32
+ }
33
+ {
34
+ renderAuth({
35
+ store: props.store,
36
+ form
37
+ })
38
+ }
39
+ </>
40
+ )
41
+ }
@@ -0,0 +1,35 @@
1
+ import {
2
+ Form,
3
+ Input
4
+ } from 'antd'
5
+ import { formItemLayout } from '../../common/form-layout'
6
+ import renderAuth from '../bookmark-form/render-auth-ssh'
7
+
8
+ const FormItem = Form.Item
9
+ const e = window.translate
10
+
11
+ export default function ProfileFormTelnet (props) {
12
+ return (
13
+ <>
14
+ <FormItem
15
+ {...formItemLayout}
16
+ label={e('username')}
17
+ hasFeedback
18
+ name={['telnet', 'username']}
19
+ rules={[{
20
+ max: 128, message: '128 chars max'
21
+ }]}
22
+ >
23
+ <Input />
24
+ </FormItem>
25
+ {
26
+ renderAuth({
27
+ store: props.store,
28
+ form: props.form,
29
+ authType: 'password',
30
+ formItemName: ['telnet', 'password']
31
+ })
32
+ }
33
+ </>
34
+ )
35
+ }