@electerm/electerm-react 1.39.88 → 1.39.103
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 +6 -3
- 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 +8 -3
- package/client/components/auth/login.styl +7 -1
- package/client/components/batch-op/batch-op.jsx +18 -36
- package/client/components/bookmark-form/form-ssh-common.jsx +6 -9
- 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 +4 -7
- 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 +3 -5
- package/client/components/bookmark-form/render-auth-ssh.jsx +2 -3
- package/client/components/bookmark-form/render-connection-hopping.jsx +9 -11
- package/client/components/bookmark-form/render-delayed-scripts.jsx +2 -3
- package/client/components/bookmark-form/render-ssh-tunnel.jsx +9 -12
- package/client/components/bookmark-form/serial-form-ui.jsx +5 -9
- 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 +3 -5
- package/client/components/bookmark-form/web-form-ui.jsx +3 -5
- 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 +2 -3
- 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 +6 -7
- 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 +17 -6
- package/client/components/session/session.styl +5 -1
- 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 +71 -48
- 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 +32 -22
- 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 +32 -5
- package/client/store/sync.js +10 -6
- package/client/store/system-menu.js +4 -6
- package/client/store/terminal-theme.js +2 -4
- package/package.json +1 -1
|
@@ -3,26 +3,14 @@ import {
|
|
|
3
3
|
} from '../../common/constants'
|
|
4
4
|
import DataSelectItem from './data-select-item'
|
|
5
5
|
|
|
6
|
-
const
|
|
7
|
-
const e = prefix('common')
|
|
8
|
-
const f = prefix('config')
|
|
9
|
-
const t = prefix('terminalThemes')
|
|
10
|
-
const q = prefix('quickCommands')
|
|
11
|
-
|
|
12
|
-
const translateMap = {
|
|
13
|
-
settings: f,
|
|
14
|
-
terminalThemes: t,
|
|
15
|
-
quickCommands: q,
|
|
16
|
-
bookmarks: e,
|
|
17
|
-
addressBookmarks: e
|
|
18
|
-
}
|
|
6
|
+
const e = window.translate
|
|
19
7
|
|
|
20
8
|
export default function DataSelect (props) {
|
|
21
9
|
const {
|
|
22
10
|
dataSyncSelected
|
|
23
11
|
} = props
|
|
24
|
-
function onChange (
|
|
25
|
-
const key =
|
|
12
|
+
function onChange (evt) {
|
|
13
|
+
const key = evt.target['data-key']
|
|
26
14
|
window.store.toggleDataSyncSelected(key)
|
|
27
15
|
}
|
|
28
16
|
return (
|
|
@@ -31,7 +19,7 @@ export default function DataSelect (props) {
|
|
|
31
19
|
Object.keys(syncDataMaps)
|
|
32
20
|
.map(d => {
|
|
33
21
|
const checked = dataSyncSelected.includes(d)
|
|
34
|
-
const title =
|
|
22
|
+
const title = e(d)
|
|
35
23
|
const boxProps = {
|
|
36
24
|
checked,
|
|
37
25
|
onChange,
|
|
@@ -16,11 +16,7 @@ import './sync.styl'
|
|
|
16
16
|
import HelpIcon from '../common/help-icon'
|
|
17
17
|
|
|
18
18
|
const FormItem = Form.Item
|
|
19
|
-
const
|
|
20
|
-
const e = prefix('form')
|
|
21
|
-
const ss = prefix('settingSync')
|
|
22
|
-
const s = prefix('setting')
|
|
23
|
-
const sh = prefix('ssh')
|
|
19
|
+
const e = window.translate
|
|
24
20
|
|
|
25
21
|
export default function SyncForm (props) {
|
|
26
22
|
const [form] = Form.useForm()
|
|
@@ -28,8 +24,11 @@ export default function SyncForm (props) {
|
|
|
28
24
|
useConditionalEffect(() => {
|
|
29
25
|
form.resetFields()
|
|
30
26
|
}, delta && delta.prev && !eq(delta.prev, delta.curr))
|
|
31
|
-
|
|
27
|
+
const { syncType } = props
|
|
32
28
|
function disabled () {
|
|
29
|
+
if (syncType === syncTypes.cloud) {
|
|
30
|
+
return !props.formData.token
|
|
31
|
+
}
|
|
33
32
|
const {
|
|
34
33
|
token,
|
|
35
34
|
gistId
|
|
@@ -44,10 +43,15 @@ export default function SyncForm (props) {
|
|
|
44
43
|
}
|
|
45
44
|
if (res.gistId) {
|
|
46
45
|
up[syncType + 'GistId'] = res.gistId
|
|
46
|
+
} else if (syncType === syncTypes.cloud) {
|
|
47
|
+
up[syncType + 'GistId'] = 'cloud'
|
|
47
48
|
}
|
|
48
49
|
up[syncType + 'SyncPassword'] = res.syncPassword || ''
|
|
49
50
|
if (res.apiUrl) {
|
|
50
51
|
up[syncType + 'ApiUrl'] = res.apiUrl
|
|
52
|
+
} else if (syncType === syncTypes.cloud) {
|
|
53
|
+
up[syncType + 'ApiUrl'] = 'https://electerm-cloud.html5beta.com/api/sync'
|
|
54
|
+
// up[syncType + 'ApiUrl'] = 'http://127.0.0.1:5678/api/sync'
|
|
51
55
|
}
|
|
52
56
|
props.store.updateSyncSetting(up)
|
|
53
57
|
const test = await props.store.testSyncToken(syncType, res.gistId)
|
|
@@ -56,7 +60,7 @@ export default function SyncForm (props) {
|
|
|
56
60
|
message: 'token invalid'
|
|
57
61
|
})
|
|
58
62
|
}
|
|
59
|
-
if (!res.gistId) {
|
|
63
|
+
if (!res.gistId && syncType !== syncTypes.custom && syncType !== syncTypes.cloud) {
|
|
60
64
|
props.store.createGist(syncType)
|
|
61
65
|
}
|
|
62
66
|
}
|
|
@@ -97,7 +101,7 @@ export default function SyncForm (props) {
|
|
|
97
101
|
const {
|
|
98
102
|
lastSyncTime = ''
|
|
99
103
|
} = props.formData
|
|
100
|
-
|
|
104
|
+
|
|
101
105
|
const isCustom = syncType === syncTypes.custom
|
|
102
106
|
const timeFormatted = lastSyncTime
|
|
103
107
|
? dayjs(lastSyncTime).format('YYYY-MM-DD HH:mm:ss')
|
|
@@ -128,6 +132,15 @@ export default function SyncForm (props) {
|
|
|
128
132
|
return 'sync-input-' + name + '-' + syncType
|
|
129
133
|
}
|
|
130
134
|
function createUrlItem () {
|
|
135
|
+
if (syncType === syncTypes.cloud) {
|
|
136
|
+
return (
|
|
137
|
+
<p>
|
|
138
|
+
<Link to='https://electerm-cloud.html5beta.com'>
|
|
139
|
+
https://electerm-cloud.html5beta.com[Beta]
|
|
140
|
+
</Link>
|
|
141
|
+
</p>
|
|
142
|
+
)
|
|
143
|
+
}
|
|
131
144
|
if (syncType !== syncTypes.custom) {
|
|
132
145
|
return null
|
|
133
146
|
}
|
|
@@ -154,33 +167,13 @@ export default function SyncForm (props) {
|
|
|
154
167
|
: 'gist ID'
|
|
155
168
|
const tokenLabel = createLabel('token', desc)
|
|
156
169
|
const gistLabel = createLabel('gist', idDesc)
|
|
157
|
-
const syncPasswordName =
|
|
170
|
+
const syncPasswordName = e('encrypt') + ' ' + e('password')
|
|
158
171
|
const syncPasswordLabel = createLabel(syncPasswordName, '')
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
name={'setting-sync-form' + syncType}
|
|
165
|
-
layout='vertical'
|
|
166
|
-
initialValues={props.formData}
|
|
167
|
-
>
|
|
168
|
-
{createUrlItem()}
|
|
169
|
-
<FormItem
|
|
170
|
-
label={tokenLabel}
|
|
171
|
-
hasFeedback
|
|
172
|
-
name='token'
|
|
173
|
-
rules={[{
|
|
174
|
-
max: 100, message: '100 chars max'
|
|
175
|
-
}, {
|
|
176
|
-
required: true, message: createPlaceHolder('token') + ' required'
|
|
177
|
-
}]}
|
|
178
|
-
>
|
|
179
|
-
<Input.Password
|
|
180
|
-
placeholder={createPlaceHolder('token')}
|
|
181
|
-
id={createId('token')}
|
|
182
|
-
/>
|
|
183
|
-
</FormItem>
|
|
172
|
+
function createIdItem () {
|
|
173
|
+
if (syncType === syncTypes.cloud) {
|
|
174
|
+
return null
|
|
175
|
+
}
|
|
176
|
+
return (
|
|
184
177
|
<FormItem
|
|
185
178
|
label={gistLabel}
|
|
186
179
|
name='gistId'
|
|
@@ -193,6 +186,13 @@ export default function SyncForm (props) {
|
|
|
193
186
|
id={createId('gistId')}
|
|
194
187
|
/>
|
|
195
188
|
</FormItem>
|
|
189
|
+
)
|
|
190
|
+
}
|
|
191
|
+
function createPasswordItem () {
|
|
192
|
+
if (syncType === syncTypes.cloud) {
|
|
193
|
+
return null
|
|
194
|
+
}
|
|
195
|
+
return (
|
|
196
196
|
<FormItem
|
|
197
197
|
label={syncPasswordLabel}
|
|
198
198
|
hasFeedback
|
|
@@ -205,16 +205,39 @@ export default function SyncForm (props) {
|
|
|
205
205
|
placeholder={syncType + ' ' + syncPasswordName}
|
|
206
206
|
/>
|
|
207
207
|
</FormItem>
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
208
|
+
)
|
|
209
|
+
}
|
|
210
|
+
return (
|
|
211
|
+
<Form
|
|
212
|
+
onFinish={save}
|
|
213
|
+
form={form}
|
|
214
|
+
className='form-wrap pd1x'
|
|
215
|
+
name={'setting-sync-form' + syncType}
|
|
216
|
+
layout='vertical'
|
|
217
|
+
initialValues={props.formData}
|
|
218
|
+
>
|
|
219
|
+
{createUrlItem()}
|
|
220
|
+
<FormItem
|
|
221
|
+
label={tokenLabel}
|
|
222
|
+
hasFeedback
|
|
223
|
+
name='token'
|
|
224
|
+
rules={[{
|
|
225
|
+
max: 1100, message: '1100 chars max'
|
|
226
|
+
}, {
|
|
227
|
+
required: true, message: createPlaceHolder('token') + ' required'
|
|
228
|
+
}]}
|
|
211
229
|
>
|
|
212
|
-
<
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
onChange={this.onChangeAutoSync}
|
|
230
|
+
<Input.Password
|
|
231
|
+
placeholder={createPlaceHolder('token')}
|
|
232
|
+
id={createId('token')}
|
|
216
233
|
/>
|
|
217
|
-
</FormItem>
|
|
234
|
+
</FormItem>
|
|
235
|
+
{
|
|
236
|
+
createIdItem()
|
|
237
|
+
}
|
|
238
|
+
{
|
|
239
|
+
createPasswordItem()
|
|
240
|
+
}
|
|
218
241
|
<FormItem>
|
|
219
242
|
<p>
|
|
220
243
|
<Button
|
|
@@ -231,14 +254,14 @@ export default function SyncForm (props) {
|
|
|
231
254
|
className='mg1r'
|
|
232
255
|
loading={isSyncingSetting}
|
|
233
256
|
icon='swap'
|
|
234
|
-
>{
|
|
257
|
+
>{e('sync')}</Button> */}
|
|
235
258
|
<Button
|
|
236
259
|
type='dashed'
|
|
237
260
|
onClick={upload}
|
|
238
261
|
disabled={disabled()}
|
|
239
|
-
className='mg1r mg1b'
|
|
262
|
+
className='mg1r mg1b sync-btn-up'
|
|
240
263
|
icon={<ArrowUpOutlined />}
|
|
241
|
-
>{
|
|
264
|
+
>{e('uploadSettings')}
|
|
242
265
|
</Button>
|
|
243
266
|
<Button
|
|
244
267
|
type='dashed'
|
|
@@ -246,7 +269,7 @@ export default function SyncForm (props) {
|
|
|
246
269
|
disabled={disabled()}
|
|
247
270
|
className='mg1r mg1b sync-btn-down'
|
|
248
271
|
icon={<ArrowDownOutlined />}
|
|
249
|
-
>{
|
|
272
|
+
>{e('downloadSettings')}
|
|
250
273
|
</Button>
|
|
251
274
|
<Button
|
|
252
275
|
type='dashed'
|
|
@@ -254,11 +277,11 @@ export default function SyncForm (props) {
|
|
|
254
277
|
disabled={disabled()}
|
|
255
278
|
className='mg1r mg1b sync-btn-clear'
|
|
256
279
|
icon={<ClearOutlined />}
|
|
257
|
-
>{
|
|
280
|
+
>{e('clear')}
|
|
258
281
|
</Button>
|
|
259
282
|
</p>
|
|
260
283
|
<p>
|
|
261
|
-
{
|
|
284
|
+
{e('lastSyncTime')}: {timeFormatted}
|
|
262
285
|
</p>
|
|
263
286
|
<p>
|
|
264
287
|
{renderGistUrl()}
|
|
@@ -14,8 +14,7 @@ import {
|
|
|
14
14
|
} from '../../common/constants'
|
|
15
15
|
import postMessage from '../../common/post-msg'
|
|
16
16
|
|
|
17
|
-
const
|
|
18
|
-
const e = prefix('sftp')
|
|
17
|
+
const e = window.translate
|
|
19
18
|
|
|
20
19
|
function formatTimeAuto (strOrDigit) {
|
|
21
20
|
if (isString(strOrDigit)) {
|
|
@@ -36,9 +36,7 @@ import { filesize } from 'filesize'
|
|
|
36
36
|
import { createTransferProps } from './transfer-common'
|
|
37
37
|
import generate from '../../common/uid'
|
|
38
38
|
|
|
39
|
-
const
|
|
40
|
-
const e = prefix('sftp')
|
|
41
|
-
const m = prefix('menu')
|
|
39
|
+
const e = window.translate
|
|
42
40
|
|
|
43
41
|
const computePos = (e) => {
|
|
44
42
|
return {
|
|
@@ -945,7 +943,7 @@ export default class FileSection extends React.Component {
|
|
|
945
943
|
const shouldShowSelectedMenu = id &&
|
|
946
944
|
len > 1 &&
|
|
947
945
|
some(selectedFiles, d => d.id === id)
|
|
948
|
-
const delTxt = shouldShowSelectedMenu ? `${e('deleteAll')}(${len})` :
|
|
946
|
+
const delTxt = shouldShowSelectedMenu ? `${e('deleteAll')}(${len})` : e('del')
|
|
949
947
|
const canPaste = hasFileInClipboardText()
|
|
950
948
|
const showEdit = !isDirectory && id &&
|
|
951
949
|
size < maxEditFileSize
|
|
@@ -1018,20 +1016,20 @@ export default class FileSection extends React.Component {
|
|
|
1018
1016
|
res.push({
|
|
1019
1017
|
func: 'onCopy',
|
|
1020
1018
|
icon: 'CopyOutlined',
|
|
1021
|
-
text:
|
|
1019
|
+
text: e('copy'),
|
|
1022
1020
|
subText: `${ctrlOrCmd}+c`
|
|
1023
1021
|
})
|
|
1024
1022
|
res.push({
|
|
1025
1023
|
func: 'onCut',
|
|
1026
1024
|
icon: 'FileExcelOutlined',
|
|
1027
|
-
text:
|
|
1025
|
+
text: e('cut'),
|
|
1028
1026
|
subText: `${ctrlOrCmd}+x`
|
|
1029
1027
|
})
|
|
1030
1028
|
}
|
|
1031
1029
|
res.push({
|
|
1032
1030
|
func: 'onPaste',
|
|
1033
1031
|
icon: 'CopyOutlined',
|
|
1034
|
-
text:
|
|
1032
|
+
text: e('paste'),
|
|
1035
1033
|
disabled: !canPaste,
|
|
1036
1034
|
subText: `${ctrlOrCmd}+v`
|
|
1037
1035
|
})
|
|
@@ -1044,7 +1042,7 @@ export default class FileSection extends React.Component {
|
|
|
1044
1042
|
res.push({
|
|
1045
1043
|
func: 'onCopyPath',
|
|
1046
1044
|
icon: 'CopyOutlined',
|
|
1047
|
-
text:
|
|
1045
|
+
text: e('copyFilePath')
|
|
1048
1046
|
})
|
|
1049
1047
|
}
|
|
1050
1048
|
if (enableSsh !== false || isLocal) {
|
|
@@ -13,8 +13,7 @@ import renderPermission from './permission-render'
|
|
|
13
13
|
import postMessage from '../../common/post-msg'
|
|
14
14
|
import FileIcon from './file-icon'
|
|
15
15
|
|
|
16
|
-
const
|
|
17
|
-
const e = prefix('sftp')
|
|
16
|
+
const e = window.translate
|
|
18
17
|
const formatTime = time
|
|
19
18
|
|
|
20
19
|
export default class FileMode extends React.PureComponent {
|
|
@@ -22,8 +22,7 @@ import postMsg from '../../common/post-msg'
|
|
|
22
22
|
import { filesize } from 'filesize'
|
|
23
23
|
import { runCmd } from '../terminal/terminal-apis'
|
|
24
24
|
|
|
25
|
-
const
|
|
26
|
-
const e = prefix('sftp')
|
|
25
|
+
const e = window.translate
|
|
27
26
|
const formatTime = time
|
|
28
27
|
|
|
29
28
|
export default function FileInfoModal () {
|
|
@@ -29,8 +29,7 @@ import {
|
|
|
29
29
|
} from '@ant-design/icons'
|
|
30
30
|
import IconHolder from '../context-menu/icon-holder'
|
|
31
31
|
|
|
32
|
-
const
|
|
33
|
-
const e = prefix('sftp')
|
|
32
|
+
const e = window.translate
|
|
34
33
|
|
|
35
34
|
export default class FileListTable extends Component {
|
|
36
35
|
constructor (props) {
|
|
@@ -36,9 +36,7 @@ import AddressBar from './address-bar'
|
|
|
36
36
|
import getProxy from '../../common/get-proxy'
|
|
37
37
|
import './sftp.styl'
|
|
38
38
|
|
|
39
|
-
const
|
|
40
|
-
const e = prefix('sftp')
|
|
41
|
-
const c = prefix('common')
|
|
39
|
+
const e = window.translate
|
|
42
40
|
|
|
43
41
|
const buildTree = arr => {
|
|
44
42
|
return arr.reduce((prev, curr) => {
|
|
@@ -390,8 +388,8 @@ export default class Sftp extends Component {
|
|
|
390
388
|
onDel = (type, files) => {
|
|
391
389
|
this.onDelete = true
|
|
392
390
|
Modal.confirm({
|
|
393
|
-
cancelText:
|
|
394
|
-
okText:
|
|
391
|
+
cancelText: e('cancel'),
|
|
392
|
+
okText: e('ok'),
|
|
395
393
|
title: this.renderDelConfirmTitle(files),
|
|
396
394
|
onOk: () => this.delFiles(type, files)
|
|
397
395
|
})
|
|
@@ -845,6 +843,22 @@ export default class Sftp extends Component {
|
|
|
845
843
|
}, () => this[`${type}List`](undefined, undefined, oldPath))
|
|
846
844
|
}
|
|
847
845
|
|
|
846
|
+
parsePath = (type, pth) => {
|
|
847
|
+
const reg = /^%([^%]+)%/
|
|
848
|
+
if (!reg.test(pth)) {
|
|
849
|
+
return pth
|
|
850
|
+
}
|
|
851
|
+
const m = pth.match(reg)
|
|
852
|
+
if (!m || !m[1]) {
|
|
853
|
+
return pth
|
|
854
|
+
}
|
|
855
|
+
const envName = m[1]
|
|
856
|
+
const envPath = window.pre.env[envName]
|
|
857
|
+
if (envPath) {
|
|
858
|
+
return pth.replace(reg, envPath)
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
|
|
848
862
|
onGoto = (type, e) => {
|
|
849
863
|
e && e.preventDefault()
|
|
850
864
|
if (type === typeMap.remote && !this.sftp) {
|
|
@@ -853,14 +867,14 @@ export default class Sftp extends Component {
|
|
|
853
867
|
const n = `${type}Path`
|
|
854
868
|
const nt = n + 'Temp'
|
|
855
869
|
const oldPath = this.state[type + 'Path']
|
|
856
|
-
const np = this.state[nt]
|
|
870
|
+
const np = this.parsePath(type, this.state[nt])
|
|
857
871
|
if (!isValidPath(np)) {
|
|
858
872
|
return notification.warning({
|
|
859
873
|
message: 'path not valid'
|
|
860
874
|
})
|
|
861
875
|
}
|
|
862
876
|
this.setState({
|
|
863
|
-
[n]:
|
|
877
|
+
[n]: np
|
|
864
878
|
}, () => this[`${type}List`](undefined, undefined, oldPath))
|
|
865
879
|
}
|
|
866
880
|
|
|
@@ -10,12 +10,7 @@ import {
|
|
|
10
10
|
isMacJs as isMac
|
|
11
11
|
} from '../../common/constants.js'
|
|
12
12
|
|
|
13
|
-
const
|
|
14
|
-
const e = prefix('form')
|
|
15
|
-
const c = prefix('control')
|
|
16
|
-
const m = prefix('menu')
|
|
17
|
-
const ss = prefix('ssh')
|
|
18
|
-
const s = prefix('setting')
|
|
13
|
+
const e = window.translate
|
|
19
14
|
const shortcutsDefaults = shortcutsDefaultsGen()
|
|
20
15
|
|
|
21
16
|
export default class Shortcuts extends Component {
|
|
@@ -105,30 +100,12 @@ export default class Shortcuts extends Component {
|
|
|
105
100
|
key: 'name',
|
|
106
101
|
render: (name) => {
|
|
107
102
|
const [a, b] = name.split('_')
|
|
108
|
-
const pre = a === 'terminal' ? `[${
|
|
109
|
-
|
|
110
|
-
[
|
|
111
|
-
'clear', 'selectAll', 'search', 'split'
|
|
112
|
-
].includes(b)
|
|
113
|
-
) {
|
|
114
|
-
return pre + ss(b)
|
|
115
|
-
} else if (b === 'copy') {
|
|
116
|
-
return pre + m(b)
|
|
117
|
-
} else if (b === 'newBookmark') {
|
|
118
|
-
return pre + c(b)
|
|
119
|
-
} else if (b.includes('zoomin')) {
|
|
120
|
-
return pre + m('zoomin')
|
|
121
|
-
} else if (b.includes('zoomout')) {
|
|
122
|
-
return pre + m('zoomout')
|
|
123
|
-
} else if (['togglefullscreen'].includes(b)) {
|
|
124
|
-
return pre + m(b)
|
|
125
|
-
} else {
|
|
126
|
-
return pre + s(b)
|
|
127
|
-
}
|
|
103
|
+
const pre = a === 'terminal' ? `[${e('terminal')}] ` : ''
|
|
104
|
+
return pre + e(b)
|
|
128
105
|
}
|
|
129
106
|
},
|
|
130
107
|
{
|
|
131
|
-
title:
|
|
108
|
+
title: e('settingShortcuts'),
|
|
132
109
|
dataIndex: 'shortcut',
|
|
133
110
|
key: 'shortcut',
|
|
134
111
|
render: (shortcut, inst) => {
|
|
@@ -174,7 +151,7 @@ export default class Shortcuts extends Component {
|
|
|
174
151
|
<Button
|
|
175
152
|
onClick={this.handleResetAll}
|
|
176
153
|
>
|
|
177
|
-
{
|
|
154
|
+
{e('resetAllToDefault')}
|
|
178
155
|
</Button>
|
|
179
156
|
</div>
|
|
180
157
|
</div>
|
|
@@ -8,10 +8,7 @@ import { pick } from 'lodash-es'
|
|
|
8
8
|
import { ArrowsAltOutlined, EditOutlined, PlusCircleOutlined, ShrinkOutlined, PushpinOutlined } from '@ant-design/icons'
|
|
9
9
|
import { Tooltip } from 'antd'
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
const c = prefix('common')
|
|
13
|
-
const m = prefix('menu')
|
|
14
|
-
const e = prefix('control')
|
|
11
|
+
const e = window.translate
|
|
15
12
|
|
|
16
13
|
export default class BookmarkPanel extends Component {
|
|
17
14
|
render () {
|
|
@@ -42,29 +39,29 @@ export default class BookmarkPanel extends Component {
|
|
|
42
39
|
>
|
|
43
40
|
<div className='pd1y pd2t pd2x'>
|
|
44
41
|
<div className='fix'>
|
|
45
|
-
<div className='fleft'>{
|
|
42
|
+
<div className='fleft'>{e('bookmarks')}</div>
|
|
46
43
|
<div className='fright'>
|
|
47
44
|
<Tooltip title={e('newBookmark')}>
|
|
48
45
|
<PlusCircleOutlined
|
|
49
46
|
{...pop1}
|
|
50
47
|
/>
|
|
51
48
|
</Tooltip>
|
|
52
|
-
<Tooltip title={`${
|
|
49
|
+
<Tooltip title={`${e('edit')} ${e('bookmarks')}`}>
|
|
53
50
|
<EditOutlined
|
|
54
51
|
{...pop1}
|
|
55
52
|
/>
|
|
56
53
|
</Tooltip>
|
|
57
|
-
<Tooltip title={
|
|
54
|
+
<Tooltip title={e('expandAll')}>
|
|
58
55
|
<ArrowsAltOutlined
|
|
59
56
|
{...pop2}
|
|
60
57
|
/>
|
|
61
58
|
</Tooltip>
|
|
62
|
-
<Tooltip title={
|
|
59
|
+
<Tooltip title={e('collapseAll')}>
|
|
63
60
|
<ShrinkOutlined
|
|
64
61
|
{...pop3}
|
|
65
62
|
/>
|
|
66
63
|
</Tooltip>
|
|
67
|
-
<Tooltip title={
|
|
64
|
+
<Tooltip title={e('pin')}>
|
|
68
65
|
<PushpinOutlined
|
|
69
66
|
{...prps1}
|
|
70
67
|
onClick={store.handlePin}
|
|
@@ -8,9 +8,7 @@ import { pick } from 'lodash-es'
|
|
|
8
8
|
import { EditOutlined, PushpinOutlined } from '@ant-design/icons'
|
|
9
9
|
import { Tooltip } from 'antd'
|
|
10
10
|
|
|
11
|
-
const
|
|
12
|
-
const c = prefix('common')
|
|
13
|
-
const m = prefix('menu')
|
|
11
|
+
const e = window.translate
|
|
14
12
|
|
|
15
13
|
export default class HistoryPanel extends Component {
|
|
16
14
|
render () {
|
|
@@ -35,15 +33,15 @@ export default class HistoryPanel extends Component {
|
|
|
35
33
|
>
|
|
36
34
|
<div className='pd1y pd2t pd2x'>
|
|
37
35
|
<div className='fix'>
|
|
38
|
-
<div className='fleft'>{
|
|
36
|
+
<div className='fleft'>{e('history')}</div>
|
|
39
37
|
<div className='fleft'>
|
|
40
|
-
<Tooltip title={`${
|
|
38
|
+
<Tooltip title={`${e('edit')} ${e('history')}`}>
|
|
41
39
|
<EditOutlined
|
|
42
40
|
className='font16 mg1x mg2l pointer iblock control-icon icon-do-edit'
|
|
43
41
|
onClick={store.handleEditHistory}
|
|
44
42
|
/>
|
|
45
43
|
</Tooltip>
|
|
46
|
-
<Tooltip title={
|
|
44
|
+
<Tooltip title={e('pin')}>
|
|
47
45
|
<PushpinOutlined
|
|
48
46
|
{...prps1}
|
|
49
47
|
onClick={store.handlePin}
|
|
@@ -26,14 +26,7 @@ import SideIcon from './side-icon'
|
|
|
26
26
|
import SidePanel from './side-panel'
|
|
27
27
|
import './sidebar.styl'
|
|
28
28
|
|
|
29
|
-
const
|
|
30
|
-
const e = prefix('control')
|
|
31
|
-
const c = prefix('common')
|
|
32
|
-
const m = prefix('menu')
|
|
33
|
-
const t = prefix('terminalThemes')
|
|
34
|
-
const u = prefix('updater')
|
|
35
|
-
const ss = prefix('settingSync')
|
|
36
|
-
const b = prefix('batchOp')
|
|
29
|
+
const e = window.translate
|
|
37
30
|
|
|
38
31
|
export default class Sidebar extends Component {
|
|
39
32
|
handler = null
|
|
@@ -141,7 +134,7 @@ export default class Sidebar extends Component {
|
|
|
141
134
|
/>
|
|
142
135
|
</SideIcon>
|
|
143
136
|
<SideIcon
|
|
144
|
-
title={
|
|
137
|
+
title={e(settingMap.bookmarks)}
|
|
145
138
|
active={bookmarksActive}
|
|
146
139
|
>
|
|
147
140
|
<BookOutlined
|
|
@@ -152,7 +145,7 @@ export default class Sidebar extends Component {
|
|
|
152
145
|
/>
|
|
153
146
|
</SideIcon>
|
|
154
147
|
<SideIcon
|
|
155
|
-
title={
|
|
148
|
+
title={e(settingMap.history)}
|
|
156
149
|
active={historyActive}
|
|
157
150
|
>
|
|
158
151
|
<ClockCircleOutlined
|
|
@@ -164,7 +157,7 @@ export default class Sidebar extends Component {
|
|
|
164
157
|
</SideIcon>
|
|
165
158
|
<TransferList store={store} />
|
|
166
159
|
<SideIcon
|
|
167
|
-
title={
|
|
160
|
+
title={e(settingMap.terminalThemes)}
|
|
168
161
|
active={themeActive}
|
|
169
162
|
>
|
|
170
163
|
<PictureOutlined
|
|
@@ -173,13 +166,13 @@ export default class Sidebar extends Component {
|
|
|
173
166
|
/>
|
|
174
167
|
</SideIcon>
|
|
175
168
|
<SideIcon
|
|
176
|
-
title={
|
|
169
|
+
title={e(settingMap.setting)}
|
|
177
170
|
active={settingActive}
|
|
178
171
|
>
|
|
179
172
|
<SettingOutlined className='iblock font20 control-icon' onClick={openSetting} />
|
|
180
173
|
</SideIcon>
|
|
181
174
|
<SideIcon
|
|
182
|
-
title={
|
|
175
|
+
title={e('settingSync')}
|
|
183
176
|
active={syncActive}
|
|
184
177
|
>
|
|
185
178
|
<CloudSyncOutlined
|
|
@@ -189,13 +182,13 @@ export default class Sidebar extends Component {
|
|
|
189
182
|
/>
|
|
190
183
|
</SideIcon>
|
|
191
184
|
<SideIcon
|
|
192
|
-
title={
|
|
185
|
+
title={e('batchOp')}
|
|
193
186
|
active={showBatchOp}
|
|
194
187
|
>
|
|
195
188
|
<BarsOutlined className='iblock font20 control-icon' onClick={toggleBatchOp} />
|
|
196
189
|
</SideIcon>
|
|
197
190
|
<SideIcon
|
|
198
|
-
title={
|
|
191
|
+
title={e('about')}
|
|
199
192
|
active={showInfoModal}
|
|
200
193
|
>
|
|
201
194
|
<InfoCircleOutlined
|
|
@@ -207,7 +200,7 @@ export default class Sidebar extends Component {
|
|
|
207
200
|
!checkingRemoteVersion && !showUpgradeModal && shouldUpgrade
|
|
208
201
|
? (
|
|
209
202
|
<Tooltip
|
|
210
|
-
title={`${
|
|
203
|
+
title={`${e('upgrading')} ${upgradePercent || 0}%`}
|
|
211
204
|
placement='right'
|
|
212
205
|
>
|
|
213
206
|
<div
|