@electerm/electerm-react 2.5.16 → 2.7.6
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 +1 -1
- package/client/common/create-title.jsx +2 -2
- package/client/common/download.jsx +14 -14
- package/client/components/bookmark-form/common/encodes.js +1 -0
- package/client/components/bookmark-form/config/common-fields.js +29 -2
- package/client/components/common/zoom-control.jsx +58 -0
- package/client/components/rdp/rdp-session.jsx +264 -198
- package/client/components/sftp/sftp.styl +1 -1
- package/client/components/shortcuts/shortcut-handler.js +84 -0
- package/client/components/sys-menu/zoom.jsx +4 -31
- package/client/components/terminal/terminal.jsx +51 -45
- package/client/components/web/address-bar.jsx +35 -6
- package/client/components/web/web-auth-modal.jsx +69 -0
- package/client/components/web/web-session.jsx +60 -4
- package/client/views/index.pug +0 -2
- package/package.json +1 -1
- package/client/entry/rle.js +0 -2
- package/client/entry/rle.wasm +0 -0
|
@@ -242,7 +242,7 @@ export const proxyHelpLink = 'https://github.com/electerm/electerm/wiki/proxy-fo
|
|
|
242
242
|
export const regexHelpLink = 'https://github.com/electerm/electerm/wiki/Terminal-keywords-highlight-regular-expression-exmaples'
|
|
243
243
|
export const connectionHoppingWikiLink = 'https://github.com/electerm/electerm/wiki/Connection-Hopping-Behavior-Change-in-electerm-since-v1.50.65'
|
|
244
244
|
export const aiConfigWikiLink = 'https://github.com/electerm/electerm/wiki/AI-model-config-guide'
|
|
245
|
-
export const rdpWikiLink = 'https://github.com/electerm/electerm/wiki/RDP-
|
|
245
|
+
export const rdpWikiLink = 'https://github.com/electerm/electerm/wiki/RDP-limitation'
|
|
246
246
|
export const vncWikiLink = 'https://github.com/electerm/electerm/wiki/VNC-session-known-issues'
|
|
247
247
|
export const modals = {
|
|
248
248
|
hide: 0,
|
|
@@ -22,12 +22,12 @@ export default function createTitle (res, hide = true) {
|
|
|
22
22
|
return ''
|
|
23
23
|
}
|
|
24
24
|
const {
|
|
25
|
-
host, port, username, title, type,
|
|
25
|
+
host, port, username, title, type, url,
|
|
26
26
|
path, connectionHoppings, sshTunnels
|
|
27
27
|
} = res
|
|
28
28
|
const h = hide && window.store.config.hideIP ? maskHost(host) : host
|
|
29
29
|
const fixTitle = `${username || ''}@${h}:${port}`
|
|
30
|
-
const extra = host || path ? (path || fixTitle) : ''
|
|
30
|
+
const extra = host || path ? (path || fixTitle) : (url || '')
|
|
31
31
|
let f = title
|
|
32
32
|
? `${title}` + (extra ? ` - ${extra}` : '')
|
|
33
33
|
: extra
|
|
@@ -6,22 +6,22 @@ import ShowItem from '../components/common/show-item'
|
|
|
6
6
|
import { chooseSaveDirectory } from './choose-save-folder'
|
|
7
7
|
import { DownloadOutlined } from '@ant-design/icons'
|
|
8
8
|
|
|
9
|
-
function downloadForBrowser (filename, text) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
9
|
+
// function downloadForBrowser (filename, text) {
|
|
10
|
+
// const blob = new Blob([text], { type: 'text/plain;charset=utf-8' })
|
|
11
|
+
// const url = URL.createObjectURL(blob)
|
|
12
|
+
// const a = document.createElement('a')
|
|
13
|
+
// a.href = url
|
|
14
|
+
// a.download = filename
|
|
15
|
+
// document.body.appendChild(a)
|
|
16
|
+
// a.click()
|
|
17
|
+
// document.body.removeChild(a)
|
|
18
|
+
// URL.revokeObjectURL(url)
|
|
19
|
+
// }
|
|
20
20
|
|
|
21
21
|
export default async function download (filename, text) {
|
|
22
|
-
if (window.et.isWebApp) {
|
|
23
|
-
|
|
24
|
-
}
|
|
22
|
+
// if (window.et.isWebApp) {
|
|
23
|
+
// return downloadForBrowser(filename, text)
|
|
24
|
+
// }
|
|
25
25
|
const savePath = await chooseSaveDirectory()
|
|
26
26
|
if (!savePath) {
|
|
27
27
|
return
|
|
@@ -9,6 +9,32 @@ import { isEmpty } from 'lodash-es'
|
|
|
9
9
|
|
|
10
10
|
const e = window.translate
|
|
11
11
|
|
|
12
|
+
const commonLangOptions = [
|
|
13
|
+
'zh_CN.GBK',
|
|
14
|
+
'C',
|
|
15
|
+
'POSIX',
|
|
16
|
+
'C.UTF-8',
|
|
17
|
+
'en_US.UTF-8',
|
|
18
|
+
'en_US',
|
|
19
|
+
'en_GB.UTF-8',
|
|
20
|
+
'fr_FR.UTF-8',
|
|
21
|
+
'de_DE.UTF-8',
|
|
22
|
+
'es_ES.UTF-8',
|
|
23
|
+
'it_IT.UTF-8',
|
|
24
|
+
'pt_BR.UTF-8',
|
|
25
|
+
'pt_PT.UTF-8',
|
|
26
|
+
'zh_CN.UTF-8',
|
|
27
|
+
'zh_CN.GB2312',
|
|
28
|
+
'zh_TW.UTF-8',
|
|
29
|
+
'zh_HK.UTF-8',
|
|
30
|
+
'zh_SG.UTF-8',
|
|
31
|
+
'ja_JP.UTF-8',
|
|
32
|
+
'ja_JP.eucJP',
|
|
33
|
+
'ko_KR.UTF-8',
|
|
34
|
+
'ru_RU.UTF-8',
|
|
35
|
+
'ar_SA.UTF-8'
|
|
36
|
+
].map(l => ({ label: l, value: l }))
|
|
37
|
+
|
|
12
38
|
// Common individual fields
|
|
13
39
|
export const commonFields = {
|
|
14
40
|
// Basic connection fields
|
|
@@ -118,10 +144,11 @@ export const commonFields = {
|
|
|
118
144
|
|
|
119
145
|
// Terminal UI settings
|
|
120
146
|
envLang: {
|
|
121
|
-
type: '
|
|
147
|
+
type: 'autocomplete',
|
|
122
148
|
name: 'envLang',
|
|
123
149
|
label: 'ENV:LANG',
|
|
124
150
|
rules: [{ max: 130, message: '130 chars max' }],
|
|
151
|
+
options: commonLangOptions,
|
|
125
152
|
props: { placeholder: 'en_US.UTF-8' }
|
|
126
153
|
},
|
|
127
154
|
|
|
@@ -217,7 +244,6 @@ export const commonFields = {
|
|
|
217
244
|
|
|
218
245
|
// Common field groups for settings tabs
|
|
219
246
|
export const terminalSettings = [
|
|
220
|
-
commonFields.envLang,
|
|
221
247
|
commonFields.terminalType,
|
|
222
248
|
commonFields.proxy,
|
|
223
249
|
commonFields.displayRaw,
|
|
@@ -281,6 +307,7 @@ export const sshAuthFields = [
|
|
|
281
307
|
commonFields.startDirectoryLocal,
|
|
282
308
|
commonFields.startDirectory,
|
|
283
309
|
commonFields.interactiveValues,
|
|
310
|
+
commonFields.envLang,
|
|
284
311
|
commonFields.encode,
|
|
285
312
|
commonFields.type
|
|
286
313
|
]
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import InputNumberConfirm from './input-number-confirm'
|
|
3
|
+
import {
|
|
4
|
+
Space
|
|
5
|
+
} from 'antd'
|
|
6
|
+
import {
|
|
7
|
+
MinusCircleOutlined,
|
|
8
|
+
PlusCircleOutlined
|
|
9
|
+
} from '@ant-design/icons'
|
|
10
|
+
|
|
11
|
+
export default function ZoomControl (props) {
|
|
12
|
+
const {
|
|
13
|
+
value,
|
|
14
|
+
onChange,
|
|
15
|
+
min = 0.25,
|
|
16
|
+
max = 5,
|
|
17
|
+
step = 0.25
|
|
18
|
+
} = props
|
|
19
|
+
|
|
20
|
+
const handleChange = (v) => {
|
|
21
|
+
onChange(v / 100)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const handleAdd = () => {
|
|
25
|
+
let next = value + step
|
|
26
|
+
if (next > max) next = max
|
|
27
|
+
onChange(next)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const handleMinus = () => {
|
|
31
|
+
let next = value - step
|
|
32
|
+
if (next < min) next = min
|
|
33
|
+
onChange(next)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<InputNumberConfirm
|
|
38
|
+
value={Math.round(value * 100)}
|
|
39
|
+
onChange={handleChange}
|
|
40
|
+
step={1}
|
|
41
|
+
min={min * 100}
|
|
42
|
+
max={max * 100}
|
|
43
|
+
suffix='%'
|
|
44
|
+
addonBefore={
|
|
45
|
+
<Space.Compact>
|
|
46
|
+
<PlusCircleOutlined
|
|
47
|
+
onClick={handleAdd}
|
|
48
|
+
className='mg1r pointer font16'
|
|
49
|
+
/>
|
|
50
|
+
<MinusCircleOutlined
|
|
51
|
+
onClick={handleMinus}
|
|
52
|
+
className='pointer font16 mg1r'
|
|
53
|
+
/>
|
|
54
|
+
</Space.Compact>
|
|
55
|
+
}
|
|
56
|
+
/>
|
|
57
|
+
)
|
|
58
|
+
}
|