@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.
- package/client/common/constants.js +2 -1
- package/client/common/create-title.jsx +2 -3
- package/client/common/init-setting-item.js +3 -6
- package/client/common/new-terminal.js +1 -2
- package/client/common/terminal-theme.js +2 -3
- package/client/components/auth/login.jsx +2 -3
- package/client/components/batch-op/batch-op.jsx +18 -36
- package/client/components/bookmark-form/form-ssh-common.jsx +4 -7
- package/client/components/bookmark-form/form-tabs.jsx +4 -8
- package/client/components/bookmark-form/index.jsx +5 -9
- package/client/components/bookmark-form/local-form-ui.jsx +3 -6
- package/client/components/bookmark-form/proxy.jsx +1 -2
- package/client/components/bookmark-form/quick-command.jsx +7 -8
- package/client/components/bookmark-form/rdp-form-ui.jsx +2 -4
- package/client/components/bookmark-form/render-auth-ssh.jsx +1 -2
- package/client/components/bookmark-form/render-connection-hopping.jsx +9 -11
- package/client/components/bookmark-form/render-delayed-scripts.jsx +1 -2
- package/client/components/bookmark-form/render-ssh-tunnel.jsx +9 -12
- package/client/components/bookmark-form/serial-form-ui.jsx +4 -8
- package/client/components/bookmark-form/sftp-enable.jsx +1 -2
- package/client/components/bookmark-form/telnet-form-ui.jsx +2 -4
- package/client/components/bookmark-form/tree-delete.jsx +3 -4
- package/client/components/bookmark-form/use-quick-commands.jsx +5 -6
- package/client/components/bookmark-form/use-submit.jsx +1 -2
- package/client/components/bookmark-form/use-ui.jsx +4 -6
- package/client/components/bookmark-form/vnc-form-ui.jsx +2 -4
- package/client/components/bookmark-form/web-form-ui.jsx +2 -4
- package/client/components/common/markdown.jsx +1 -1
- package/client/components/context-menu/context-menu.jsx +3 -4
- package/client/components/context-menu/menu-btn.jsx +13 -18
- package/client/components/footer/batch-input.jsx +1 -2
- package/client/components/footer/footer-entry.jsx +2 -3
- package/client/components/main/error-wrapper.jsx +2 -4
- package/client/components/main/upgrade.jsx +2 -4
- package/client/components/main/upgrade.styl +4 -1
- package/client/components/profile/profile-form-elem.jsx +28 -10
- package/client/components/quick-commands/quick-commands-box.jsx +1 -2
- package/client/components/quick-commands/quick-commands-form-elem.jsx +7 -12
- package/client/components/quick-commands/quick-commands-list-form.jsx +5 -6
- package/client/components/quick-commands/quick-commands-list.jsx +2 -3
- package/client/components/quick-commands/quick-commands-select.jsx +1 -2
- package/client/components/rdp/rdp-session.jsx +0 -3
- package/client/components/rdp/resolution-form.jsx +3 -6
- package/client/components/session/session.jsx +2 -4
- package/client/components/session/sessions.jsx +4 -6
- package/client/components/setting-panel/keywords-form.jsx +2 -3
- package/client/components/setting-panel/list.jsx +3 -6
- package/client/components/setting-panel/setting-common.jsx +10 -14
- package/client/components/setting-panel/setting-modal.jsx +7 -11
- package/client/components/setting-panel/setting-terminal.jsx +13 -16
- package/client/components/setting-panel/start-session-select.jsx +1 -2
- package/client/components/setting-panel/tab-history.jsx +2 -3
- package/client/components/setting-sync/data-import.jsx +4 -7
- package/client/components/setting-sync/data-select.jsx +4 -16
- package/client/components/setting-sync/setting-sync-form.jsx +8 -12
- package/client/components/sftp/address-bar.jsx +1 -2
- package/client/components/sftp/confirm-modal-store.jsx +1 -2
- package/client/components/sftp/file-item.jsx +6 -8
- package/client/components/sftp/file-mode-modal.jsx +1 -2
- package/client/components/sftp/file-props-modal.jsx +1 -2
- package/client/components/sftp/list-table-ui.jsx +1 -2
- package/client/components/sftp/permission-render.jsx +1 -2
- package/client/components/sftp/sftp-entry.jsx +21 -7
- package/client/components/sftp/transfer-tag.jsx +1 -2
- package/client/components/shortcuts/shortcuts.jsx +5 -28
- package/client/components/sidebar/bookmark.jsx +6 -9
- package/client/components/sidebar/history.jsx +4 -6
- package/client/components/sidebar/index.jsx +9 -16
- package/client/components/sidebar/info-modal.jsx +10 -15
- package/client/components/sidebar/transfer-history-modal.jsx +3 -6
- package/client/components/sidebar/transfer-list-control.jsx +1 -2
- package/client/components/sidebar/transfer-list.jsx +1 -2
- package/client/components/sidebar/transfer-modal.jsx +2 -4
- package/client/components/sidebar/transport-ui.jsx +1 -2
- package/client/components/tabs/index.jsx +28 -20
- package/client/components/tabs/tab.jsx +5 -9
- package/client/components/tabs/window-control.jsx +4 -5
- package/client/components/terminal/index.jsx +5 -7
- package/client/components/terminal/term-search.jsx +2 -3
- package/client/components/terminal/terminal-interactive.jsx +2 -4
- package/client/components/terminal-info/activity.jsx +4 -5
- package/client/components/terminal-info/base.jsx +3 -4
- package/client/components/terminal-info/terminal-info.styl +1 -0
- package/client/components/terminal-theme/index.jsx +6 -9
- package/client/components/terminal-theme/theme-list.jsx +1 -2
- package/client/components/text-editor/text-editor-form.jsx +4 -8
- package/client/components/text-editor/text-editor.jsx +2 -3
- package/client/components/tree-list/bookmark-transport.jsx +4 -7
- package/client/components/tree-list/tree-list-item.jsx +4 -7
- package/client/components/tree-list/tree-list.jsx +3 -6
- package/client/components/vnc/vnc-form.jsx +2 -4
- package/client/components/vnc/vnc-session.jsx +1 -2
- package/client/entry/basic.js +4 -6
- package/client/store/common.js +10 -12
- package/client/store/index.js +4 -7
- package/client/store/init-state.js +2 -3
- package/client/store/load-data.js +10 -0
- package/client/store/setting.js +2 -3
- package/client/store/system-menu.js +4 -6
- package/client/store/terminal-theme.js +2 -4
- 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
|
|
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 /> {
|
|
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={
|
|
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:
|
|
284
|
+
label: e('settings'),
|
|
289
285
|
forceRender: true,
|
|
290
286
|
children: uis
|
|
291
287
|
},
|
|
@@ -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
|
|
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:
|
|
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
|
|
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
|
-
{
|
|
74
|
+
{e('delSelected')} ({len})
|
|
76
75
|
</Button>
|
|
77
76
|
<Button
|
|
78
77
|
onClick={this.handleCancel}
|
|
79
78
|
>
|
|
80
|
-
{
|
|
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
|
|
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={
|
|
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={
|
|
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={
|
|
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
|
-
{
|
|
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
|
|
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
|
|
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={
|
|
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={
|
|
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={
|
|
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
|
|
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={
|
|
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
|
|
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={
|
|
92
|
+
label={e('bookmarkCategory')}
|
|
95
93
|
name='category'
|
|
96
94
|
>
|
|
97
95
|
<TreeSelect
|
|
@@ -44,8 +44,7 @@ import {
|
|
|
44
44
|
ReloadOutlined
|
|
45
45
|
} from '@ant-design/icons'
|
|
46
46
|
|
|
47
|
-
const
|
|
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={
|
|
290
|
+
cancelText={e('cancel')}
|
|
292
291
|
key={`context-item-${i}-${text}`}
|
|
293
|
-
okText={
|
|
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
|
|
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:
|
|
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:
|
|
126
|
+
text: e('bookmarks'),
|
|
132
127
|
submenu: 'Bookmark'
|
|
133
128
|
},
|
|
134
129
|
{
|
|
135
130
|
noCloseMenu: true,
|
|
136
131
|
icon: 'ClockCircleOutlined',
|
|
137
|
-
text:
|
|
132
|
+
text: e('history'),
|
|
138
133
|
submenu: 'History'
|
|
139
134
|
},
|
|
140
135
|
{
|
|
141
136
|
noCloseMenu: true,
|
|
142
137
|
icon: 'BarsOutlined',
|
|
143
|
-
text:
|
|
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:
|
|
147
|
+
text: e('about')
|
|
153
148
|
},
|
|
154
149
|
{
|
|
155
150
|
func: 'openSetting',
|
|
156
151
|
icon: 'SettingOutlined',
|
|
157
|
-
text:
|
|
152
|
+
text: e('settings')
|
|
158
153
|
},
|
|
159
154
|
{
|
|
160
155
|
func: 'openDevTools',
|
|
161
156
|
icon: 'LeftSquareFilled',
|
|
162
|
-
text:
|
|
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:
|
|
168
|
+
text: e('minimize')
|
|
174
169
|
},
|
|
175
170
|
{
|
|
176
171
|
func: 'maximize',
|
|
177
172
|
icon: 'LayoutFilled',
|
|
178
|
-
text:
|
|
173
|
+
text: e('maximize')
|
|
179
174
|
},
|
|
180
175
|
{
|
|
181
176
|
func: 'reload',
|
|
182
177
|
icon: 'ReloadOutlined',
|
|
183
|
-
text:
|
|
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:
|
|
194
|
+
text: e('restart')
|
|
200
195
|
},
|
|
201
196
|
{
|
|
202
197
|
func: 'close',
|
|
203
198
|
icon: 'CloseOutlined',
|
|
204
|
-
text:
|
|
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
|
|
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
|
|
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:
|
|
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
|
|
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
|
-
{
|
|
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
|
|
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}% ${
|
|
348
|
+
? <span>{`${e('upgrading')}... ${upgradePercent || 0}% ${e('cancel')}`}</span>
|
|
351
349
|
: e('upgrade')
|
|
352
350
|
}
|
|
353
351
|
</Button>
|
|
@@ -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
|
|
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:
|
|
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(
|
|
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
|
-
{
|
|
99
|
+
{e('submit')}
|
|
82
100
|
</Button>
|
|
83
101
|
</FormItem>
|
|
84
102
|
</Form>
|
|
@@ -19,10 +19,7 @@ import {
|
|
|
19
19
|
|
|
20
20
|
const FormItem = Form.Item
|
|
21
21
|
const { Option } = Select
|
|
22
|
-
const
|
|
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:
|
|
106
|
+
name: e('newQuickCommand')
|
|
111
107
|
})
|
|
112
108
|
}
|
|
113
|
-
message.success(
|
|
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={
|
|
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={
|
|
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={
|
|
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={
|
|
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
|
|
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={
|
|
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={
|
|
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
|
-
{
|
|
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
|
-
{
|
|
129
|
+
{e('quickCommand')}
|
|
131
130
|
</Button>
|
|
132
131
|
</FormItem>
|
|
133
132
|
</div>
|