@electerm/electerm-react 1.40.18 → 1.50.21
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 +26 -0
- package/client/components/layout/layout.jsx +167 -0
- package/client/components/layout/layout.styl +5 -0
- package/client/components/layout/layouts.jsx +71 -0
- package/client/components/layout/session-size-alg.js +31 -0
- package/client/components/main/main.jsx +183 -109
- 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 +62 -317
- package/client/components/session/session.styl +1 -5
- package/client/components/session/sessions.jsx +99 -105
- 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 +9 -9
- 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.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 +60 -65
- package/client/components/tabs/tabs.styl +6 -1
- package/client/components/tabs/window-control.jsx +46 -48
- package/client/components/terminal/index.jsx +101 -104
- 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/store/common.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 +9 -5
- package/client/store/sync.js +16 -9
- package/client/store/system-menu.js +1 -10
- package/client/store/tab.js +66 -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
|
@@ -35,7 +35,7 @@ export const filePropMinWidth = 1
|
|
|
35
35
|
export const contextMenuHeight = 28
|
|
36
36
|
export const contextMenuWidth = 280
|
|
37
37
|
export const contextMenuPaddingTop = 10
|
|
38
|
-
export const sftpControlHeight =
|
|
38
|
+
export const sftpControlHeight = 42 + 30
|
|
39
39
|
export const sidebarWidth = 43
|
|
40
40
|
export const maxHistory = 50
|
|
41
41
|
export const maxTransport = 1
|
|
@@ -130,11 +130,6 @@ export const fileOperationsMap = buildConst([
|
|
|
130
130
|
'mv'
|
|
131
131
|
])
|
|
132
132
|
|
|
133
|
-
export const terminalSplitDirectionMap = buildConst([
|
|
134
|
-
'horizontal',
|
|
135
|
-
'vertical'
|
|
136
|
-
])
|
|
137
|
-
|
|
138
133
|
export const terminalSshConfigType = 'ssh-config'
|
|
139
134
|
export const terminalWebType = 'web'
|
|
140
135
|
export const terminalRdpType = 'rdp'
|
|
@@ -283,10 +278,12 @@ export const commonActions = {
|
|
|
283
278
|
loadTextEditorText: 'load-text-editor-text',
|
|
284
279
|
openTextEditor: 'open-text-editor',
|
|
285
280
|
submitFileModeEdit: 'submit-file-mode-edit',
|
|
281
|
+
submitFileModeClose: 'submit-file-mode-close',
|
|
286
282
|
showFileModeModal: 'show-file-mode-modal',
|
|
287
283
|
showFileInfoModal: 'show-file-info-modal',
|
|
288
284
|
appUpdateCheck: 'check-app-update',
|
|
289
285
|
closeContextMenu: 'close-context-menu',
|
|
286
|
+
closeContextMenuAfter: 'close-context-menu-after',
|
|
290
287
|
clickContextMenu: 'click-context-menu',
|
|
291
288
|
openContextMenu: 'open-context-menu',
|
|
292
289
|
addTransfer: 'add-transfer',
|
|
@@ -299,7 +296,6 @@ export const srcsSkipUpgradeCheck = [
|
|
|
299
296
|
'skip-upgrade-check'
|
|
300
297
|
]
|
|
301
298
|
export const termLSPrefix = 'term:sess:'
|
|
302
|
-
export const termInitId = 'electerm-init-term'
|
|
303
299
|
export const batchInputLsKey = 'batch-inputs'
|
|
304
300
|
export const copyBookmarkItemPrefix = 'bookmark:'
|
|
305
301
|
export const copyBookmarkGroupItemPrefix = 'bookmarkGroup:'
|
|
@@ -353,6 +349,60 @@ export const instSftpKeys = [
|
|
|
353
349
|
]
|
|
354
350
|
export const cwdId = '=__+__'
|
|
355
351
|
export const zmodemTransferPackSize = 1024 * 1024 * 2
|
|
352
|
+
export const splitMap = {
|
|
353
|
+
c1: 'c1',
|
|
354
|
+
c2: 'c2',
|
|
355
|
+
c3: 'c3',
|
|
356
|
+
r2: 'r2',
|
|
357
|
+
r3: 'r3',
|
|
358
|
+
c2x2: 'c2x2',
|
|
359
|
+
c1r2: 'c1r2',
|
|
360
|
+
r1c2: 'r1c2'
|
|
361
|
+
}
|
|
362
|
+
export const splitMapDesc = {
|
|
363
|
+
c1: 'single',
|
|
364
|
+
c2: 'twoColumns',
|
|
365
|
+
c3: 'threeColumns',
|
|
366
|
+
r2: 'twoRows',
|
|
367
|
+
r3: 'threeRows',
|
|
368
|
+
c2x2: 'grid2x2',
|
|
369
|
+
c1r2: 'twoRowsRight',
|
|
370
|
+
r1c2: 'twoColumnsBottom'
|
|
371
|
+
}
|
|
372
|
+
export const splitConfig = {
|
|
373
|
+
c1: {
|
|
374
|
+
children: 1,
|
|
375
|
+
handle: 0
|
|
376
|
+
},
|
|
377
|
+
c2: {
|
|
378
|
+
children: 2,
|
|
379
|
+
handle: 1
|
|
380
|
+
},
|
|
381
|
+
c3: {
|
|
382
|
+
children: 3,
|
|
383
|
+
handle: 2
|
|
384
|
+
},
|
|
385
|
+
r2: {
|
|
386
|
+
children: 2,
|
|
387
|
+
handle: 1
|
|
388
|
+
},
|
|
389
|
+
r3: {
|
|
390
|
+
children: 3,
|
|
391
|
+
handle: 2
|
|
392
|
+
},
|
|
393
|
+
c2x2: {
|
|
394
|
+
children: 4,
|
|
395
|
+
handle: 3
|
|
396
|
+
},
|
|
397
|
+
c1r2: {
|
|
398
|
+
children: 3,
|
|
399
|
+
handle: 2
|
|
400
|
+
},
|
|
401
|
+
r1c2: {
|
|
402
|
+
children: 3,
|
|
403
|
+
handle: 2
|
|
404
|
+
}
|
|
405
|
+
}
|
|
356
406
|
export const syncDataMaps = {
|
|
357
407
|
settings: ['config'],
|
|
358
408
|
bookmarks: ['bookmarks', 'bookmarkGroups'],
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* output default new terminal data obj
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import uid from './id-with-stamp'
|
|
6
6
|
import {
|
|
7
7
|
paneMap
|
|
8
8
|
} from './constants'
|
|
@@ -17,7 +17,7 @@ export function updateCount (tab) {
|
|
|
17
17
|
|
|
18
18
|
export default (removeTitle, noUpdateCount) => {
|
|
19
19
|
const res = {
|
|
20
|
-
id:
|
|
20
|
+
id: uid(),
|
|
21
21
|
status: 'processing',
|
|
22
22
|
pane: paneMap.terminal,
|
|
23
23
|
title: e('newTerminal')
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import React, { useState, useEffect } from 'react'
|
|
2
2
|
import LogoElem from '../common/logo-elem.jsx'
|
|
3
3
|
import store from '../../store'
|
|
4
4
|
import {
|
|
@@ -18,18 +18,17 @@ const e = window.translate
|
|
|
18
18
|
|
|
19
19
|
window.store = store
|
|
20
20
|
|
|
21
|
-
export default
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
21
|
+
export default function Login () {
|
|
22
|
+
const [pass, setPass] = useState('')
|
|
23
|
+
const [logined, setLogined] = useState(!window.pre.requireAuth)
|
|
24
|
+
const [loading, setLoading] = useState(false)
|
|
25
|
+
const [submitting, setSubmitting] = useState(false)
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
init()
|
|
29
|
+
}, [])
|
|
31
30
|
|
|
32
|
-
init = async () => {
|
|
31
|
+
const init = async () => {
|
|
33
32
|
if (!window.pre.requireAuth) {
|
|
34
33
|
return
|
|
35
34
|
}
|
|
@@ -37,59 +36,42 @@ export default class Login extends Component {
|
|
|
37
36
|
window.et.globs = globs
|
|
38
37
|
}
|
|
39
38
|
|
|
40
|
-
handlePassChange = e => {
|
|
41
|
-
|
|
42
|
-
pass: e.target.value
|
|
43
|
-
})
|
|
39
|
+
const handlePassChange = e => {
|
|
40
|
+
setPass(e.target.value)
|
|
44
41
|
}
|
|
45
42
|
|
|
46
|
-
handleSubmit = () => {
|
|
47
|
-
const {
|
|
48
|
-
pass
|
|
49
|
-
} = this.state
|
|
43
|
+
const handleSubmit = () => {
|
|
50
44
|
if (!pass) {
|
|
51
45
|
return message.warning('password required')
|
|
52
|
-
} else if (
|
|
53
|
-
this.submitting
|
|
54
|
-
) {
|
|
46
|
+
} else if (submitting) {
|
|
55
47
|
return
|
|
56
48
|
}
|
|
57
|
-
|
|
58
|
-
this.state.pass
|
|
59
|
-
)
|
|
49
|
+
login(pass)
|
|
60
50
|
}
|
|
61
51
|
|
|
62
|
-
login = async (pass) => {
|
|
63
|
-
|
|
52
|
+
const login = async (pass) => {
|
|
53
|
+
setSubmitting(true)
|
|
64
54
|
const r = await window.pre.runGlobalAsync('checkPassword', pass)
|
|
65
55
|
if (r) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
loading: false
|
|
69
|
-
})
|
|
56
|
+
setLogined(true)
|
|
57
|
+
setLoading(false)
|
|
70
58
|
} else {
|
|
71
59
|
message.error('Login failed')
|
|
72
|
-
|
|
73
|
-
loading: false
|
|
74
|
-
})
|
|
60
|
+
setLoading(false)
|
|
75
61
|
}
|
|
76
|
-
|
|
62
|
+
setSubmitting(false)
|
|
77
63
|
}
|
|
78
64
|
|
|
79
|
-
renderAfter = () => {
|
|
65
|
+
const renderAfter = () => {
|
|
80
66
|
return (
|
|
81
67
|
<ArrowRightOutlined
|
|
82
68
|
className='mg1x pointer'
|
|
83
|
-
onClick={
|
|
69
|
+
onClick={handleSubmit}
|
|
84
70
|
/>
|
|
85
71
|
)
|
|
86
72
|
}
|
|
87
73
|
|
|
88
|
-
renderLogin () {
|
|
89
|
-
const {
|
|
90
|
-
pass,
|
|
91
|
-
loading
|
|
92
|
-
} = this.state
|
|
74
|
+
const renderLogin = () => {
|
|
93
75
|
return (
|
|
94
76
|
<div className='login-wrap'>
|
|
95
77
|
<AppDrag />
|
|
@@ -102,10 +84,10 @@ export default class Login extends Component {
|
|
|
102
84
|
<Input.Password
|
|
103
85
|
value={pass}
|
|
104
86
|
readOnly={loading}
|
|
105
|
-
onChange={
|
|
87
|
+
onChange={handlePassChange}
|
|
106
88
|
placeholder={e('password')}
|
|
107
|
-
addonAfter={
|
|
108
|
-
onPressEnter={
|
|
89
|
+
addonAfter={renderAfter()}
|
|
90
|
+
onPressEnter={handleSubmit}
|
|
109
91
|
/>
|
|
110
92
|
</div>
|
|
111
93
|
<div className='aligncenter'>
|
|
@@ -118,17 +100,12 @@ export default class Login extends Component {
|
|
|
118
100
|
)
|
|
119
101
|
}
|
|
120
102
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
logined
|
|
124
|
-
} = this.state
|
|
125
|
-
if (!logined) {
|
|
126
|
-
return this.renderLogin()
|
|
127
|
-
}
|
|
128
|
-
return (
|
|
129
|
-
<Main
|
|
130
|
-
store={store}
|
|
131
|
-
/>
|
|
132
|
-
)
|
|
103
|
+
if (!logined) {
|
|
104
|
+
return renderLogin()
|
|
133
105
|
}
|
|
106
|
+
return (
|
|
107
|
+
<Main
|
|
108
|
+
store={store}
|
|
109
|
+
/>
|
|
110
|
+
)
|
|
134
111
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* settings page
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { PureComponent } from 'react'
|
|
6
6
|
import {
|
|
7
7
|
CloseCircleOutlined
|
|
8
8
|
} from '@ant-design/icons'
|
|
@@ -34,7 +34,7 @@ import resolveFilePath from '../../common/resolve'
|
|
|
34
34
|
|
|
35
35
|
const e = window.translate
|
|
36
36
|
|
|
37
|
-
export default class BatchOp extends
|
|
37
|
+
export default class BatchOp extends PureComponent {
|
|
38
38
|
state = {
|
|
39
39
|
text: '',
|
|
40
40
|
loading: false,
|
|
@@ -120,7 +120,7 @@ export default class BatchOp extends Component {
|
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
handleCancel = () => {
|
|
123
|
-
|
|
123
|
+
window.store.toggleBatchOp()
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
handleChangeTab = tab => {
|
|
@@ -177,20 +177,20 @@ export default class BatchOp extends Component {
|
|
|
177
177
|
.catch(err => {
|
|
178
178
|
return 'Error: ' + err.message
|
|
179
179
|
})
|
|
180
|
-
if (!tab
|
|
180
|
+
if (!tab) {
|
|
181
181
|
return this.updateState(tab, index)
|
|
182
182
|
}
|
|
183
183
|
|
|
184
184
|
this.updateState('tab created', index)
|
|
185
185
|
if (conf.cmd) {
|
|
186
186
|
this.updateState('running cmd', index)
|
|
187
|
-
await runCmd(tab.
|
|
187
|
+
await runCmd(tab.id, tab.sessionId, conf.cmd)
|
|
188
188
|
this.updateState('running cmd done', index)
|
|
189
189
|
}
|
|
190
190
|
if (conf.remotePath) {
|
|
191
191
|
this.updateState('creating sftp', index)
|
|
192
192
|
tab = await this.createSftp(tab)
|
|
193
|
-
if (!tab
|
|
193
|
+
if (!tab) {
|
|
194
194
|
return this.updateState('Error: ' + tab, index)
|
|
195
195
|
}
|
|
196
196
|
this.updateState('sftp created', index)
|
|
@@ -202,7 +202,7 @@ export default class BatchOp extends Component {
|
|
|
202
202
|
this.updateState('run cmd2', index)
|
|
203
203
|
document.querySelector('.session-current .type-tab.ssh').click()
|
|
204
204
|
await wait(200)
|
|
205
|
-
await runCmd(tab.
|
|
205
|
+
await runCmd(tab.id, tab.sessionId, conf.cmdAfterTransfer)
|
|
206
206
|
this.updateState('run cmd2 done', index)
|
|
207
207
|
}
|
|
208
208
|
this.updateState(e('finished'), index)
|
|
@@ -230,8 +230,9 @@ export default class BatchOp extends Component {
|
|
|
230
230
|
zip: true,
|
|
231
231
|
skipConfirm: true
|
|
232
232
|
}
|
|
233
|
-
window.store.addTransferList([obj])
|
|
234
233
|
const { store } = window
|
|
234
|
+
store.addTransferList([obj])
|
|
235
|
+
|
|
235
236
|
this.tm = setTimeout(() => {
|
|
236
237
|
reject(new Error('timeout'))
|
|
237
238
|
}, 1000 * 60 * 60)
|
|
@@ -299,7 +300,8 @@ export default class BatchOp extends Component {
|
|
|
299
300
|
pane: 'terminal',
|
|
300
301
|
status: 'processing',
|
|
301
302
|
term: 'xterm-256color',
|
|
302
|
-
x11: false
|
|
303
|
+
x11: false,
|
|
304
|
+
batch: window.store.batch
|
|
303
305
|
}
|
|
304
306
|
const { store } = window
|
|
305
307
|
store.addTab(tab)
|
|
@@ -309,7 +311,6 @@ export default class BatchOp extends Component {
|
|
|
309
311
|
const last = tabs[len - 1]
|
|
310
312
|
if (
|
|
311
313
|
last &&
|
|
312
|
-
last.pid &&
|
|
313
314
|
last.id === tab.id &&
|
|
314
315
|
last.status === statusMap.success
|
|
315
316
|
) {
|
|
@@ -676,7 +677,7 @@ export default class BatchOp extends Component {
|
|
|
676
677
|
const {
|
|
677
678
|
showModal,
|
|
678
679
|
innerWidth
|
|
679
|
-
} = this.props
|
|
680
|
+
} = this.props
|
|
680
681
|
const showBatchOp = showModal === modals.batchOps
|
|
681
682
|
const pops = {
|
|
682
683
|
open: showBatchOp,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* bookmark form
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import { PureComponent } from 'react'
|
|
5
5
|
import {
|
|
6
6
|
Radio
|
|
7
7
|
} from 'antd'
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
|
|
32
32
|
const e = window.translate
|
|
33
33
|
|
|
34
|
-
export default class BookmarkIndex extends
|
|
34
|
+
export default class BookmarkIndex extends PureComponent {
|
|
35
35
|
constructor (props) {
|
|
36
36
|
super(props)
|
|
37
37
|
let initType = props.formData.type
|
|
@@ -299,10 +299,13 @@ export default class BookmarkForm extends PureComponent {
|
|
|
299
299
|
this.submit(evt, obj)
|
|
300
300
|
}
|
|
301
301
|
if (evt !== 'save' && evt !== 'saveAndCreateNew') {
|
|
302
|
+
window.store.currentLayoutBatch = window.openTabBatch || 0
|
|
302
303
|
this.props.store.addTab({
|
|
303
304
|
...copy(obj),
|
|
304
|
-
...newTerm(true, true)
|
|
305
|
+
...newTerm(true, true),
|
|
306
|
+
batch: window.openTabBatch ?? window.store.currentLayoutBatch
|
|
305
307
|
})
|
|
308
|
+
delete window.openTabBatch
|
|
306
309
|
this.props.hide()
|
|
307
310
|
}
|
|
308
311
|
}
|
|
@@ -28,7 +28,7 @@ export default class BookmarkTreeDelete extends StartSessionSelect {
|
|
|
28
28
|
checkedKeys,
|
|
29
29
|
bookmarks,
|
|
30
30
|
bookmarkGroups
|
|
31
|
-
} =
|
|
31
|
+
} = this.props
|
|
32
32
|
store.setBookmarks(
|
|
33
33
|
bookmarks.filter(f => {
|
|
34
34
|
return !checkedKeys.includes(f.id)
|
|
@@ -52,17 +52,17 @@ export default class BookmarkTreeDelete extends StartSessionSelect {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
render () {
|
|
55
|
-
const {
|
|
55
|
+
const { expandedKeys, checkedKeys } = this.props
|
|
56
56
|
const rProps = {
|
|
57
57
|
checkable: true,
|
|
58
58
|
autoExpandParent: true,
|
|
59
59
|
onCheck: this.onCheck,
|
|
60
|
-
expandedKeys
|
|
61
|
-
checkedKeys
|
|
60
|
+
expandedKeys,
|
|
61
|
+
checkedKeys,
|
|
62
62
|
onExpand: this.onExpand,
|
|
63
63
|
treeData: this.buildData()
|
|
64
64
|
}
|
|
65
|
-
const len =
|
|
65
|
+
const len = checkedKeys.length
|
|
66
66
|
return (
|
|
67
67
|
<div>
|
|
68
68
|
<div className='pd1'>
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import { Component } from '../common/react-subx'
|
|
2
1
|
import BookmarksList from '../sidebar/bookmark-select'
|
|
3
2
|
|
|
4
|
-
export default
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
</div>
|
|
13
|
-
)
|
|
14
|
-
}
|
|
3
|
+
export default function BookmarkSubMenu () {
|
|
4
|
+
return (
|
|
5
|
+
<div className='sub-context-menu bookmarks-sub-context-menu'>
|
|
6
|
+
<BookmarksList
|
|
7
|
+
store={window.store}
|
|
8
|
+
/>
|
|
9
|
+
</div>
|
|
10
|
+
)
|
|
15
11
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* context menu
|
|
3
3
|
*/
|
|
4
|
-
import
|
|
4
|
+
import { PureComponent } from 'react'
|
|
5
5
|
import './context-menu.styl'
|
|
6
6
|
import classnames from 'classnames'
|
|
7
7
|
import {
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
|
|
47
47
|
const e = window.translate
|
|
48
48
|
|
|
49
|
-
export default class ContextMenu extends
|
|
49
|
+
export default class ContextMenu extends PureComponent {
|
|
50
50
|
state = {
|
|
51
51
|
items: [],
|
|
52
52
|
id: '',
|
|
@@ -134,6 +134,9 @@ export default class ContextMenu extends React.PureComponent {
|
|
|
134
134
|
id: '',
|
|
135
135
|
items: []
|
|
136
136
|
})
|
|
137
|
+
postMessage({
|
|
138
|
+
action: commonActions.closeContextMenuAfter
|
|
139
|
+
})
|
|
137
140
|
}
|
|
138
141
|
|
|
139
142
|
computePos = () => {
|
|
@@ -152,16 +155,13 @@ export default class ContextMenu extends React.PureComponent {
|
|
|
152
155
|
left,
|
|
153
156
|
top
|
|
154
157
|
} = pos
|
|
155
|
-
const {
|
|
156
|
-
topMenuHeight
|
|
157
|
-
} = this.props.store
|
|
158
158
|
const height = count * contextMenuHeight + contextMenuPaddingTop * 2 + countHr * 1
|
|
159
159
|
const maxHeight = Math.max(
|
|
160
|
-
window.innerHeight -
|
|
161
|
-
top
|
|
160
|
+
window.innerHeight - top,
|
|
161
|
+
top
|
|
162
162
|
)
|
|
163
163
|
const shouldScroll = maxHeight < height
|
|
164
|
-
const startTop = top >
|
|
164
|
+
const startTop = top > window.innerHeight / 2
|
|
165
165
|
const realHeight = Math.min(maxHeight, height)
|
|
166
166
|
if (startTop) {
|
|
167
167
|
top = top - realHeight
|
|
@@ -213,7 +213,7 @@ export default class ContextMenu extends React.PureComponent {
|
|
|
213
213
|
}
|
|
214
214
|
const Mod = this.modules[submenu]
|
|
215
215
|
return (
|
|
216
|
-
<Mod
|
|
216
|
+
<Mod {...this.props} />
|
|
217
217
|
)
|
|
218
218
|
}
|
|
219
219
|
|
|
@@ -239,7 +239,7 @@ export default class ContextMenu extends React.PureComponent {
|
|
|
239
239
|
const Mod = this.modules[module]
|
|
240
240
|
return (
|
|
241
241
|
<div className={baseCls}>
|
|
242
|
-
<Mod
|
|
242
|
+
<Mod {...this.props} />
|
|
243
243
|
</div>
|
|
244
244
|
)
|
|
245
245
|
}
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
import { Component } from '../common/react-subx'
|
|
2
1
|
import { createTitleWithTag } from '../../common/create-title'
|
|
3
2
|
|
|
4
|
-
export default
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
{
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
)
|
|
26
|
-
}
|
|
3
|
+
export default function HistorySubMenu (props) {
|
|
4
|
+
const { store } = window
|
|
5
|
+
return (
|
|
6
|
+
<div className='sub-context-menu'>
|
|
7
|
+
{
|
|
8
|
+
props.history.map(item => {
|
|
9
|
+
const title = createTitleWithTag(item)
|
|
10
|
+
return (
|
|
11
|
+
<div
|
|
12
|
+
className='sub-context-menu-item'
|
|
13
|
+
title={title}
|
|
14
|
+
key={item.id}
|
|
15
|
+
onClick={() => store.onSelectHistory(item.id)}
|
|
16
|
+
>
|
|
17
|
+
{title}
|
|
18
|
+
</div>
|
|
19
|
+
)
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
</div>
|
|
23
|
+
)
|
|
27
24
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* btns
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { PureComponent } from 'react'
|
|
6
6
|
import logoRef from '@electerm/electerm-resource/res/imgs/electerm.svg'
|
|
7
7
|
import { commonActions } from '../../common/constants'
|
|
8
8
|
import { shortcutDescExtend } from '../shortcuts/shortcut-handler.js'
|
|
@@ -11,7 +11,7 @@ import generate from '../../common/uid'
|
|
|
11
11
|
const e = window.translate
|
|
12
12
|
const logo = logoRef.replace(/^\//, '')
|
|
13
13
|
|
|
14
|
-
class MenuBtn extends
|
|
14
|
+
class MenuBtn extends PureComponent {
|
|
15
15
|
state = {
|
|
16
16
|
opened: false
|
|
17
17
|
}
|
|
@@ -37,7 +37,7 @@ class MenuBtn extends Component {
|
|
|
37
37
|
openMenu = () => {
|
|
38
38
|
const items = this.renderContext()
|
|
39
39
|
this.uid = generate()
|
|
40
|
-
|
|
40
|
+
window.store.openContextMenu({
|
|
41
41
|
items,
|
|
42
42
|
pos: {
|
|
43
43
|
left: 40,
|
|
@@ -52,23 +52,23 @@ class MenuBtn extends Component {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
onNewSsh = () => {
|
|
55
|
-
|
|
55
|
+
window.store.onNewSsh()
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
addTab = () => {
|
|
59
|
-
|
|
59
|
+
window.store.addTab()
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
onNewWindow = () => {
|
|
63
|
-
|
|
63
|
+
window.store.onNewWindow()
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
openAbout = () => {
|
|
67
|
-
|
|
67
|
+
window.store.openAbout()
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
openSetting = () => {
|
|
71
|
-
|
|
71
|
+
window.store.openSetting()
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
openDevTools = () => {
|
|
@@ -88,15 +88,15 @@ class MenuBtn extends Component {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
onCheckUpdate = () => {
|
|
91
|
-
|
|
91
|
+
window.store.onCheckUpdate()
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
restart = () => {
|
|
95
|
-
|
|
95
|
+
window.store.restart()
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
close = () => {
|
|
99
|
-
|
|
99
|
+
window.store.exit()
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
renderContext = () => {
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import { Component } from '../common/react-subx'
|
|
2
1
|
import TabsSubMenuChild from './sub-tab-menu'
|
|
3
2
|
|
|
4
|
-
export default
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
</div>
|
|
20
|
-
)
|
|
21
|
-
}
|
|
3
|
+
export default function TabsSubMenu (props) {
|
|
4
|
+
return (
|
|
5
|
+
<div className='sub-context-menu'>
|
|
6
|
+
{
|
|
7
|
+
props.tabs.map(item => {
|
|
8
|
+
return (
|
|
9
|
+
<TabsSubMenuChild
|
|
10
|
+
key={item.id}
|
|
11
|
+
item={item}
|
|
12
|
+
/>
|
|
13
|
+
)
|
|
14
|
+
})
|
|
15
|
+
}
|
|
16
|
+
</div>
|
|
17
|
+
)
|
|
22
18
|
}
|