@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
|
@@ -8,8 +8,7 @@ import {
|
|
|
8
8
|
isMacJs
|
|
9
9
|
} from '../../common/constants'
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
const m = prefix('menu')
|
|
11
|
+
const e = window.translate
|
|
13
12
|
|
|
14
13
|
export default class WindowControl extends Component {
|
|
15
14
|
render () {
|
|
@@ -35,7 +34,7 @@ export default class WindowControl extends Component {
|
|
|
35
34
|
return (
|
|
36
35
|
<div className='window-controls'>
|
|
37
36
|
<div className='window-control-box window-control-minimize' onClick={minimize}>
|
|
38
|
-
<MinusOutlined title={
|
|
37
|
+
<MinusOutlined title={e('minimize')} className='iblock font12 widnow-control-icon' />
|
|
39
38
|
</div>
|
|
40
39
|
<div
|
|
41
40
|
className='window-control-box window-control-maximize'
|
|
@@ -45,7 +44,7 @@ export default class WindowControl extends Component {
|
|
|
45
44
|
>
|
|
46
45
|
<span
|
|
47
46
|
title={
|
|
48
|
-
isMaximized ?
|
|
47
|
+
isMaximized ? e('unmaximize') : e('maximize')
|
|
49
48
|
}
|
|
50
49
|
className={
|
|
51
50
|
'iblock font12 icon-maximize widnow-control-icon ' +
|
|
@@ -54,7 +53,7 @@ export default class WindowControl extends Component {
|
|
|
54
53
|
/>
|
|
55
54
|
</div>
|
|
56
55
|
<div className='window-control-box window-control-close' onClick={closeApp}>
|
|
57
|
-
<CloseOutlined title={
|
|
56
|
+
<CloseOutlined title={e('close')} className='iblock font12 widnow-control-icon' />
|
|
58
57
|
</div>
|
|
59
58
|
</div>
|
|
60
59
|
)
|
|
@@ -53,9 +53,7 @@ import strip from '@electerm/strip-ansi'
|
|
|
53
53
|
import { formatBytes } from '../../common/byte-format.js'
|
|
54
54
|
import * as fs from './fs.js'
|
|
55
55
|
|
|
56
|
-
const
|
|
57
|
-
const e = prefix('ssh')
|
|
58
|
-
const m = prefix('menu')
|
|
56
|
+
const e = window.translate
|
|
59
57
|
|
|
60
58
|
const computePos = (e) => {
|
|
61
59
|
return {
|
|
@@ -837,14 +835,14 @@ class Term extends Component {
|
|
|
837
835
|
{
|
|
838
836
|
func: 'onCopy',
|
|
839
837
|
icon: 'CopyOutlined',
|
|
840
|
-
text:
|
|
838
|
+
text: e('copy'),
|
|
841
839
|
disabled: !hasSlected,
|
|
842
840
|
subText: copyShortcut
|
|
843
841
|
},
|
|
844
842
|
{
|
|
845
843
|
func: 'onPaste',
|
|
846
844
|
icon: 'SwitcherOutlined',
|
|
847
|
-
text:
|
|
845
|
+
text: e('paste'),
|
|
848
846
|
disabled: !copyed,
|
|
849
847
|
subText: pasteShortcut
|
|
850
848
|
},
|
|
@@ -1256,7 +1254,7 @@ class Term extends Component {
|
|
|
1256
1254
|
this.props.delSplit(this.state.id)
|
|
1257
1255
|
}}
|
|
1258
1256
|
>
|
|
1259
|
-
{
|
|
1257
|
+
{e('close')}
|
|
1260
1258
|
</Button>
|
|
1261
1259
|
<Button
|
|
1262
1260
|
icon={<ReloadOutlined />}
|
|
@@ -1267,7 +1265,7 @@ class Term extends Component {
|
|
|
1267
1265
|
)
|
|
1268
1266
|
}}
|
|
1269
1267
|
>
|
|
1270
|
-
{
|
|
1268
|
+
{e('reload')}
|
|
1271
1269
|
</Button>
|
|
1272
1270
|
</div>
|
|
1273
1271
|
)
|
|
@@ -18,8 +18,7 @@ import copy from 'json-deep-copy'
|
|
|
18
18
|
import { shortcutExtend } from '../shortcuts/shortcut-handler.js'
|
|
19
19
|
import './term-search.styl'
|
|
20
20
|
|
|
21
|
-
const
|
|
22
|
-
const s = prefix('ssh')
|
|
21
|
+
const e = window.translate
|
|
23
22
|
|
|
24
23
|
class TermSearch extends Component {
|
|
25
24
|
searchControls = [{
|
|
@@ -171,7 +170,7 @@ class TermSearch extends Component {
|
|
|
171
170
|
return (
|
|
172
171
|
<Tooltip
|
|
173
172
|
key={id}
|
|
174
|
-
title={
|
|
173
|
+
title={e(id)}
|
|
175
174
|
>
|
|
176
175
|
<Icon
|
|
177
176
|
className={cls}
|
|
@@ -9,9 +9,7 @@ import { tabActions } from '../../common/constants'
|
|
|
9
9
|
import wait from '../../common/wait'
|
|
10
10
|
import postMsg from '../../common/post-msg'
|
|
11
11
|
|
|
12
|
-
const
|
|
13
|
-
const e = prefix('sftp')
|
|
14
|
-
const c = prefix('common')
|
|
12
|
+
const e = window.translate
|
|
15
13
|
const FormItem = Form.Item
|
|
16
14
|
|
|
17
15
|
export default function TermInteractive () {
|
|
@@ -153,7 +151,7 @@ export default function TermInteractive () {
|
|
|
153
151
|
className='mg1l'
|
|
154
152
|
onClick={onIgnore}
|
|
155
153
|
>
|
|
156
|
-
{
|
|
154
|
+
{e('ignore')}
|
|
157
155
|
</Button>
|
|
158
156
|
<Button
|
|
159
157
|
className='mg1l'
|
|
@@ -7,8 +7,7 @@ import { isEmpty } from 'lodash-es'
|
|
|
7
7
|
import { CloseCircleOutlined, BarsOutlined } from '@ant-design/icons'
|
|
8
8
|
import colsParser from './data-cols-parser'
|
|
9
9
|
|
|
10
|
-
const
|
|
11
|
-
const m = prefix('menu')
|
|
10
|
+
const e = window.translate
|
|
12
11
|
|
|
13
12
|
export default function TerminalInfoActivities (props) {
|
|
14
13
|
const { activities, isRemote, terminalInfos } = props
|
|
@@ -19,14 +18,14 @@ export default function TerminalInfoActivities (props) {
|
|
|
19
18
|
col.unshift({
|
|
20
19
|
dataIndex: 'kill',
|
|
21
20
|
key: 'kill',
|
|
22
|
-
title:
|
|
21
|
+
title: e('close'),
|
|
23
22
|
render: (txt, inst) => {
|
|
24
23
|
return (
|
|
25
24
|
<Tooltip
|
|
26
|
-
title={
|
|
25
|
+
title={e('close')}
|
|
27
26
|
>
|
|
28
27
|
<Popconfirm
|
|
29
|
-
title={
|
|
28
|
+
title={e('close') + ' pid:' + inst.pid + ' ?'}
|
|
30
29
|
onConfirm={() => props.killProcess(inst.pid)}
|
|
31
30
|
>
|
|
32
31
|
<CloseCircleOutlined
|
|
@@ -17,8 +17,7 @@ import postMsg from '../../common/post-msg'
|
|
|
17
17
|
import { toggleTerminalLog, toggleTerminalLogTimestamp } from '../terminal/terminal-apis'
|
|
18
18
|
import { ClockCircleOutlined, BorderlessTableOutlined, DatabaseOutlined, BarsOutlined, ApiOutlined, PartitionOutlined } from '@ant-design/icons'
|
|
19
19
|
|
|
20
|
-
const
|
|
21
|
-
const st = prefix('setting')
|
|
20
|
+
const e = window.translate
|
|
22
21
|
|
|
23
22
|
const mapper = {
|
|
24
23
|
uptime: <ClockCircleOutlined />,
|
|
@@ -136,7 +135,7 @@ export default class TerminalInfoBase extends Component {
|
|
|
136
135
|
if (!saveTerminalLogToFile) {
|
|
137
136
|
return null
|
|
138
137
|
}
|
|
139
|
-
const name =
|
|
138
|
+
const name = e('addTimeStampToTermLog')
|
|
140
139
|
return (
|
|
141
140
|
<Switch
|
|
142
141
|
checkedChildren={name}
|
|
@@ -186,7 +185,7 @@ export default class TerminalInfoBase extends Component {
|
|
|
186
185
|
? osResolve(appPath, 'electerm', 'session_logs')
|
|
187
186
|
: window.et.sessionLogPath
|
|
188
187
|
const path = osResolve(base, logName + '.log')
|
|
189
|
-
const name =
|
|
188
|
+
const name = e('saveTerminalLogToFile')
|
|
190
189
|
const to = saveTerminalLogToFile
|
|
191
190
|
? <ShowItem disabled={!saveTerminalLogToFile} to={path}>{path}</ShowItem>
|
|
192
191
|
: path
|
|
@@ -8,10 +8,7 @@ import InputAutoFocus from '../common/input-auto-focus'
|
|
|
8
8
|
|
|
9
9
|
const { TextArea } = Input
|
|
10
10
|
const FormItem = Form.Item
|
|
11
|
-
const
|
|
12
|
-
const e = prefix('form')
|
|
13
|
-
const s = prefix('setting')
|
|
14
|
-
const t = prefix('terminalThemes')
|
|
11
|
+
const e = window.translate
|
|
15
12
|
|
|
16
13
|
export default function ThemeForm (props) {
|
|
17
14
|
const [form] = Form.useForm()
|
|
@@ -115,7 +112,7 @@ export default function ThemeForm (props) {
|
|
|
115
112
|
formData.id || update1.id
|
|
116
113
|
)
|
|
117
114
|
}
|
|
118
|
-
message.success(
|
|
115
|
+
message.success(e('saved'))
|
|
119
116
|
action.current = 'submit'
|
|
120
117
|
}
|
|
121
118
|
|
|
@@ -157,7 +154,7 @@ export default function ThemeForm (props) {
|
|
|
157
154
|
type='dashed'
|
|
158
155
|
onClick={exporter}
|
|
159
156
|
>
|
|
160
|
-
{
|
|
157
|
+
{e('export')}
|
|
161
158
|
</Button>
|
|
162
159
|
</FormItem>
|
|
163
160
|
)
|
|
@@ -187,7 +184,7 @@ export default function ThemeForm (props) {
|
|
|
187
184
|
>
|
|
188
185
|
{renderFuncs(id)}
|
|
189
186
|
<FormItem
|
|
190
|
-
label={
|
|
187
|
+
label={e('themeName')}
|
|
191
188
|
hasFeedback
|
|
192
189
|
name='themeName'
|
|
193
190
|
rules={[{
|
|
@@ -203,7 +200,7 @@ export default function ThemeForm (props) {
|
|
|
203
200
|
/>
|
|
204
201
|
</FormItem>
|
|
205
202
|
<FormItem
|
|
206
|
-
label={
|
|
203
|
+
label={e('themeConfig')}
|
|
207
204
|
>
|
|
208
205
|
<div className='pd1b'>
|
|
209
206
|
<Upload
|
|
@@ -245,7 +242,7 @@ export default function ThemeForm (props) {
|
|
|
245
242
|
type='primary'
|
|
246
243
|
htmlType='submit'
|
|
247
244
|
className='mg1r mg1b'
|
|
248
|
-
>{
|
|
245
|
+
>{e('saveAndApply')}
|
|
249
246
|
</Button>
|
|
250
247
|
<Button
|
|
251
248
|
type='dashed'
|
|
@@ -10,8 +10,7 @@ import { defaultTheme } from '../../common/constants'
|
|
|
10
10
|
import highlight from '../common/highlight'
|
|
11
11
|
import './terminal-theme-list.styl'
|
|
12
12
|
|
|
13
|
-
const
|
|
14
|
-
const e = prefix('terminalThemes')
|
|
13
|
+
const e = window.translate
|
|
15
14
|
|
|
16
15
|
export default class ThemeList extends List {
|
|
17
16
|
del = (item, e) => {
|
|
@@ -6,11 +6,7 @@ import { useEffect } from 'react'
|
|
|
6
6
|
import { Input, Form, Button } from 'antd'
|
|
7
7
|
|
|
8
8
|
const FormItem = Form.Item
|
|
9
|
-
|
|
10
|
-
const { prefix } = window
|
|
11
|
-
const e = prefix('form')
|
|
12
|
-
const c = prefix('common')
|
|
13
|
-
const s = prefix('sftp')
|
|
9
|
+
const e = window.translate
|
|
14
10
|
|
|
15
11
|
export default function TextEditorForm (props) {
|
|
16
12
|
const [form] = Form.useForm()
|
|
@@ -71,7 +67,7 @@ export default function TextEditorForm (props) {
|
|
|
71
67
|
<div className='pd1t pd2b'>
|
|
72
68
|
<Button
|
|
73
69
|
{...popsEdit}
|
|
74
|
-
>{
|
|
70
|
+
>{e('editWithSystemEditor')}
|
|
75
71
|
</Button>
|
|
76
72
|
<Button
|
|
77
73
|
type='primary'
|
|
@@ -85,11 +81,11 @@ export default function TextEditorForm (props) {
|
|
|
85
81
|
className='mg1r mg1b'
|
|
86
82
|
disabled={loading}
|
|
87
83
|
onClick={reset}
|
|
88
|
-
>{
|
|
84
|
+
>{e('reset')}
|
|
89
85
|
</Button>
|
|
90
86
|
<Button
|
|
91
87
|
{...popsCancel}
|
|
92
|
-
>{
|
|
88
|
+
>{e('cancel')}
|
|
93
89
|
</Button>
|
|
94
90
|
</div>
|
|
95
91
|
</Form>
|
|
@@ -9,8 +9,7 @@ import resolve from '../../common/resolve'
|
|
|
9
9
|
import { commonActions } from '../../common/constants'
|
|
10
10
|
import postMsg from '../../common/post-msg'
|
|
11
11
|
|
|
12
|
-
const
|
|
13
|
-
const s = prefix('sftp')
|
|
12
|
+
const e = window.translate
|
|
14
13
|
|
|
15
14
|
export default class TextEditor extends PureComponent {
|
|
16
15
|
state = {
|
|
@@ -152,7 +151,7 @@ export default class TextEditor extends PureComponent {
|
|
|
152
151
|
if (!file) {
|
|
153
152
|
return null
|
|
154
153
|
}
|
|
155
|
-
const title = `${
|
|
154
|
+
const title = `${e('edit')} ${e('remote')} ${e('file')}: ${path}`
|
|
156
155
|
const propsAll = {
|
|
157
156
|
footer: null,
|
|
158
157
|
title,
|
|
@@ -15,10 +15,7 @@ import copy from 'json-deep-copy'
|
|
|
15
15
|
import { find, uniq, isEqual } from 'lodash-es'
|
|
16
16
|
import { fixBookmarks } from '../../common/db-fix'
|
|
17
17
|
|
|
18
|
-
const
|
|
19
|
-
const f = prefix('form')
|
|
20
|
-
const t = prefix('terminalThemes')
|
|
21
|
-
const m = prefix('menu')
|
|
18
|
+
const e = window.translate
|
|
22
19
|
|
|
23
20
|
export default class BookmarkTransport extends Component {
|
|
24
21
|
beforeUpload = async (file) => {
|
|
@@ -118,7 +115,7 @@ export default class BookmarkTransport extends Component {
|
|
|
118
115
|
<Button
|
|
119
116
|
icon={<EditOutlined />}
|
|
120
117
|
onClick={this.handleToggleEdit}
|
|
121
|
-
title={
|
|
118
|
+
title={e('edit')}
|
|
122
119
|
key='edit-and-del'
|
|
123
120
|
/>
|
|
124
121
|
)
|
|
@@ -130,7 +127,7 @@ export default class BookmarkTransport extends Component {
|
|
|
130
127
|
<Button
|
|
131
128
|
icon={<DownloadOutlined />}
|
|
132
129
|
onClick={this.handleDownload}
|
|
133
|
-
title={
|
|
130
|
+
title={e('export')}
|
|
134
131
|
key='export'
|
|
135
132
|
/>,
|
|
136
133
|
<Upload
|
|
@@ -140,7 +137,7 @@ export default class BookmarkTransport extends Component {
|
|
|
140
137
|
>
|
|
141
138
|
<Button
|
|
142
139
|
icon={<UploadOutlined />}
|
|
143
|
-
title={
|
|
140
|
+
title={e('importFromFile')}
|
|
144
141
|
/>
|
|
145
142
|
</Upload>
|
|
146
143
|
]
|
|
@@ -24,10 +24,7 @@ import uid from '../../common/uid'
|
|
|
24
24
|
import { memo } from 'react'
|
|
25
25
|
import './tree-list.styl'
|
|
26
26
|
|
|
27
|
-
const
|
|
28
|
-
const e = prefix('menu')
|
|
29
|
-
const c = prefix('common')
|
|
30
|
-
const s = prefix('setting')
|
|
27
|
+
const e = window.translate
|
|
31
28
|
|
|
32
29
|
export default memo(function TreeListItem (props) {
|
|
33
30
|
const handleDel = (e) => {
|
|
@@ -43,7 +40,7 @@ export default memo(function TreeListItem (props) {
|
|
|
43
40
|
title={e('del') + '?'}
|
|
44
41
|
onConfirm={handleDel}
|
|
45
42
|
okText={e('del')}
|
|
46
|
-
cancelText={
|
|
43
|
+
cancelText={e('cancel')}
|
|
47
44
|
placement='top'
|
|
48
45
|
>
|
|
49
46
|
<CloseOutlined title={e('del')} className='pointer tree-control-btn' />
|
|
@@ -86,7 +83,7 @@ export default memo(function TreeListItem (props) {
|
|
|
86
83
|
return (
|
|
87
84
|
<FolderAddOutlined
|
|
88
85
|
key='new-tree'
|
|
89
|
-
title={`${
|
|
86
|
+
title={`${e('new')} ${e('bookmarkCategory')}`}
|
|
90
87
|
onClick={handleAddSubCat}
|
|
91
88
|
className='pointer tree-control-btn'
|
|
92
89
|
/>
|
|
@@ -129,7 +126,7 @@ export default memo(function TreeListItem (props) {
|
|
|
129
126
|
return null
|
|
130
127
|
}
|
|
131
128
|
return (
|
|
132
|
-
<Tooltip title={
|
|
129
|
+
<Tooltip title={e('openAll')}>
|
|
133
130
|
<FolderOpenOutlined
|
|
134
131
|
key='open-all-tree'
|
|
135
132
|
onClick={handleOpenAll}
|
|
@@ -42,10 +42,7 @@ import './tree-list.styl'
|
|
|
42
42
|
import TreeExpander from './tree-expander'
|
|
43
43
|
import TreeListItem from './tree-list-item'
|
|
44
44
|
|
|
45
|
-
const
|
|
46
|
-
const e = prefix('menu')
|
|
47
|
-
const c = prefix('common')
|
|
48
|
-
const s = prefix('setting')
|
|
45
|
+
const e = window.translate
|
|
49
46
|
|
|
50
47
|
export default class ItemListTree extends Component {
|
|
51
48
|
constructor (props) {
|
|
@@ -902,13 +899,13 @@ export default class ItemListTree extends Component {
|
|
|
902
899
|
<Space.Compact>
|
|
903
900
|
<Button
|
|
904
901
|
onClick={this.handleNewBookmark}
|
|
905
|
-
title={`${
|
|
902
|
+
title={`${e('new')} ${e('bookmarks')}`}
|
|
906
903
|
>
|
|
907
904
|
<BookOutlined className='with-plus' />
|
|
908
905
|
</Button>
|
|
909
906
|
<Button
|
|
910
907
|
onClick={this.handleNewBookmarkGroup}
|
|
911
|
-
title={`${
|
|
908
|
+
title={`${e('new')} ${e('bookmarkCategory')}`}
|
|
912
909
|
>
|
|
913
910
|
<FolderOutlined className='with-plus' />
|
|
914
911
|
</Button>
|
|
@@ -10,9 +10,7 @@ import {
|
|
|
10
10
|
import { formItemLayout, tailFormItemLayout } from '../../common/form-layout'
|
|
11
11
|
|
|
12
12
|
const FormItem = Form.Item
|
|
13
|
-
const
|
|
14
|
-
const e = prefix('form')
|
|
15
|
-
const s = prefix('sftp')
|
|
13
|
+
const e = window.translate
|
|
16
14
|
|
|
17
15
|
export default function VncForm (props) {
|
|
18
16
|
const [form] = Form.useForm()
|
|
@@ -57,7 +55,7 @@ export default function VncForm (props) {
|
|
|
57
55
|
type='primary'
|
|
58
56
|
htmlType='submit'
|
|
59
57
|
>
|
|
60
|
-
{
|
|
58
|
+
{e('submit')}
|
|
61
59
|
</Button>
|
|
62
60
|
</FormItem>
|
|
63
61
|
</div>
|
|
@@ -18,8 +18,7 @@ import resolutions from '../rdp/resolutions'
|
|
|
18
18
|
import RFB from '@novnc/novnc/core/rfb'
|
|
19
19
|
import VncForm from './vnc-form'
|
|
20
20
|
|
|
21
|
-
const
|
|
22
|
-
const e = prefix('form')
|
|
21
|
+
const e = window.translate
|
|
23
22
|
|
|
24
23
|
export default class VncSession extends RdpSession {
|
|
25
24
|
constructor (props) {
|
package/client/entry/basic.js
CHANGED
|
@@ -43,12 +43,10 @@ async function load () {
|
|
|
43
43
|
window.getLang = (lang = window.store?.config.language || 'en_us') => {
|
|
44
44
|
return _get(window.langMap, `[${lang}].lang`)
|
|
45
45
|
}
|
|
46
|
-
window.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return window.capitalizeFirstLetter(str)
|
|
51
|
-
}
|
|
46
|
+
window.translate = txt => {
|
|
47
|
+
const lang = window.getLang()
|
|
48
|
+
const str = _get(lang, `[${txt}]`) || txt
|
|
49
|
+
return window.capitalizeFirstLetter(str)
|
|
52
50
|
}
|
|
53
51
|
await loadWorker()
|
|
54
52
|
loadScript()
|
package/client/store/common.js
CHANGED
|
@@ -16,9 +16,7 @@ import {
|
|
|
16
16
|
} from '../common/constants'
|
|
17
17
|
import * as ls from '../common/safe-local-storage'
|
|
18
18
|
|
|
19
|
-
const
|
|
20
|
-
const m = prefix('menu')
|
|
21
|
-
const c = prefix('common')
|
|
19
|
+
const e = window.translate
|
|
22
20
|
|
|
23
21
|
export default Store => {
|
|
24
22
|
Store.prototype.storeAssign = function (updates) {
|
|
@@ -160,14 +158,14 @@ export default Store => {
|
|
|
160
158
|
ls.setItem(dismissDelKeyTipLsKey, 'y')
|
|
161
159
|
window.store.hideDelKeyTip = true
|
|
162
160
|
}
|
|
163
|
-
Store.prototype.beforeExit = function (
|
|
161
|
+
Store.prototype.beforeExit = function (evt) {
|
|
164
162
|
const { confirmBeforeExit } = window.store.config
|
|
165
163
|
if (
|
|
166
164
|
(confirmBeforeExit &&
|
|
167
165
|
!window.confirmExit) ||
|
|
168
166
|
window.store.isTransporting
|
|
169
167
|
) {
|
|
170
|
-
|
|
168
|
+
evt.returnValue = false
|
|
171
169
|
let mod = null
|
|
172
170
|
mod = Modal.confirm({
|
|
173
171
|
onCancel: () => {
|
|
@@ -178,14 +176,14 @@ export default Store => {
|
|
|
178
176
|
window.confirmExit = true
|
|
179
177
|
window.store[window.exitFunction]()
|
|
180
178
|
},
|
|
181
|
-
title:
|
|
182
|
-
okText:
|
|
183
|
-
cancelText:
|
|
179
|
+
title: e('quit'),
|
|
180
|
+
okText: e('ok'),
|
|
181
|
+
cancelText: e('cancel'),
|
|
184
182
|
content: ''
|
|
185
183
|
})
|
|
186
184
|
}
|
|
187
185
|
}
|
|
188
|
-
Store.prototype.beforeExitApp = function (
|
|
186
|
+
Store.prototype.beforeExitApp = function (evt, name) {
|
|
189
187
|
let mod = null
|
|
190
188
|
mod = Modal.confirm({
|
|
191
189
|
onCancel: () => {
|
|
@@ -195,9 +193,9 @@ export default Store => {
|
|
|
195
193
|
onOk: () => {
|
|
196
194
|
window.pre.runGlobalAsync(name)
|
|
197
195
|
},
|
|
198
|
-
title:
|
|
199
|
-
okText:
|
|
200
|
-
cancelText:
|
|
196
|
+
title: e('quit'),
|
|
197
|
+
okText: e('ok'),
|
|
198
|
+
cancelText: e('cancel'),
|
|
201
199
|
content: ''
|
|
202
200
|
})
|
|
203
201
|
}
|
package/client/store/index.js
CHANGED
|
@@ -41,10 +41,7 @@ import {
|
|
|
41
41
|
theme
|
|
42
42
|
} from 'antd'
|
|
43
43
|
|
|
44
|
-
const
|
|
45
|
-
const ss = prefix('settingSync')
|
|
46
|
-
const s = prefix('setting')
|
|
47
|
-
const sss = prefix('ssh')
|
|
44
|
+
const e = window.translate
|
|
48
45
|
|
|
49
46
|
function getReverseColor (hex) {
|
|
50
47
|
// Check if the input is a valid hex color code
|
|
@@ -201,15 +198,15 @@ class Store {
|
|
|
201
198
|
return [
|
|
202
199
|
{
|
|
203
200
|
id: settingTerminalId,
|
|
204
|
-
title:
|
|
201
|
+
title: e('terminal')
|
|
205
202
|
},
|
|
206
203
|
{
|
|
207
204
|
id: settingShortcutsId,
|
|
208
|
-
title:
|
|
205
|
+
title: e('settingShortcuts')
|
|
209
206
|
},
|
|
210
207
|
{
|
|
211
208
|
id: settingSyncId,
|
|
212
|
-
title:
|
|
209
|
+
title: e('settingSync')
|
|
213
210
|
}
|
|
214
211
|
]
|
|
215
212
|
}
|
|
@@ -25,13 +25,12 @@ import { buildDefaultThemes } from '../common/terminal-theme'
|
|
|
25
25
|
import * as ls from '../common/safe-local-storage'
|
|
26
26
|
import initSettingItem from '../common/init-setting-item'
|
|
27
27
|
|
|
28
|
-
const
|
|
29
|
-
const t = prefix('terminalThemes')
|
|
28
|
+
const e = window.translate
|
|
30
29
|
|
|
31
30
|
function getDefaultBookmarkGroups (bookmarks) {
|
|
32
31
|
return [
|
|
33
32
|
JSON.stringify({
|
|
34
|
-
title:
|
|
33
|
+
title: e(defaultBookmarkGroupId),
|
|
35
34
|
id: defaultBookmarkGroupId,
|
|
36
35
|
bookmarkIds: bookmarks.map(d => d.id)
|
|
37
36
|
})
|
|
@@ -11,6 +11,7 @@ import defaultSettings from '../common/default-setting'
|
|
|
11
11
|
import encodes from '../components/bookmark-form/encodes'
|
|
12
12
|
import runIdle from '../common/run-idle'
|
|
13
13
|
import { initWsCommon } from '../common/fetch-from-server'
|
|
14
|
+
import safeParse from '../common/parse-json-safe'
|
|
14
15
|
|
|
15
16
|
function getHost (argv, opts) {
|
|
16
17
|
const arr = argv
|
|
@@ -75,6 +76,15 @@ export async function addTabFromCommandLine (store, opts) {
|
|
|
75
76
|
if (options.port && parseInt10(options.port)) {
|
|
76
77
|
update.port = parseInt10(options.port)
|
|
77
78
|
}
|
|
79
|
+
if (options.opts) {
|
|
80
|
+
const opts = safeParse(options.opts)
|
|
81
|
+
if (opts !== options.opts) {
|
|
82
|
+
Object.assign(update, opts)
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
if (options.type) {
|
|
86
|
+
update.type = options.type
|
|
87
|
+
}
|
|
78
88
|
Object.assign(conf, update)
|
|
79
89
|
if (options.privateKeyPath) {
|
|
80
90
|
conf.privateKey = await fs.readFile(options.privateKeyPath)
|
package/client/store/setting.js
CHANGED
|
@@ -18,8 +18,7 @@ import { buildNewTheme } from '../common/terminal-theme'
|
|
|
18
18
|
import getInitItem from '../common/init-setting-item'
|
|
19
19
|
import newTerm from '../common/new-terminal'
|
|
20
20
|
|
|
21
|
-
const
|
|
22
|
-
const m = prefix('menu')
|
|
21
|
+
const e = window.translate
|
|
23
22
|
|
|
24
23
|
export default Store => {
|
|
25
24
|
Store.prototype.setConfig = function (conf) {
|
|
@@ -161,7 +160,7 @@ export default Store => {
|
|
|
161
160
|
const { store } = window
|
|
162
161
|
if (store.isSencondInstance) {
|
|
163
162
|
return message.warning(
|
|
164
|
-
|
|
163
|
+
e('sencondInstanceTip')
|
|
165
164
|
)
|
|
166
165
|
}
|
|
167
166
|
store.showModal = modals.setting
|
|
@@ -11,9 +11,7 @@ import {
|
|
|
11
11
|
minZoom
|
|
12
12
|
} from '../common/constants'
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
const m = prefix('menu')
|
|
16
|
-
const c = prefix('common')
|
|
14
|
+
const e = window.translate
|
|
17
15
|
|
|
18
16
|
export default Store => {
|
|
19
17
|
Store.prototype.zoom = function (level = 1, plus = false, zoomOnly) {
|
|
@@ -83,9 +81,9 @@ export default Store => {
|
|
|
83
81
|
mod = Modal.confirm({
|
|
84
82
|
onCancel: () => mod.destroy(),
|
|
85
83
|
onOk: store.doExit,
|
|
86
|
-
title:
|
|
87
|
-
okText:
|
|
88
|
-
cancelText:
|
|
84
|
+
title: e('quit'),
|
|
85
|
+
okText: e('ok'),
|
|
86
|
+
cancelText: e('cancel'),
|
|
89
87
|
content: ''
|
|
90
88
|
})
|
|
91
89
|
}
|
|
@@ -12,9 +12,7 @@ import {
|
|
|
12
12
|
import copy from 'json-deep-copy'
|
|
13
13
|
import { convertTheme } from '../common/terminal-theme'
|
|
14
14
|
|
|
15
|
-
const
|
|
16
|
-
const { prefix } = window
|
|
17
|
-
const t = prefix(terminalThemes)
|
|
15
|
+
const e = window.translate
|
|
18
16
|
|
|
19
17
|
export default Store => {
|
|
20
18
|
Store.prototype.getTerminalThemes = function () {
|
|
@@ -105,7 +103,7 @@ export default Store => {
|
|
|
105
103
|
}
|
|
106
104
|
)
|
|
107
105
|
message.info(
|
|
108
|
-
`${
|
|
106
|
+
`${e('default')} ${e('themeConfig')} ${e('updated')}`
|
|
109
107
|
)
|
|
110
108
|
}
|
|
111
109
|
const hasLightTheme = find(store.getTerminalThemes(), d => d.id === defaultThemeLight.id)
|