@electerm/electerm-react 1.37.96 → 1.37.110
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/default-setting.js +1 -1
- package/client/common/download-mirrors.js +4 -0
- package/client/components/main/upgrade.jsx +2 -2
- package/client/components/session/session.jsx +12 -6
- package/client/components/session/sessions.jsx +5 -2
- package/client/components/shortcuts/shortcut-handler.js +14 -2
- package/client/components/sidebar/side-panel.jsx +1 -0
- package/client/components/tabs/app-drag.jsx +7 -4
- package/client/components/tabs/index.jsx +1 -1
- package/client/components/terminal/index.jsx +0 -2
- package/client/components/terminal-info/content.jsx +1 -1
- package/client/entry/index.jsx +1 -0
- package/client/store/index.js +2 -5
- package/client/store/init-state.js +1 -1
- package/package.json +1 -1
|
@@ -37,7 +37,6 @@ export const contextMenuWidth = 280
|
|
|
37
37
|
export const contextMenuPaddingTop = 10
|
|
38
38
|
export const sftpControlHeight = 28 + 42 + 33 + 46
|
|
39
39
|
export const sidebarWidth = 43
|
|
40
|
-
export const sidebarPanelWidth = 300
|
|
41
40
|
export const maxHistory = 50
|
|
42
41
|
export const maxTransport = 5
|
|
43
42
|
export const maxSftpHistory = 20
|
|
@@ -298,6 +297,7 @@ export const rendererTypes = {
|
|
|
298
297
|
webGL: 'webGL'
|
|
299
298
|
}
|
|
300
299
|
export const mirrors = {
|
|
300
|
+
'download-electerm': 'download-electerm',
|
|
301
301
|
github: 'github',
|
|
302
302
|
sourceforge: 'sourceforge'
|
|
303
303
|
}
|
|
@@ -8,7 +8,7 @@ export default {
|
|
|
8
8
|
scrollback: 3000,
|
|
9
9
|
onStartSessions: [],
|
|
10
10
|
fontSize: 16,
|
|
11
|
-
fontFamily: 'mono, courier-new, courier, monospace',
|
|
11
|
+
fontFamily: 'Fira Code, mono, courier-new, courier, monospace',
|
|
12
12
|
execWindows: 'System32/WindowsPowerShell/v1.0/powershell.exe',
|
|
13
13
|
execMac: 'zsh',
|
|
14
14
|
execLinux: 'bash',
|
|
@@ -29,7 +29,7 @@ const c = prefix('common')
|
|
|
29
29
|
export default class Upgrade extends PureComponent {
|
|
30
30
|
state = {
|
|
31
31
|
showCount: 0,
|
|
32
|
-
mirror: mirrors
|
|
32
|
+
mirror: mirrors['download-electerm']
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
downloadTimer = null
|
|
@@ -114,7 +114,7 @@ export default class Upgrade extends PureComponent {
|
|
|
114
114
|
timeout = () => {
|
|
115
115
|
const { mirror } = this.state
|
|
116
116
|
this.cancel()
|
|
117
|
-
const next = mirror
|
|
117
|
+
const next = mirror !== mirrors.sourceforge
|
|
118
118
|
? this.doUpgrade
|
|
119
119
|
: undefined
|
|
120
120
|
const nextMirror = mirror === mirrors.github
|
|
@@ -299,11 +299,16 @@ export default class SessionWrapper extends Component {
|
|
|
299
299
|
infoPanelPinned,
|
|
300
300
|
showInfo
|
|
301
301
|
} = this.state
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
302
|
+
const { rightSidebarWidth, width, leftSidebarWidth, pinned, openedSideBar } = this.props
|
|
303
|
+
const rt = infoPanelPinned && showInfo ? rightSidebarWidth : 0
|
|
304
|
+
const lt = pinned && openedSideBar ? leftSidebarWidth : 0
|
|
305
|
+
return width - rt - lt - 42
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
getWidthSftp = () => {
|
|
309
|
+
const { width, leftSidebarWidth, pinned, openedSideBar } = this.props
|
|
310
|
+
const lt = pinned && openedSideBar ? leftSidebarWidth : 0
|
|
311
|
+
return width - lt - 42
|
|
307
312
|
}
|
|
308
313
|
|
|
309
314
|
renderTerminals = () => {
|
|
@@ -402,7 +407,8 @@ export default class SessionWrapper extends Component {
|
|
|
402
407
|
height,
|
|
403
408
|
sessionId,
|
|
404
409
|
pane,
|
|
405
|
-
...this.props
|
|
410
|
+
...this.props,
|
|
411
|
+
width: this.getWidthSftp()
|
|
406
412
|
}
|
|
407
413
|
return (
|
|
408
414
|
<div className={cls}>
|
|
@@ -350,7 +350,10 @@ class Sessions extends Component {
|
|
|
350
350
|
'tabsHeight',
|
|
351
351
|
'appPath',
|
|
352
352
|
'topMenuHeight',
|
|
353
|
-
'rightSidebarWidth'
|
|
353
|
+
'rightSidebarWidth',
|
|
354
|
+
'leftSidebarWidth',
|
|
355
|
+
'pinned',
|
|
356
|
+
'openedSideBar'
|
|
354
357
|
]),
|
|
355
358
|
config,
|
|
356
359
|
...pick(this, [
|
|
@@ -411,7 +414,7 @@ class Sessions extends Component {
|
|
|
411
414
|
|
|
412
415
|
renderSessionsWrap = () => {
|
|
413
416
|
const { leftSidebarWidth, openedSideBar } = this.props.store
|
|
414
|
-
const w = leftSidebarWidth +
|
|
417
|
+
const w = leftSidebarWidth + 42
|
|
415
418
|
const ptp = openedSideBar
|
|
416
419
|
? {
|
|
417
420
|
className: 'sessions',
|
|
@@ -56,13 +56,24 @@ export function shortcutExtend (Cls) {
|
|
|
56
56
|
type,
|
|
57
57
|
key
|
|
58
58
|
} = event
|
|
59
|
-
if (
|
|
59
|
+
if (
|
|
60
|
+
this.term &&
|
|
61
|
+
key === 'Backspace' &&
|
|
62
|
+
type === 'keydown' &&
|
|
63
|
+
!altKey &&
|
|
64
|
+
!ctrlKey
|
|
65
|
+
) {
|
|
60
66
|
this.props.onDelKeyPressed()
|
|
61
67
|
const delKey = this.props.config.backspaceMode === '^?' ? 8 : 127
|
|
62
68
|
const altDelDelKey = delKey === 8 ? 127 : 8
|
|
63
69
|
const char = String.fromCharCode(shiftKey ? delKey : altDelDelKey)
|
|
64
70
|
this.socket.send(char)
|
|
65
71
|
return false
|
|
72
|
+
} else if (
|
|
73
|
+
this.term &&
|
|
74
|
+
this.term.buffer.active.type === 'alternate'
|
|
75
|
+
) {
|
|
76
|
+
return true
|
|
66
77
|
}
|
|
67
78
|
const codeName = event instanceof window.WheelEvent
|
|
68
79
|
? (wheelDeltaY > 0 ? 'mouseWheelUp' : 'mouseWheelDown')
|
|
@@ -87,13 +98,14 @@ export function shortcutExtend (Cls) {
|
|
|
87
98
|
if (conf.shortcut.split(',').includes(r)) {
|
|
88
99
|
if (this[funcName]) {
|
|
89
100
|
return this[funcName](event)
|
|
90
|
-
} else if (this.
|
|
101
|
+
} else if (this.term && conf.readonly) {
|
|
91
102
|
return true
|
|
92
103
|
} else {
|
|
93
104
|
return false
|
|
94
105
|
}
|
|
95
106
|
}
|
|
96
107
|
}
|
|
108
|
+
return !!this.term
|
|
97
109
|
}
|
|
98
110
|
return Cls
|
|
99
111
|
}
|
|
@@ -19,6 +19,7 @@ export default class SidePanel extends PureComponent {
|
|
|
19
19
|
nw = 600
|
|
20
20
|
}
|
|
21
21
|
this.props.setLeftSidePanelWidth(nw)
|
|
22
|
+
window.store.onResize()
|
|
22
23
|
window.removeEventListener('mouseup', this.handleMouseup)
|
|
23
24
|
window.removeEventListener('mousemove', this.handleMousemove)
|
|
24
25
|
}
|
|
@@ -5,10 +5,11 @@ export default function AppDrag (props) {
|
|
|
5
5
|
const {
|
|
6
6
|
target
|
|
7
7
|
} = e
|
|
8
|
+
const { classList = [] } = target || {}
|
|
8
9
|
if (
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
!classList.contains('app-drag') &&
|
|
11
|
+
!classList.contains('tabs-inner') &&
|
|
12
|
+
!classList.contains('tabs-wrapper')
|
|
12
13
|
) {
|
|
13
14
|
window.pre.runSync('windowMove', false)
|
|
14
15
|
return false
|
|
@@ -17,6 +18,7 @@ export default function AppDrag (props) {
|
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
function onMouseDown (e) {
|
|
21
|
+
e.stopPropagation()
|
|
20
22
|
if (canOperate(e)) {
|
|
21
23
|
window.pre.runSync('windowMove', true)
|
|
22
24
|
}
|
|
@@ -27,8 +29,9 @@ export default function AppDrag (props) {
|
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
function onDoubleClick (e) {
|
|
32
|
+
e.stopPropagation()
|
|
30
33
|
if (!canOperate(e)) {
|
|
31
|
-
return
|
|
34
|
+
return
|
|
32
35
|
}
|
|
33
36
|
const {
|
|
34
37
|
isMaximized
|
|
@@ -110,7 +110,7 @@ export default class TerminalInfoContent extends PureComponent {
|
|
|
110
110
|
draggable: false,
|
|
111
111
|
style: {
|
|
112
112
|
width: props.rightSidebarWidth,
|
|
113
|
-
top: props.topMenuHeight + props.tabsHeight + termControlHeight
|
|
113
|
+
top: props.topMenuHeight + props.tabsHeight + termControlHeight
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
return (
|
package/client/entry/index.jsx
CHANGED
|
@@ -2,6 +2,7 @@ import { render } from 'react-dom'
|
|
|
2
2
|
import 'antd/dist/reset.css'
|
|
3
3
|
import 'xterm/css/xterm.css'
|
|
4
4
|
import '../common/trzsz'
|
|
5
|
+
import 'firacode/distr/fira_code.css'
|
|
5
6
|
import Main from '../components/main/index.jsx'
|
|
6
7
|
import { notification } from 'antd'
|
|
7
8
|
notification.config({
|
package/client/store/index.js
CHANGED
|
@@ -31,8 +31,6 @@ import { uniq } from 'lodash-es'
|
|
|
31
31
|
import copy from 'json-deep-copy'
|
|
32
32
|
import {
|
|
33
33
|
settingMap,
|
|
34
|
-
sidebarWidth,
|
|
35
|
-
sidebarPanelWidth,
|
|
36
34
|
paneMap,
|
|
37
35
|
settingSyncId,
|
|
38
36
|
settingShortcutsId,
|
|
@@ -93,8 +91,7 @@ class Store {
|
|
|
93
91
|
}
|
|
94
92
|
|
|
95
93
|
get width () {
|
|
96
|
-
return window.store.innerWidth
|
|
97
|
-
(window.store.pinned ? sidebarPanelWidth : 0)
|
|
94
|
+
return window.store.innerWidth
|
|
98
95
|
}
|
|
99
96
|
|
|
100
97
|
get currentQuickCommands () {
|
|
@@ -226,7 +223,7 @@ class Store {
|
|
|
226
223
|
}
|
|
227
224
|
|
|
228
225
|
get topMenuHeight () {
|
|
229
|
-
return
|
|
226
|
+
return 0
|
|
230
227
|
}
|
|
231
228
|
|
|
232
229
|
get tabsHeight () {
|
|
@@ -25,7 +25,7 @@ import * as ls from '../common/safe-local-storage'
|
|
|
25
25
|
|
|
26
26
|
const { prefix } = window
|
|
27
27
|
const t = prefix('terminalThemes')
|
|
28
|
-
const e = prefix('
|
|
28
|
+
const e = prefix('common')
|
|
29
29
|
const newQuickCommand = 'newQuickCommand'
|
|
30
30
|
const q = prefix('quickCommands')
|
|
31
31
|
|