@electerm/electerm-react 1.39.76 → 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 +8 -0
- package/client/common/create-title.jsx +3 -4
- package/client/common/default-setting.js +2 -1
- 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/color-picker.jsx +1 -1
- 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 +36 -35
- 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/footer/footer.styl +1 -1
- 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 +3 -5
- 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-item.jsx +25 -0
- package/client/components/setting-sync/data-select.jsx +39 -0
- package/client/components/setting-sync/setting-sync-form.jsx +8 -12
- package/client/components/setting-sync/setting-sync.jsx +12 -1
- 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 +8 -10
- 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/side-panel.jsx +3 -2
- 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-title.jsx +1 -1
- package/client/components/tabs/tab.jsx +30 -8
- package/client/components/tabs/tabs.styl +3 -0
- package/client/components/tabs/window-control.jsx +4 -5
- package/client/components/terminal/index.jsx +6 -8
- package/client/components/terminal/term-search.jsx +7 -7
- 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/data-cols-parser.jsx +13 -11
- package/client/components/terminal-info/terminal-info.styl +5 -4
- 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/tree-list/tree-list.styl +3 -2
- 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/sync.js +104 -54
- package/client/store/system-menu.js +4 -6
- package/client/store/terminal-theme.js +2 -4
- package/package.json +1 -1
|
@@ -22,12 +22,7 @@ import {
|
|
|
22
22
|
} from '../../common/constants'
|
|
23
23
|
import './info.styl'
|
|
24
24
|
|
|
25
|
-
const
|
|
26
|
-
const e = prefix('control')
|
|
27
|
-
const m = prefix('menu')
|
|
28
|
-
const c = prefix('common')
|
|
29
|
-
const a = prefix('app')
|
|
30
|
-
const s = prefix('setting')
|
|
25
|
+
const e = window.translate
|
|
31
26
|
|
|
32
27
|
export default class InfoModal extends Component {
|
|
33
28
|
handleChangeTab = key => {
|
|
@@ -103,14 +98,14 @@ export default class InfoModal extends Component {
|
|
|
103
98
|
}
|
|
104
99
|
const title = (
|
|
105
100
|
<div className='ant-modal-confirm-title font16'>
|
|
106
|
-
<InfoCircleOutlined className='font20 mg1r' /> {
|
|
101
|
+
<InfoCircleOutlined className='font20 mg1r' /> {e('about')} {name}
|
|
107
102
|
</div>
|
|
108
103
|
)
|
|
109
104
|
const attrs = {
|
|
110
105
|
title,
|
|
111
106
|
width: window.innerWidth - 100,
|
|
112
107
|
maskClosable: true,
|
|
113
|
-
okText:
|
|
108
|
+
okText: e('ok'),
|
|
114
109
|
onCancel: onCloseAbout,
|
|
115
110
|
footer: null,
|
|
116
111
|
open: true,
|
|
@@ -119,11 +114,11 @@ export default class InfoModal extends Component {
|
|
|
119
114
|
const items = [
|
|
120
115
|
{
|
|
121
116
|
key: infoTabs.info,
|
|
122
|
-
label:
|
|
117
|
+
label: e('about'),
|
|
123
118
|
children: (
|
|
124
119
|
<div>
|
|
125
120
|
<LogoElem />
|
|
126
|
-
<p className='mg2b'>{
|
|
121
|
+
<p className='mg2b'>{e('desc')}</p>
|
|
127
122
|
<p className='mg1b'>
|
|
128
123
|
<UserOutlined /> <b className='mg1r'>{e('author')} ➾</b>
|
|
129
124
|
<Link to={authorUrl} className='mg1l'>
|
|
@@ -143,7 +138,7 @@ export default class InfoModal extends Component {
|
|
|
143
138
|
</Link>
|
|
144
139
|
</p>
|
|
145
140
|
<p className='mg1b'>
|
|
146
|
-
<GlobalOutlined /> <b className='mg1r'>{
|
|
141
|
+
<GlobalOutlined /> <b className='mg1r'>{e('language')} repo ➾</b>
|
|
147
142
|
<Link to={langugeRepo} className='mg1l'>
|
|
148
143
|
{langugeRepo}
|
|
149
144
|
</Link>
|
|
@@ -155,25 +150,25 @@ export default class InfoModal extends Component {
|
|
|
155
150
|
</Link>
|
|
156
151
|
</p>
|
|
157
152
|
<p className='mg1b'>
|
|
158
|
-
<HighlightOutlined /> <b className='mg1r'>{
|
|
153
|
+
<HighlightOutlined /> <b className='mg1r'>{e('changeLog')} ➾</b>
|
|
159
154
|
<Link to={releaseLink} className='mg1l'>
|
|
160
155
|
{releaseLink}
|
|
161
156
|
</Link>
|
|
162
157
|
</p>
|
|
163
158
|
<p className='mg1b'>
|
|
164
|
-
<AlignLeftOutlined /> <b className='mg1r'>{
|
|
159
|
+
<AlignLeftOutlined /> <b className='mg1r'>{e('knownIssues')} ➾</b>
|
|
165
160
|
<Link to={knownIssuesLink} className='mg1l'>
|
|
166
161
|
{knownIssuesLink}
|
|
167
162
|
</Link>
|
|
168
163
|
</p>
|
|
169
164
|
<p className='mg1b'>
|
|
170
|
-
<WarningOutlined /> <b className='mg1r'>{
|
|
165
|
+
<WarningOutlined /> <b className='mg1r'>{e('privacyNotice')} ➾</b>
|
|
171
166
|
<Link to={privacyNoticeLink} className='mg1l'>
|
|
172
167
|
{privacyNoticeLink}
|
|
173
168
|
</Link>
|
|
174
169
|
</p>
|
|
175
170
|
<p className='mg1b'>
|
|
176
|
-
<HeartOutlined /> <b className='mg1r'>{
|
|
171
|
+
<HeartOutlined /> <b className='mg1r'>{e('sponsorElecterm')} ➾</b>
|
|
177
172
|
<Link to={sponsorLink} className='mg1l'>
|
|
178
173
|
{sponsorLink}
|
|
179
174
|
</Link>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PureComponent } from 'react'
|
|
2
2
|
export default class SidePanel extends PureComponent {
|
|
3
3
|
handleMousedown = (e) => {
|
|
4
|
+
e.stopPropagation()
|
|
4
5
|
this.dragStart = true
|
|
5
6
|
this.clientX = e.clientX
|
|
6
7
|
window.addEventListener('mouseup', this.handleMouseup)
|
|
@@ -13,8 +14,8 @@ export default class SidePanel extends PureComponent {
|
|
|
13
14
|
clientX
|
|
14
15
|
} = e
|
|
15
16
|
let nw = clientX - this.clientX + this.props.leftSidebarWidth
|
|
16
|
-
if (nw <
|
|
17
|
-
nw =
|
|
17
|
+
if (nw < 150) {
|
|
18
|
+
nw = 150
|
|
18
19
|
} else if (nw > 600) {
|
|
19
20
|
nw = 600
|
|
20
21
|
}
|
|
@@ -11,10 +11,7 @@ import './transfer-history.styl'
|
|
|
11
11
|
import { get as _get } from 'lodash-es'
|
|
12
12
|
import { filesize } from 'filesize'
|
|
13
13
|
|
|
14
|
-
const
|
|
15
|
-
const e = prefix('transferHistory')
|
|
16
|
-
const f = prefix('sftp')
|
|
17
|
-
const m = prefix('menu')
|
|
14
|
+
const e = window.translate
|
|
18
15
|
const timeRender = t => time(t)
|
|
19
16
|
const sorterFactory = prop => {
|
|
20
17
|
return (a, b) => {
|
|
@@ -59,7 +56,7 @@ export default class TransferHistoryModal extends Component {
|
|
|
59
56
|
)
|
|
60
57
|
}
|
|
61
58
|
}, {
|
|
62
|
-
title:
|
|
59
|
+
title: e('host'),
|
|
63
60
|
dataIndex: 'host',
|
|
64
61
|
key: 'host',
|
|
65
62
|
sorter: sorterFactory('host')
|
|
@@ -80,7 +77,7 @@ export default class TransferHistoryModal extends Component {
|
|
|
80
77
|
},
|
|
81
78
|
sorter: sorterFactory('toPath')
|
|
82
79
|
}, {
|
|
83
|
-
title:
|
|
80
|
+
title: e('size'),
|
|
84
81
|
dataIndex: 'size',
|
|
85
82
|
key: 'size',
|
|
86
83
|
sorter: sorterFactory('size'),
|
|
@@ -5,9 +5,7 @@ import {
|
|
|
5
5
|
import Transports from './transfer-list-control'
|
|
6
6
|
import TransportHistory from './transfer-history-modal'
|
|
7
7
|
|
|
8
|
-
const
|
|
9
|
-
const e = prefix('sftp')
|
|
10
|
-
const t = prefix('transferHistory')
|
|
8
|
+
const e = window.translate
|
|
11
9
|
|
|
12
10
|
export default class TransferModal extends Component {
|
|
13
11
|
renderTransfer = () => {
|
|
@@ -46,7 +44,7 @@ export default class TransferModal extends Component {
|
|
|
46
44
|
}
|
|
47
45
|
if (transferHistory.length) {
|
|
48
46
|
tabs.push({
|
|
49
|
-
title:
|
|
47
|
+
title: e('transferHistory'),
|
|
50
48
|
id: 'history',
|
|
51
49
|
render: this.renderHistory
|
|
52
50
|
})
|
|
@@ -31,16 +31,16 @@ import BookmarksList from '../sidebar/bookmark-select'
|
|
|
31
31
|
import AppDrag from './app-drag'
|
|
32
32
|
import classNames from 'classnames'
|
|
33
33
|
|
|
34
|
-
const
|
|
35
|
-
const e = prefix('tabs')
|
|
36
|
-
const c = prefix('control')
|
|
37
|
-
const t = prefix('tabs')
|
|
34
|
+
const e = window.translate
|
|
38
35
|
const MenuItem = Menu.Item
|
|
39
36
|
|
|
40
37
|
export default class Tabs extends React.Component {
|
|
41
38
|
constructor (props) {
|
|
42
39
|
super(props)
|
|
43
40
|
this.tabsRef = React.createRef()
|
|
41
|
+
this.state = {
|
|
42
|
+
overflow: false
|
|
43
|
+
}
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
componentDidMount () {
|
|
@@ -53,11 +53,10 @@ export default class Tabs extends React.Component {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
componentDidUpdate (prevProps) {
|
|
56
|
-
prevProps = prevProps || {}
|
|
57
56
|
if (
|
|
58
57
|
prevProps.currentTabId !== this.props.currentTabId ||
|
|
59
58
|
prevProps.width !== this.props.width ||
|
|
60
|
-
prevProps.tabs.
|
|
59
|
+
prevProps.tabs.length !== this.props.tabs.length
|
|
61
60
|
) {
|
|
62
61
|
this.adjustScroll()
|
|
63
62
|
}
|
|
@@ -72,12 +71,17 @@ export default class Tabs extends React.Component {
|
|
|
72
71
|
}
|
|
73
72
|
|
|
74
73
|
isOverflow = () => {
|
|
75
|
-
const { tabs = []
|
|
74
|
+
const { tabs = [] } = this.props
|
|
76
75
|
const len = tabs.length
|
|
77
76
|
const addBtnWidth = 22
|
|
78
|
-
const tabsWidth = this.tabsWidth()
|
|
79
|
-
const
|
|
80
|
-
return
|
|
77
|
+
const tabsWidth = this.tabsWidth() + tabMargin * len + addBtnWidth
|
|
78
|
+
const tabsInnerWidth = this.getInnerWidth()
|
|
79
|
+
return tabsWidth > tabsInnerWidth
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
getInnerWidth = () => {
|
|
83
|
+
const inner = document.querySelector('.tabs-inner')
|
|
84
|
+
return inner ? inner.clientWidth : 0
|
|
81
85
|
}
|
|
82
86
|
|
|
83
87
|
handleClickEvent = (e) => {
|
|
@@ -98,7 +102,7 @@ export default class Tabs extends React.Component {
|
|
|
98
102
|
}
|
|
99
103
|
|
|
100
104
|
adjustScroll = () => {
|
|
101
|
-
const {
|
|
105
|
+
const { tabs, currentTabId } = this.props
|
|
102
106
|
const index = findIndex(tabs, t => t.id === currentTabId)
|
|
103
107
|
const tabsDomWith = Array.from(
|
|
104
108
|
document.querySelectorAll('.tab')
|
|
@@ -106,10 +110,14 @@ export default class Tabs extends React.Component {
|
|
|
106
110
|
return prev + c.clientWidth
|
|
107
111
|
}, 0)
|
|
108
112
|
const w = (index + 1) * tabMargin + 5 + tabsDomWith
|
|
109
|
-
const
|
|
110
|
-
|
|
113
|
+
const tabsInnerWidth = this.getInnerWidth()
|
|
114
|
+
const scrollLeft = w > tabsInnerWidth
|
|
115
|
+
? w - tabsInnerWidth
|
|
111
116
|
: 0
|
|
112
117
|
this.dom.scrollLeft = scrollLeft
|
|
118
|
+
this.setState({
|
|
119
|
+
overflow: this.isOverflow()
|
|
120
|
+
})
|
|
113
121
|
}
|
|
114
122
|
|
|
115
123
|
handleScrollLeft = () => {
|
|
@@ -178,13 +186,13 @@ export default class Tabs extends React.Component {
|
|
|
178
186
|
className={cls}
|
|
179
187
|
onClick={onNewSsh}
|
|
180
188
|
>
|
|
181
|
-
<CodeFilled /> {
|
|
189
|
+
<CodeFilled /> {e('newBookmark')}
|
|
182
190
|
</div>
|
|
183
191
|
<div
|
|
184
192
|
className={cls}
|
|
185
193
|
onClick={() => addTab()}
|
|
186
194
|
>
|
|
187
|
-
<RightSquareFilled /> {
|
|
195
|
+
<RightSquareFilled /> {e('newTab')}
|
|
188
196
|
</div>
|
|
189
197
|
<BookmarksList
|
|
190
198
|
store={window.store}
|
|
@@ -252,7 +260,7 @@ export default class Tabs extends React.Component {
|
|
|
252
260
|
const { tabs = [], width } = this.props
|
|
253
261
|
const len = tabs.length
|
|
254
262
|
const tabsWidthAll = tabMargin * len + 10 + this.tabsWidth()
|
|
255
|
-
const overflow = this.
|
|
263
|
+
const { overflow } = this.state
|
|
256
264
|
const left = overflow
|
|
257
265
|
? '100%'
|
|
258
266
|
: tabsWidthAll
|
|
@@ -291,9 +299,9 @@ export default class Tabs extends React.Component {
|
|
|
291
299
|
})
|
|
292
300
|
}
|
|
293
301
|
{
|
|
294
|
-
|
|
295
|
-
?
|
|
296
|
-
:
|
|
302
|
+
overflow
|
|
303
|
+
? null
|
|
304
|
+
: this.renderAddBtn()
|
|
297
305
|
}
|
|
298
306
|
</div>
|
|
299
307
|
</div>
|
|
@@ -301,7 +309,7 @@ export default class Tabs extends React.Component {
|
|
|
301
309
|
}
|
|
302
310
|
|
|
303
311
|
render () {
|
|
304
|
-
const overflow = this.
|
|
312
|
+
const { overflow } = this.state
|
|
305
313
|
return (
|
|
306
314
|
<div className='tabs' ref={this.tabsRef}>
|
|
307
315
|
{this.renderContent()}
|
|
@@ -23,10 +23,7 @@ import {
|
|
|
23
23
|
} from '../../common/constants'
|
|
24
24
|
import { shortcutDescExtend } from '../shortcuts/shortcut-handler.js'
|
|
25
25
|
|
|
26
|
-
const
|
|
27
|
-
const e = prefix('tabs')
|
|
28
|
-
const m = prefix('menu')
|
|
29
|
-
const s = prefix('sftp')
|
|
26
|
+
const e = window.translate
|
|
30
27
|
const onDragCls = 'ondrag-tab'
|
|
31
28
|
const onDragOverCls = 'dragover-tab'
|
|
32
29
|
|
|
@@ -58,6 +55,31 @@ class Tab extends Component {
|
|
|
58
55
|
clearTimeout(this.handler)
|
|
59
56
|
}
|
|
60
57
|
|
|
58
|
+
shouldComponentUpdate (nextProps, nextState) {
|
|
59
|
+
return this.shouldUpdate(this.props, nextProps) || this.shouldUpdateState(this.state, nextState)
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
shouldUpdateState = (prevState, nextState) => {
|
|
63
|
+
return !isEqual(prevState, nextState)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
shouldUpdate = (prevProps, nextProps) => {
|
|
67
|
+
// todo currentTabId still need improve
|
|
68
|
+
const pickKeys = [
|
|
69
|
+
'currentTabId',
|
|
70
|
+
'height',
|
|
71
|
+
'isLast',
|
|
72
|
+
'isMaximized',
|
|
73
|
+
'activeTerminalId',
|
|
74
|
+
'config',
|
|
75
|
+
'tab',
|
|
76
|
+
'width'
|
|
77
|
+
]
|
|
78
|
+
|
|
79
|
+
// compare only the relevant props
|
|
80
|
+
return !isEqual(pick(prevProps, pickKeys), pick(nextProps, pickKeys))
|
|
81
|
+
}
|
|
82
|
+
|
|
61
83
|
modifier = (...args) => {
|
|
62
84
|
runIdle(() => this.setState(...args))
|
|
63
85
|
}
|
|
@@ -290,7 +312,7 @@ class Tab extends Component {
|
|
|
290
312
|
res.push({
|
|
291
313
|
func: 'handleReloadTab',
|
|
292
314
|
icon: 'Loading3QuartersOutlined',
|
|
293
|
-
text:
|
|
315
|
+
text: e('reload'),
|
|
294
316
|
subText: reloadShortcut
|
|
295
317
|
})
|
|
296
318
|
return res
|
|
@@ -363,8 +385,8 @@ class Tab extends Component {
|
|
|
363
385
|
tunnel = `sock5://${sshTunnelLocalHost}:${sshTunnelLocalPort}`
|
|
364
386
|
} else {
|
|
365
387
|
tunnel = sshTunnel === 'forwardRemoteToLocal'
|
|
366
|
-
? `-> ${
|
|
367
|
-
: `-> ${
|
|
388
|
+
? `-> ${e('remote')}:${sshTunnelRemoteHost}:${sshTunnelRemotePort} -> ${sshTunnelLocalHost}:${sshTunnelLocalPort}`
|
|
389
|
+
: `-> ${e('local')}:${sshTunnelLocalHost}:${sshTunnelLocalPort} -> ${sshTunnelRemoteHost}:${sshTunnelRemotePort}`
|
|
368
390
|
}
|
|
369
391
|
if (error) {
|
|
370
392
|
tunnel = `error: ${tunnel}`
|
|
@@ -462,7 +484,7 @@ class Tab extends Component {
|
|
|
462
484
|
<Loading3QuartersOutlined
|
|
463
485
|
className='pointer tab-reload mg1r'
|
|
464
486
|
onClick={this.handleReloadTab}
|
|
465
|
-
title={
|
|
487
|
+
title={e('reload')}
|
|
466
488
|
/>
|
|
467
489
|
<span className='tab-title'>
|
|
468
490
|
{tabCount}. {title}
|
|
@@ -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
|
},
|
|
@@ -1226,7 +1224,7 @@ class Term extends Component {
|
|
|
1226
1224
|
}
|
|
1227
1225
|
|
|
1228
1226
|
oncloseSocket = () => {
|
|
1229
|
-
if (this.onClose ||
|
|
1227
|
+
if (this.onClose || this.props.tab.enableSsh === false) {
|
|
1230
1228
|
return
|
|
1231
1229
|
}
|
|
1232
1230
|
this.setStatus(
|
|
@@ -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}
|
|
@@ -197,10 +196,11 @@ class TermSearch extends Component {
|
|
|
197
196
|
termSearchOpen,
|
|
198
197
|
termSearch
|
|
199
198
|
} = store
|
|
200
|
-
if (
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
199
|
+
if (
|
|
200
|
+
!termSearchOpen ||
|
|
201
|
+
!currentTab ||
|
|
202
|
+
currentTab.pane === paneMap.fileManager
|
|
203
|
+
) {
|
|
204
204
|
return null
|
|
205
205
|
}
|
|
206
206
|
const props = {
|
|
@@ -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
|
|
@@ -2,9 +2,6 @@ import { copy } from '../../common/clipboard'
|
|
|
2
2
|
import filesizeParser from 'filesize-parser'
|
|
3
3
|
import { formatBytes } from '../../common/byte-format'
|
|
4
4
|
|
|
5
|
-
const { prefix } = window
|
|
6
|
-
const m = prefix('menu')
|
|
7
|
-
|
|
8
5
|
const valueParserMaps = {
|
|
9
6
|
size: v => v,
|
|
10
7
|
used: filesizeParser,
|
|
@@ -19,19 +16,24 @@ function valueParse (obj, k) {
|
|
|
19
16
|
return obj[k]
|
|
20
17
|
}
|
|
21
18
|
|
|
19
|
+
function copyValue (event) {
|
|
20
|
+
copy(event.target.getAttribute('data-content'))
|
|
21
|
+
}
|
|
22
|
+
|
|
22
23
|
export default (data) => {
|
|
23
24
|
return Object.keys(data).map(k => {
|
|
24
25
|
const rd = (txt) => {
|
|
25
26
|
const r = k === 'mem' ? formatBytes(parseInt(txt, 10)) : txt
|
|
27
|
+
const itemProps = {
|
|
28
|
+
className: 'activity-item pointer',
|
|
29
|
+
'data-content': r,
|
|
30
|
+
onClick: copyValue
|
|
31
|
+
}
|
|
26
32
|
return (
|
|
27
|
-
<div
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
onClick={() => copy(txt)}
|
|
32
|
-
>
|
|
33
|
-
{m('copy')}
|
|
34
|
-
</span>
|
|
33
|
+
<div
|
|
34
|
+
{...itemProps}
|
|
35
|
+
>
|
|
36
|
+
{r}
|
|
35
37
|
</div>
|
|
36
38
|
)
|
|
37
39
|
}
|
|
@@ -29,10 +29,11 @@
|
|
|
29
29
|
max-height 260px
|
|
30
30
|
overflow-y scroll
|
|
31
31
|
.activity-item
|
|
32
|
-
.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
max-height 1.6em
|
|
33
|
+
line-height 1.6
|
|
34
|
+
overflow hidden
|
|
35
|
+
&:hover
|
|
36
|
+
max-height none
|
|
36
37
|
.info-panel-wrap-pin
|
|
37
38
|
.toggle-info-panel-wrap
|
|
38
39
|
color success
|