@electerm/electerm-react 1.40.20 → 1.50.31
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 +57 -7
- package/client/common/new-terminal.js +2 -2
- package/client/components/auth/login.jsx +34 -57
- package/client/components/batch-op/batch-op.jsx +12 -11
- package/client/components/bookmark-form/index.jsx +2 -2
- package/client/components/bookmark-form/ssh-form.jsx +4 -1
- package/client/components/bookmark-form/tree-delete.jsx +5 -5
- package/client/components/context-menu/boomarks.jsx +8 -12
- package/client/components/context-menu/context-menu.jsx +10 -10
- package/client/components/context-menu/history.jsx +21 -24
- package/client/components/context-menu/menu-btn.jsx +11 -11
- package/client/components/context-menu/tabs.jsx +15 -19
- package/client/components/context-menu/zoom.jsx +25 -29
- package/client/components/footer/footer-entry.jsx +56 -56
- package/client/components/icons/split-icons.jsx +77 -0
- package/client/components/layout/layout-alg.js +260 -0
- package/client/components/layout/layout-item.jsx +94 -0
- package/client/components/layout/layout.jsx +167 -0
- package/client/components/layout/layout.styl +8 -0
- package/client/components/layout/layouts.jsx +72 -0
- package/client/components/layout/session-size-alg.js +31 -0
- package/client/components/main/custom-css.jsx +1 -1
- package/client/components/main/main.jsx +184 -110
- package/client/components/main/ui-theme.jsx +1 -1
- package/client/components/main/wrapper.styl +2 -4
- package/client/components/profile/profile-list.jsx +1 -3
- package/client/components/profile/profile-transport-mod.jsx +1 -1
- package/client/components/profile/profile-transport.jsx +6 -9
- package/client/components/quick-commands/quick-command-transport.jsx +6 -9
- package/client/components/quick-commands/quick-commands-box.jsx +144 -153
- package/client/components/quick-commands/quick-commands-select.jsx +10 -3
- package/client/components/rdp/rdp-session.jsx +3 -23
- package/client/components/rdp/resolution-edit.jsx +40 -42
- package/client/components/session/session.jsx +63 -328
- package/client/components/session/session.styl +1 -5
- package/client/components/session/sessions.jsx +140 -111
- package/client/components/setting-panel/bookmark-tree-list.jsx +1 -1
- package/client/components/setting-panel/setting-common.jsx +6 -4
- package/client/components/setting-panel/setting-modal.jsx +31 -31
- package/client/components/setting-panel/start-session-select.jsx +4 -4
- package/client/components/setting-panel/tab-settings.jsx +27 -5
- package/client/components/setting-sync/data-import.jsx +36 -39
- package/client/components/setting-sync/setting-sync-form.jsx +10 -10
- package/client/components/setting-sync/setting-sync.jsx +50 -52
- package/client/components/sftp/address-bookmark.jsx +57 -58
- package/client/components/sftp/confirm-modal-store.jsx +34 -40
- package/client/components/sftp/file-item.jsx +14 -3
- package/client/components/sftp/file-mode-modal.jsx +3 -0
- package/client/components/sftp/list-table-ui.jsx +4 -4
- package/client/components/sftp/sftp-entry.jsx +2 -2
- package/client/components/sftp/transfer-conflict-store.jsx +13 -17
- package/client/components/sftp/transport-action-store.jsx +38 -31
- package/client/components/sftp/transports-action-store.jsx +3 -3
- package/client/components/sftp/transports-ui-store.jsx +18 -23
- package/client/components/shortcuts/shortcut-handler.js +1 -0
- package/client/components/shortcuts/shortcuts-defaults.js +5 -5
- package/client/components/shortcuts/shortcuts.jsx +9 -12
- package/client/components/side-panel-r/right-side-panel.styl +40 -0
- package/client/components/side-panel-r/side-panel-r.jsx +102 -0
- package/client/components/sidebar/bookmark-select.jsx +40 -40
- package/client/components/sidebar/bookmark.jsx +63 -65
- package/client/components/sidebar/history.jsx +53 -50
- package/client/components/sidebar/index.jsx +195 -184
- package/client/components/sidebar/info-modal.jsx +202 -202
- package/client/components/sidebar/sidebar.styl +8 -2
- package/client/components/sidebar/transfer-history-modal.jsx +95 -100
- package/client/components/sidebar/transfer-list-control.jsx +2 -2
- package/client/components/sidebar/transfer-list.jsx +45 -42
- package/client/components/sidebar/transfer-modal.jsx +49 -52
- package/client/components/sidebar/transport-ui.jsx +1 -1
- package/client/components/tabs/index.jsx +261 -49
- package/client/components/tabs/tab.jsx +48 -66
- package/client/components/tabs/tabs.styl +6 -1
- package/client/components/tabs/window-control.jsx +46 -48
- package/client/components/terminal/attach-addon-custom.js +1 -1
- package/client/components/terminal/index.jsx +111 -113
- package/client/components/terminal/term-search.jsx +26 -24
- package/client/components/terminal-info/run-cmd.jsx +0 -25
- package/client/components/terminal-info/terminal-info.jsx +60 -0
- package/client/components/terminal-info/terminal-info.styl +1 -1
- package/client/components/tree-list/bookmark-transport.jsx +8 -9
- package/client/components/tree-list/tree-list.jsx +36 -26
- package/client/components/vnc/vnc-session.jsx +1 -6
- package/client/components/web/address-bar.jsx +50 -0
- package/client/components/web/web-session.jsx +32 -10
- package/client/entry/index.jsx +5 -6
- package/client/store/common.js +1 -1
- package/client/store/db-upgrade.js +1 -1
- package/client/store/event.js +2 -2
- package/client/store/index.js +21 -32
- package/client/store/init-state.js +15 -3
- package/client/store/load-data.js +1 -1
- package/client/store/quick-command.js +4 -4
- package/client/store/session.js +1 -1
- package/client/store/setting.js +10 -6
- package/client/store/system-menu.js +1 -10
- package/client/store/tab.js +91 -1
- package/client/store/transfer-list.js +5 -6
- package/client/store/watch.js +11 -6
- package/package.json +1 -1
- package/client/components/common/react-subx.jsx +0 -1
- package/client/components/common/resize-wrap.jsx +0 -222
- package/client/components/common/resize-wrap.styl +0 -9
- package/client/components/terminal-info/content.jsx +0 -152
|
@@ -7,91 +7,42 @@ import Sftp from '../sftp/sftp-entry'
|
|
|
7
7
|
import RdpSession from '../rdp/rdp-session'
|
|
8
8
|
import VncSession from '../vnc/vnc-session'
|
|
9
9
|
import {
|
|
10
|
-
BorderVerticleOutlined,
|
|
11
|
-
BorderHorizontalOutlined,
|
|
12
|
-
CloseSquareFilled,
|
|
13
10
|
SearchOutlined,
|
|
14
11
|
FullscreenOutlined,
|
|
15
12
|
PaperClipOutlined,
|
|
16
|
-
CloseOutlined
|
|
17
|
-
QuestionCircleOutlined
|
|
13
|
+
CloseOutlined
|
|
18
14
|
} from '@ant-design/icons'
|
|
19
15
|
import {
|
|
20
16
|
Tooltip
|
|
21
17
|
} from 'antd'
|
|
22
|
-
import {
|
|
18
|
+
import { pick } from 'lodash-es'
|
|
23
19
|
import generate from '../../common/uid'
|
|
24
20
|
import copy from 'json-deep-copy'
|
|
25
21
|
import classnames from 'classnames'
|
|
26
22
|
import {
|
|
27
|
-
quickCommandBoxHeight,
|
|
28
|
-
terminalSplitDirectionMap,
|
|
29
|
-
termControlHeight,
|
|
30
23
|
paneMap,
|
|
31
|
-
footerHeight,
|
|
32
24
|
terminalActions,
|
|
33
25
|
connectionMap,
|
|
34
26
|
terminalRdpType,
|
|
35
27
|
terminalVncType
|
|
36
28
|
} from '../../common/constants'
|
|
37
|
-
import ResizeWrap from '../common/resize-wrap'
|
|
38
29
|
import safeName from '../../common/safe-name'
|
|
39
|
-
import TerminalInfoContent from '../terminal-info/content'
|
|
40
|
-
import uid from '../../common/id-with-stamp'
|
|
41
|
-
import Link from '../common/external-link'
|
|
42
30
|
import postMessage from '../../common/post-msg'
|
|
43
31
|
import './session.styl'
|
|
44
32
|
|
|
45
|
-
const rebuildPosition = terminals => {
|
|
46
|
-
const indexs = terminals.map(t => t.position).sort((a, b) => a - b)
|
|
47
|
-
const indexMap = indexs.reduce((prev, pos, index) => {
|
|
48
|
-
return {
|
|
49
|
-
...prev,
|
|
50
|
-
[pos]: index * 10
|
|
51
|
-
}
|
|
52
|
-
}, {})
|
|
53
|
-
return terminals.map(t => {
|
|
54
|
-
return {
|
|
55
|
-
...t,
|
|
56
|
-
position: indexMap[t.position]
|
|
57
|
-
}
|
|
58
|
-
})
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const getPrevTerminal = terminals => {
|
|
62
|
-
return last(terminals)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
33
|
const e = window.translate
|
|
66
34
|
|
|
67
35
|
export default class SessionWrapper extends Component {
|
|
68
36
|
constructor (props) {
|
|
69
37
|
super(props)
|
|
70
|
-
const id = uid()
|
|
71
|
-
const {
|
|
72
|
-
terminals = [
|
|
73
|
-
{
|
|
74
|
-
id,
|
|
75
|
-
position: 0
|
|
76
|
-
}
|
|
77
|
-
]
|
|
78
|
-
} = props.tab
|
|
79
|
-
const activeSplitId = terminals[0].id
|
|
80
38
|
this.state = {
|
|
81
|
-
pid: null,
|
|
82
39
|
enableSftp: false,
|
|
83
40
|
cwd: '',
|
|
84
41
|
sftpPathFollowSsh: !!props.config.sftpPathFollowSsh,
|
|
85
|
-
splitDirection: terminalSplitDirectionMap.horizontal,
|
|
86
|
-
activeSplitId,
|
|
87
|
-
infoPanelPinned: false,
|
|
88
42
|
key: Math.random(),
|
|
89
43
|
sessionOptions: null,
|
|
90
44
|
sessionId: generate(),
|
|
91
|
-
|
|
92
|
-
delKeyPressed: false,
|
|
93
|
-
showInfo: false,
|
|
94
|
-
infoPanelProps: {}
|
|
45
|
+
delKeyPressed: false
|
|
95
46
|
}
|
|
96
47
|
}
|
|
97
48
|
|
|
@@ -125,33 +76,9 @@ export default class SessionWrapper extends Component {
|
|
|
125
76
|
window.store.dismissDelKeyTip()
|
|
126
77
|
}
|
|
127
78
|
|
|
128
|
-
setCwd = (cwd
|
|
129
|
-
this.setState(old => {
|
|
130
|
-
return {
|
|
131
|
-
cwd,
|
|
132
|
-
terminals: old.terminals.map(t => {
|
|
133
|
-
if (t.id === tid) {
|
|
134
|
-
return {
|
|
135
|
-
...t,
|
|
136
|
-
cwd
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
return t
|
|
140
|
-
})
|
|
141
|
-
}
|
|
142
|
-
})
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
handleShowInfo = (infoPanelProps) => {
|
|
79
|
+
setCwd = (cwd) => {
|
|
146
80
|
this.setState({
|
|
147
|
-
|
|
148
|
-
infoPanelProps
|
|
149
|
-
})
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
toggleInfoPinned = () => {
|
|
153
|
-
this.setState({
|
|
154
|
-
infoPanelPinned: !this.state.infoPanelPinned
|
|
81
|
+
cwd
|
|
155
82
|
})
|
|
156
83
|
}
|
|
157
84
|
|
|
@@ -161,24 +88,6 @@ export default class SessionWrapper extends Component {
|
|
|
161
88
|
})
|
|
162
89
|
}
|
|
163
90
|
|
|
164
|
-
hideInfoPanel = () => {
|
|
165
|
-
this.setState({
|
|
166
|
-
showInfo: false
|
|
167
|
-
})
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
computeHeight = () => {
|
|
171
|
-
const {
|
|
172
|
-
pinnedQuickCommandBar,
|
|
173
|
-
tabsHeight
|
|
174
|
-
} = this.props
|
|
175
|
-
return this.props.height -
|
|
176
|
-
tabsHeight -
|
|
177
|
-
footerHeight -
|
|
178
|
-
termControlHeight -
|
|
179
|
-
(pinnedQuickCommandBar ? quickCommandBoxHeight : 0)
|
|
180
|
-
}
|
|
181
|
-
|
|
182
91
|
editTab = (up) => {
|
|
183
92
|
const {
|
|
184
93
|
tab,
|
|
@@ -202,124 +111,35 @@ export default class SessionWrapper extends Component {
|
|
|
202
111
|
this.editTab(update)
|
|
203
112
|
}
|
|
204
113
|
|
|
205
|
-
setSessionState = data => {
|
|
206
|
-
this.setState(data)
|
|
207
|
-
if (data.pid) {
|
|
208
|
-
this.editTab({
|
|
209
|
-
pid: data.pid
|
|
210
|
-
})
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
handleSplit = (e, id) => {
|
|
215
|
-
let terminals = copy(this.state.terminals)
|
|
216
|
-
let index = findIndex(terminals, t => t.id === id)
|
|
217
|
-
if (index === -1) {
|
|
218
|
-
index = terminals.length
|
|
219
|
-
} else {
|
|
220
|
-
index = index + 1
|
|
221
|
-
}
|
|
222
|
-
terminals.push({
|
|
223
|
-
id: uid(),
|
|
224
|
-
position: terminals[index - 1].position + 5
|
|
225
|
-
})
|
|
226
|
-
terminals = rebuildPosition(terminals)
|
|
227
|
-
this.setState({
|
|
228
|
-
terminals
|
|
229
|
-
}, this.updateTab)
|
|
230
|
-
}
|
|
231
|
-
|
|
232
114
|
updateTab = () => {
|
|
233
|
-
const terminals = copy(this.state.terminals)
|
|
234
115
|
this.editTab(
|
|
235
116
|
{
|
|
236
|
-
sessionId: this.state.sessionId
|
|
237
|
-
terminals
|
|
117
|
+
sessionId: this.state.sessionId
|
|
238
118
|
}
|
|
239
119
|
)
|
|
240
120
|
}
|
|
241
121
|
|
|
242
|
-
delSplit = (splitId = this.state.activeSplitId) => {
|
|
243
|
-
const { terminals } = this.state
|
|
244
|
-
let newTerms = terminals.filter(t => t.id !== splitId)
|
|
245
|
-
if (!newTerms.length) {
|
|
246
|
-
return this.props.delTab(
|
|
247
|
-
this.props.tab.id
|
|
248
|
-
)
|
|
249
|
-
}
|
|
250
|
-
newTerms = rebuildPosition(newTerms)
|
|
251
|
-
const newActiveId = getPrevTerminal(newTerms).id
|
|
252
|
-
this.setState({
|
|
253
|
-
terminals: newTerms,
|
|
254
|
-
activeSplitId: newActiveId
|
|
255
|
-
}, this.updateTab)
|
|
256
|
-
window.store.focus()
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
handleChangeDirection = () => {
|
|
260
|
-
const { splitDirection } = this.state
|
|
261
|
-
this.setState({
|
|
262
|
-
splitDirection: splitDirection === terminalSplitDirectionMap.horizontal
|
|
263
|
-
? terminalSplitDirectionMap.vertical
|
|
264
|
-
: terminalSplitDirectionMap.horizontal
|
|
265
|
-
})
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
setActive = activeSplitId => {
|
|
269
|
-
const up = {
|
|
270
|
-
activeSplitId
|
|
271
|
-
}
|
|
272
|
-
this.setState(up)
|
|
273
|
-
}
|
|
274
|
-
|
|
275
122
|
computePosition = (index) => {
|
|
276
|
-
const len = this.state.terminals.length || 1
|
|
277
123
|
const windowWidth = this.getWidth()
|
|
278
|
-
const
|
|
279
|
-
const isHori = splitDirection === terminalSplitDirectionMap.horizontal
|
|
280
|
-
const heightAll = this.computeHeight()
|
|
281
|
-
const width = isHori
|
|
282
|
-
? windowWidth / len
|
|
283
|
-
: windowWidth
|
|
284
|
-
const height = isHori
|
|
285
|
-
? heightAll
|
|
286
|
-
: heightAll / len
|
|
287
|
-
const left = isHori
|
|
288
|
-
? index * width
|
|
289
|
-
: 0
|
|
290
|
-
const top = isHori
|
|
291
|
-
? 0
|
|
292
|
-
: index * height
|
|
124
|
+
const heightAll = this.props.computeHeight()
|
|
293
125
|
return {
|
|
294
|
-
height,
|
|
295
|
-
width,
|
|
296
|
-
left,
|
|
297
|
-
top
|
|
126
|
+
height: heightAll,
|
|
127
|
+
width: windowWidth,
|
|
128
|
+
left: 0,
|
|
129
|
+
top: 0
|
|
298
130
|
}
|
|
299
131
|
}
|
|
300
132
|
|
|
301
133
|
getWidth = () => {
|
|
302
|
-
|
|
303
|
-
infoPanelPinned,
|
|
304
|
-
showInfo
|
|
305
|
-
} = this.state
|
|
306
|
-
const { rightSidebarWidth, width, leftSidebarWidth, pinned, openedSideBar } = this.props
|
|
307
|
-
const rt = infoPanelPinned && showInfo ? rightSidebarWidth : 0
|
|
308
|
-
const lt = pinned && openedSideBar ? leftSidebarWidth : 0
|
|
309
|
-
return width - rt - lt - 42
|
|
134
|
+
return this.props.width
|
|
310
135
|
}
|
|
311
136
|
|
|
312
137
|
getWidthSftp = () => {
|
|
313
|
-
|
|
314
|
-
const lt = pinned && openedSideBar ? leftSidebarWidth : 0
|
|
315
|
-
return width - lt - 42
|
|
138
|
+
return this.props.width
|
|
316
139
|
}
|
|
317
140
|
|
|
318
141
|
renderTerminals = () => {
|
|
319
142
|
const {
|
|
320
|
-
terminals,
|
|
321
|
-
activeSplitId,
|
|
322
|
-
splitDirection,
|
|
323
143
|
sessionOptions,
|
|
324
144
|
sessionId,
|
|
325
145
|
sftpPathFollowSsh
|
|
@@ -347,8 +167,7 @@ export default class SessionWrapper extends Component {
|
|
|
347
167
|
...pick(
|
|
348
168
|
this,
|
|
349
169
|
[
|
|
350
|
-
'fullscreenIcon'
|
|
351
|
-
'setSessionState'
|
|
170
|
+
'fullscreenIcon'
|
|
352
171
|
])
|
|
353
172
|
}
|
|
354
173
|
if (type === terminalVncType) {
|
|
@@ -367,10 +186,25 @@ export default class SessionWrapper extends Component {
|
|
|
367
186
|
const cls = pane === paneMap.terminal
|
|
368
187
|
? 'terms-box'
|
|
369
188
|
: 'terms-box hide'
|
|
370
|
-
const height = this.computeHeight()
|
|
189
|
+
const height = this.props.computeHeight()
|
|
371
190
|
const { tab } = this.props
|
|
372
191
|
const width = this.getWidth()
|
|
373
192
|
const themeConfig = copy(window.store.getThemeConfig())
|
|
193
|
+
const logName = safeName(`${tab.title ? tab.title + '_' : ''}${tab.host ? tab.host + '_' : ''}${tab.id}`)
|
|
194
|
+
const pops = {
|
|
195
|
+
...this.props,
|
|
196
|
+
sftpPathFollowSsh,
|
|
197
|
+
themeConfig,
|
|
198
|
+
pane,
|
|
199
|
+
...pick(
|
|
200
|
+
this,
|
|
201
|
+
[
|
|
202
|
+
'onChangePane',
|
|
203
|
+
'setCwd',
|
|
204
|
+
'onDelKeyPressed'
|
|
205
|
+
]),
|
|
206
|
+
...this.computePosition()
|
|
207
|
+
}
|
|
374
208
|
return (
|
|
375
209
|
<div
|
|
376
210
|
className={cls}
|
|
@@ -379,48 +213,13 @@ export default class SessionWrapper extends Component {
|
|
|
379
213
|
height
|
|
380
214
|
}}
|
|
381
215
|
>
|
|
382
|
-
<
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
{
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
const pops = {
|
|
390
|
-
...this.props,
|
|
391
|
-
...t,
|
|
392
|
-
activeSplitId,
|
|
393
|
-
sftpPathFollowSsh,
|
|
394
|
-
themeConfig,
|
|
395
|
-
pane,
|
|
396
|
-
...pick(
|
|
397
|
-
this,
|
|
398
|
-
[
|
|
399
|
-
'setActive',
|
|
400
|
-
'handleSplit',
|
|
401
|
-
'delSplit',
|
|
402
|
-
'setSessionState',
|
|
403
|
-
'handleShowInfo',
|
|
404
|
-
'onChangePane',
|
|
405
|
-
'hideInfoPanel',
|
|
406
|
-
'setCwd',
|
|
407
|
-
'onDelKeyPressed'
|
|
408
|
-
]),
|
|
409
|
-
...this.computePosition(t.position / 10)
|
|
410
|
-
}
|
|
411
|
-
return (
|
|
412
|
-
<Term
|
|
413
|
-
key={t.id}
|
|
414
|
-
logName={logName}
|
|
415
|
-
sessionId={sessionId}
|
|
416
|
-
terminalIndex={index}
|
|
417
|
-
sessionOptions={sessionOptions}
|
|
418
|
-
{...pops}
|
|
419
|
-
/>
|
|
420
|
-
)
|
|
421
|
-
})
|
|
422
|
-
}
|
|
423
|
-
</ResizeWrap>
|
|
216
|
+
<Term
|
|
217
|
+
key={tab.id}
|
|
218
|
+
logName={logName}
|
|
219
|
+
sessionId={sessionId}
|
|
220
|
+
sessionOptions={sessionOptions}
|
|
221
|
+
{...pops}
|
|
222
|
+
/>
|
|
424
223
|
</div>
|
|
425
224
|
)
|
|
426
225
|
}
|
|
@@ -429,29 +228,28 @@ export default class SessionWrapper extends Component {
|
|
|
429
228
|
const {
|
|
430
229
|
sessionOptions,
|
|
431
230
|
sessionId,
|
|
432
|
-
pid,
|
|
433
231
|
enableSftp,
|
|
434
232
|
sftpPathFollowSsh,
|
|
435
233
|
cwd
|
|
436
234
|
} = this.state
|
|
437
|
-
const { pane, type } = this.props.tab
|
|
235
|
+
const { pane, type, id } = this.props.tab
|
|
438
236
|
if (type === terminalRdpType) {
|
|
439
237
|
return null
|
|
440
238
|
}
|
|
441
|
-
const height = this.computeHeight()
|
|
239
|
+
const height = this.props.computeHeight(pane)
|
|
442
240
|
const cls = pane === paneMap.terminal
|
|
443
241
|
? 'hide'
|
|
444
242
|
: ''
|
|
445
243
|
const exts = {
|
|
244
|
+
...this.props,
|
|
446
245
|
sftpPathFollowSsh,
|
|
447
246
|
cwd,
|
|
448
|
-
pid,
|
|
247
|
+
pid: id,
|
|
449
248
|
enableSftp,
|
|
450
249
|
sessionOptions,
|
|
451
250
|
height,
|
|
452
251
|
sessionId,
|
|
453
252
|
pane,
|
|
454
|
-
...this.props,
|
|
455
253
|
width: this.getWidthSftp()
|
|
456
254
|
}
|
|
457
255
|
return (
|
|
@@ -470,7 +268,7 @@ export default class SessionWrapper extends Component {
|
|
|
470
268
|
handleOpenSearch = () => {
|
|
471
269
|
postMessage({
|
|
472
270
|
action: terminalActions.openTerminalSearch,
|
|
473
|
-
|
|
271
|
+
currentTabId: this.props.tab.id
|
|
474
272
|
})
|
|
475
273
|
}
|
|
476
274
|
|
|
@@ -513,8 +311,22 @@ export default class SessionWrapper extends Component {
|
|
|
513
311
|
)
|
|
514
312
|
}
|
|
515
313
|
|
|
314
|
+
renderTermControls = () => {
|
|
315
|
+
const { props } = this
|
|
316
|
+
const { pane } = props.tab
|
|
317
|
+
if (pane !== paneMap.terminal) {
|
|
318
|
+
return null
|
|
319
|
+
}
|
|
320
|
+
return (
|
|
321
|
+
<div className='fright term-controls'>
|
|
322
|
+
{this.fullscreenIcon()}
|
|
323
|
+
{this.renderSearchIcon()}
|
|
324
|
+
</div>
|
|
325
|
+
)
|
|
326
|
+
}
|
|
327
|
+
|
|
516
328
|
renderControl = () => {
|
|
517
|
-
const {
|
|
329
|
+
const { sftpPathFollowSsh } = this.state
|
|
518
330
|
const { props } = this
|
|
519
331
|
const { pane, enableSsh, type } = props.tab
|
|
520
332
|
if (type === terminalRdpType || type === terminalVncType) {
|
|
@@ -523,16 +335,6 @@ export default class SessionWrapper extends Component {
|
|
|
523
335
|
const termType = props.tab?.type
|
|
524
336
|
const isSsh = props.tab.authType
|
|
525
337
|
const isLocal = !isSsh && (termType === connectionMap.local || !termType)
|
|
526
|
-
const isHori = splitDirection === terminalSplitDirectionMap.horizontal
|
|
527
|
-
const cls1 = 'mg1r icon-split pointer iblock spliter'
|
|
528
|
-
const cls2 = 'icon-direction pointer iblock spliter'
|
|
529
|
-
const Icon1 = isHori
|
|
530
|
-
? BorderHorizontalOutlined
|
|
531
|
-
: BorderVerticleOutlined
|
|
532
|
-
const Icon2 = !isHori
|
|
533
|
-
? BorderHorizontalOutlined
|
|
534
|
-
: BorderVerticleOutlined
|
|
535
|
-
const hide = terminals.length < 2
|
|
536
338
|
const types = [
|
|
537
339
|
paneMap.terminal,
|
|
538
340
|
paneMap.fileManager
|
|
@@ -543,18 +345,7 @@ export default class SessionWrapper extends Component {
|
|
|
543
345
|
if (isSsh || isLocal) {
|
|
544
346
|
controls.push(isSsh ? paneMap.sftp : paneMap.fileManager)
|
|
545
347
|
}
|
|
546
|
-
const checkTxt = (
|
|
547
|
-
<div>
|
|
548
|
-
<span>{e('sftpPathFollowSsh')}</span>
|
|
549
|
-
<span className='mg1l color-red'>[Beta]</span>
|
|
550
|
-
<Link
|
|
551
|
-
to='https://github.com/electerm/electerm/wiki/Warning-about-sftp-follow-ssh-path-function'
|
|
552
|
-
className='mg1l'
|
|
553
|
-
>
|
|
554
|
-
Wiki <QuestionCircleOutlined />
|
|
555
|
-
</Link>
|
|
556
|
-
</div>
|
|
557
|
-
)
|
|
348
|
+
const checkTxt = e('sftpPathFollowSsh') + ' [Beta]'
|
|
558
349
|
const checkProps = {
|
|
559
350
|
onClick: this.toggleCheckSftpPathFollowSsh,
|
|
560
351
|
className: classnames(
|
|
@@ -600,7 +391,7 @@ export default class SessionWrapper extends Component {
|
|
|
600
391
|
}
|
|
601
392
|
</div>
|
|
602
393
|
{
|
|
603
|
-
(isSsh && enableSsh
|
|
394
|
+
(isSsh && enableSsh) || isLocal
|
|
604
395
|
? (
|
|
605
396
|
<Tooltip title={checkTxt}>
|
|
606
397
|
<span {...checkProps}>
|
|
@@ -613,69 +404,16 @@ export default class SessionWrapper extends Component {
|
|
|
613
404
|
{
|
|
614
405
|
this.renderDelTip(pane === paneMap.terminal)
|
|
615
406
|
}
|
|
616
|
-
{
|
|
617
|
-
pane === paneMap.terminal
|
|
618
|
-
? (
|
|
619
|
-
<div className='fright term-controls'>
|
|
620
|
-
{this.fullscreenIcon()}
|
|
621
|
-
{this.renderSearchIcon()}
|
|
622
|
-
{
|
|
623
|
-
hide
|
|
624
|
-
? null
|
|
625
|
-
: (
|
|
626
|
-
<CloseSquareFilled
|
|
627
|
-
className='mg1r icon-trash font16 iblock pointer spliter'
|
|
628
|
-
onClick={() => this.delSplit()}
|
|
629
|
-
title={e('del')}
|
|
630
|
-
/>
|
|
631
|
-
)
|
|
632
|
-
}
|
|
633
|
-
<Tooltip
|
|
634
|
-
title={`${e('split')}`}
|
|
635
|
-
placement='bottomLeft'
|
|
636
|
-
>
|
|
637
|
-
<Icon1
|
|
638
|
-
className={cls1}
|
|
639
|
-
onClick={this.handleSplit}
|
|
640
|
-
/>
|
|
641
|
-
</Tooltip>
|
|
642
|
-
<Tooltip
|
|
643
|
-
title={e('changeDirection')}
|
|
644
|
-
placement='bottomLeft'
|
|
645
|
-
>
|
|
646
|
-
<Icon2
|
|
647
|
-
className={cls2}
|
|
648
|
-
onClick={this.handleChangeDirection}
|
|
649
|
-
/>
|
|
650
|
-
</Tooltip>
|
|
651
|
-
</div>
|
|
652
|
-
)
|
|
653
|
-
: null
|
|
654
|
-
}
|
|
407
|
+
{this.renderTermControls()}
|
|
655
408
|
</div>
|
|
656
409
|
)
|
|
657
410
|
}
|
|
658
411
|
|
|
659
412
|
render () {
|
|
660
413
|
const {
|
|
661
|
-
splitDirection
|
|
662
|
-
infoPanelProps,
|
|
663
|
-
showInfo,
|
|
664
|
-
infoPanelPinned
|
|
414
|
+
splitDirection
|
|
665
415
|
} = this.state
|
|
666
|
-
const { pane } = this.props.tab
|
|
667
|
-
const infoProps = {
|
|
668
|
-
infoPanelPinned,
|
|
669
|
-
...pick(this.props.config, ['host', 'port', 'saveTerminalLogToFile', 'terminalInfos']),
|
|
670
|
-
...infoPanelProps,
|
|
671
|
-
appPath: this.props.appPath,
|
|
672
|
-
rightSidebarWidth: this.props.rightSidebarWidth,
|
|
673
|
-
showInfo,
|
|
674
|
-
tabsHeight: this.props.tabsHeight,
|
|
675
|
-
topMenuHeight: this.props.topMenuHeight,
|
|
676
|
-
toggleInfoPinned: this.toggleInfoPinned,
|
|
677
|
-
hideInfoPanel: this.hideInfoPanel
|
|
678
|
-
}
|
|
416
|
+
const { pane, id } = this.props.tab
|
|
679
417
|
const cls = classnames(
|
|
680
418
|
'term-sftp-box',
|
|
681
419
|
pane,
|
|
@@ -690,14 +428,11 @@ export default class SessionWrapper extends Component {
|
|
|
690
428
|
return (
|
|
691
429
|
<div
|
|
692
430
|
className={cls}
|
|
693
|
-
id={`is-${
|
|
431
|
+
id={`is-${id}`}
|
|
694
432
|
>
|
|
695
433
|
{this.renderControl()}
|
|
696
434
|
{this.renderTerminals()}
|
|
697
435
|
{this.renderSftp()}
|
|
698
|
-
<TerminalInfoContent
|
|
699
|
-
{...infoProps}
|
|
700
|
-
/>
|
|
701
436
|
</div>
|
|
702
437
|
)
|
|
703
438
|
}
|