@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PureComponent } from 'react'
|
|
2
2
|
import {
|
|
3
3
|
Tooltip
|
|
4
4
|
} from 'antd'
|
|
@@ -20,7 +20,7 @@ import './term-search.styl'
|
|
|
20
20
|
|
|
21
21
|
const e = window.translate
|
|
22
22
|
|
|
23
|
-
class TermSearch extends
|
|
23
|
+
class TermSearch extends PureComponent {
|
|
24
24
|
searchControls = [{
|
|
25
25
|
id: 'matchCase',
|
|
26
26
|
icon: MatchCaseIcon,
|
|
@@ -54,10 +54,10 @@ class TermSearch extends Component {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
toggleSearch = () => {
|
|
57
|
-
if (this.props.
|
|
57
|
+
if (this.props.termSearchOpen) {
|
|
58
58
|
this.clearSearch()
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
window.store.toggleTerminalSearch()
|
|
61
61
|
setTimeout(window.store.focus, 200)
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -67,41 +67,43 @@ class TermSearch extends Component {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
prev = () => {
|
|
70
|
-
const {
|
|
70
|
+
const {
|
|
71
|
+
currentTabId,
|
|
72
|
+
termSearch,
|
|
73
|
+
termSearchOptions
|
|
74
|
+
} = this.props
|
|
71
75
|
postMessage({
|
|
72
76
|
action: terminalActions.doSearchPrev,
|
|
73
|
-
keyword:
|
|
74
|
-
|
|
75
|
-
options: copy(
|
|
77
|
+
keyword: termSearch,
|
|
78
|
+
currentTabId,
|
|
79
|
+
options: copy(termSearchOptions)
|
|
76
80
|
})
|
|
77
81
|
}
|
|
78
82
|
|
|
79
83
|
next = () => {
|
|
80
|
-
const { activeTerminalId } = this.props.store
|
|
81
84
|
postMessage({
|
|
82
85
|
action: terminalActions.doSearchNext,
|
|
83
|
-
|
|
84
|
-
keyword: this.props.
|
|
85
|
-
options: copy(this.props.
|
|
86
|
+
currentTabId: this.props.currentTabId,
|
|
87
|
+
keyword: this.props.termSearch,
|
|
88
|
+
options: copy(this.props.termSearchOptions)
|
|
86
89
|
})
|
|
87
90
|
}
|
|
88
91
|
|
|
89
92
|
handleChange = e => {
|
|
90
|
-
|
|
93
|
+
window.store.termSearch = e.target.value
|
|
91
94
|
this.prev()
|
|
92
95
|
}
|
|
93
96
|
|
|
94
97
|
clearSearch = () => {
|
|
95
|
-
const { activeTerminalId } = this.props.store
|
|
96
98
|
postMessage({
|
|
97
99
|
action: terminalActions.clearSearch,
|
|
98
|
-
|
|
100
|
+
currentTabId: this.props.currentTabId
|
|
99
101
|
})
|
|
100
102
|
}
|
|
101
103
|
|
|
102
104
|
close = () => {
|
|
103
105
|
this.clearSearch()
|
|
104
|
-
|
|
106
|
+
window.store.termSearchOpen = false
|
|
105
107
|
}
|
|
106
108
|
|
|
107
109
|
renderSearchAction = item => {
|
|
@@ -126,7 +128,7 @@ class TermSearch extends Component {
|
|
|
126
128
|
const {
|
|
127
129
|
termSearchMatchCount,
|
|
128
130
|
termSearchMatchIndex
|
|
129
|
-
} = this.props
|
|
131
|
+
} = this.props
|
|
130
132
|
if (!termSearchMatchCount) {
|
|
131
133
|
return null
|
|
132
134
|
}
|
|
@@ -148,10 +150,10 @@ class TermSearch extends Component {
|
|
|
148
150
|
|
|
149
151
|
toggle = prop => {
|
|
150
152
|
const {
|
|
151
|
-
|
|
153
|
+
termSearchOptions
|
|
152
154
|
} = this.props
|
|
153
|
-
const v =
|
|
154
|
-
store.setTermSearchOption({
|
|
155
|
+
const v = termSearchOptions[prop]
|
|
156
|
+
window.store.setTermSearchOption({
|
|
155
157
|
[prop]: !v
|
|
156
158
|
})
|
|
157
159
|
this.next()
|
|
@@ -163,7 +165,7 @@ class TermSearch extends Component {
|
|
|
163
165
|
icon: Icon,
|
|
164
166
|
prop
|
|
165
167
|
} = item
|
|
166
|
-
const v = this.props.
|
|
168
|
+
const v = this.props.termSearchOptions[prop]
|
|
167
169
|
const cls = classNames('term-search-opt-icon', {
|
|
168
170
|
'term-search-on': v
|
|
169
171
|
})
|
|
@@ -191,11 +193,11 @@ class TermSearch extends Component {
|
|
|
191
193
|
}
|
|
192
194
|
|
|
193
195
|
render () {
|
|
194
|
-
const { store, currentTab } = this.props
|
|
195
196
|
const {
|
|
196
197
|
termSearchOpen,
|
|
197
|
-
termSearch
|
|
198
|
-
|
|
198
|
+
termSearch,
|
|
199
|
+
currentTab
|
|
200
|
+
} = this.props
|
|
199
201
|
if (
|
|
200
202
|
!termSearchOpen ||
|
|
201
203
|
!currentTab ||
|
|
@@ -146,31 +146,6 @@ function formatNetwork (traffic, ips) {
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
// function format (arr) {
|
|
150
|
-
// if (!arr) {
|
|
151
|
-
// return {}
|
|
152
|
-
// }
|
|
153
|
-
// // const arr = res.split(sepStr)
|
|
154
|
-
// // console.log(arr)
|
|
155
|
-
// const uptime = arr[0]
|
|
156
|
-
// const activities = formatActivities(arr[1])
|
|
157
|
-
// const disks = formatDisks(arr[2])
|
|
158
|
-
// const cpu = formatCpu(arr[3])
|
|
159
|
-
// const { mem, swap } = formatMem(arr[4])
|
|
160
|
-
// const { network, ip } = formatNetwork(arr[5], arr[6])
|
|
161
|
-
// const final = {
|
|
162
|
-
// ip,
|
|
163
|
-
// uptime,
|
|
164
|
-
// activities,
|
|
165
|
-
// disks,
|
|
166
|
-
// cpu,
|
|
167
|
-
// mem,
|
|
168
|
-
// swap,
|
|
169
|
-
// network
|
|
170
|
-
// }
|
|
171
|
-
// return final
|
|
172
|
-
// }
|
|
173
|
-
|
|
174
149
|
export async function runCmds (props, cmds) {
|
|
175
150
|
const {
|
|
176
151
|
pid,
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* info content module
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { PureComponent } from 'react'
|
|
6
|
+
import TerminalInfoBase from './base'
|
|
7
|
+
import TerminalInfoUp from './up'
|
|
8
|
+
import TerminalInfoNetwork from './network'
|
|
9
|
+
import TerminalInfoResource from './resource'
|
|
10
|
+
import TerminalInfoActivities from './activity'
|
|
11
|
+
import TerminalInfoDisk from './disk'
|
|
12
|
+
import RunCmd from './run-cmd'
|
|
13
|
+
import { runCmd } from '../terminal/terminal-apis'
|
|
14
|
+
import './terminal-info.styl'
|
|
15
|
+
|
|
16
|
+
export default class TerminalInfoContent extends PureComponent {
|
|
17
|
+
state = {
|
|
18
|
+
uptime: '',
|
|
19
|
+
cpu: '',
|
|
20
|
+
mem: {},
|
|
21
|
+
swap: {},
|
|
22
|
+
activities: [],
|
|
23
|
+
disks: [],
|
|
24
|
+
network: {}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
setStateRef = (...args) => {
|
|
28
|
+
this.setState(...args)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
killProcess = async (id) => {
|
|
32
|
+
const {
|
|
33
|
+
pid,
|
|
34
|
+
sessionId
|
|
35
|
+
} = this.props
|
|
36
|
+
const cmd = `kill ${id}`
|
|
37
|
+
runCmd(pid, sessionId, cmd)
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
render () {
|
|
41
|
+
const { props, state } = this
|
|
42
|
+
return (
|
|
43
|
+
<div>
|
|
44
|
+
<TerminalInfoBase {...props} {...state} />
|
|
45
|
+
<TerminalInfoUp {...props} {...state} />
|
|
46
|
+
<TerminalInfoResource
|
|
47
|
+
{...props} {...state}
|
|
48
|
+
/>
|
|
49
|
+
<TerminalInfoActivities
|
|
50
|
+
{...props}
|
|
51
|
+
{...state}
|
|
52
|
+
killProcess={this.killProcess}
|
|
53
|
+
/>
|
|
54
|
+
<TerminalInfoNetwork {...props} {...state} />
|
|
55
|
+
<TerminalInfoDisk {...props} {...state} />
|
|
56
|
+
<RunCmd {...props} setState={this.setStateRef} />
|
|
57
|
+
</div>
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* bookmark import/export
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { PureComponent } from 'react'
|
|
6
6
|
import {
|
|
7
7
|
DownloadOutlined,
|
|
8
8
|
UploadOutlined,
|
|
@@ -17,9 +17,9 @@ import { fixBookmarks } from '../../common/db-fix'
|
|
|
17
17
|
|
|
18
18
|
const e = window.translate
|
|
19
19
|
|
|
20
|
-
export default class BookmarkTransport extends
|
|
20
|
+
export default class BookmarkTransport extends PureComponent {
|
|
21
21
|
beforeUpload = async (file) => {
|
|
22
|
-
const { store } =
|
|
22
|
+
const { store } = window
|
|
23
23
|
const txt = await window.fs.readFile(file.path)
|
|
24
24
|
try {
|
|
25
25
|
const content = JSON.parse(txt)
|
|
@@ -27,8 +27,9 @@ export default class BookmarkTransport extends Component {
|
|
|
27
27
|
bookmarkGroups: bookmarkGroups1,
|
|
28
28
|
bookmarks: bookmarks1
|
|
29
29
|
} = content
|
|
30
|
-
const
|
|
31
|
-
const
|
|
30
|
+
const { props } = this
|
|
31
|
+
const bookmarkGroups = copy(props.bookmarkGroups)
|
|
32
|
+
const bookmarks = copy(props.bookmarks)
|
|
32
33
|
const bmTree = bookmarks.reduce((p, v) => {
|
|
33
34
|
return {
|
|
34
35
|
...p,
|
|
@@ -95,9 +96,7 @@ export default class BookmarkTransport extends Component {
|
|
|
95
96
|
}
|
|
96
97
|
|
|
97
98
|
handleDownload = () => {
|
|
98
|
-
const {
|
|
99
|
-
const bookmarkGroups = store.bookmarkGroups
|
|
100
|
-
const bookmarks = store.bookmarks
|
|
99
|
+
const { bookmarkGroups, bookmarks } = this.props
|
|
101
100
|
const txt = JSON.stringify({
|
|
102
101
|
bookmarkGroups: copy(bookmarkGroups),
|
|
103
102
|
bookmarks: copy(bookmarks)
|
|
@@ -107,7 +106,7 @@ export default class BookmarkTransport extends Component {
|
|
|
107
106
|
}
|
|
108
107
|
|
|
109
108
|
handleToggleEdit = () => {
|
|
110
|
-
|
|
109
|
+
window.store.bookmarkSelectMode = true
|
|
111
110
|
}
|
|
112
111
|
|
|
113
112
|
renderEdit () {
|
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
} from '../../common/constants'
|
|
33
33
|
import findParentBySel from '../../common/find-parent'
|
|
34
34
|
import copy from 'json-deep-copy'
|
|
35
|
-
import
|
|
35
|
+
import BookmarkTransport from './bookmark-transport'
|
|
36
36
|
import findBookmarkGroupId from '../../common/find-bookmark-group-id'
|
|
37
37
|
import getInitItem from '../../common/init-setting-item'
|
|
38
38
|
import uid from '../../common/uid'
|
|
@@ -55,7 +55,7 @@ export default class ItemListTree extends Component {
|
|
|
55
55
|
bookmarkGroupTitle: '',
|
|
56
56
|
categoryTitle: '',
|
|
57
57
|
categoryId: '',
|
|
58
|
-
expandedKeys:
|
|
58
|
+
expandedKeys: props.expandedKeys
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
|
|
@@ -172,10 +172,11 @@ export default class ItemListTree extends Component {
|
|
|
172
172
|
this.setState({
|
|
173
173
|
categoryId: ''
|
|
174
174
|
})
|
|
175
|
-
|
|
175
|
+
const { store } = window
|
|
176
|
+
store.setBookmarkGroups(
|
|
176
177
|
bookmarkGroups
|
|
177
178
|
)
|
|
178
|
-
|
|
179
|
+
store.batchDbUpdate([{
|
|
179
180
|
id: categoryId,
|
|
180
181
|
db: 'bookmarkGroups',
|
|
181
182
|
upsert: false,
|
|
@@ -219,7 +220,7 @@ export default class ItemListTree extends Component {
|
|
|
219
220
|
showNewBookmarkGroupForm: false
|
|
220
221
|
}, () => {
|
|
221
222
|
this.onSubmit = false
|
|
222
|
-
|
|
223
|
+
window.store.addBookmarkGroup({
|
|
223
224
|
id: uid(),
|
|
224
225
|
title: this.state.bookmarkGroupTitle,
|
|
225
226
|
bookmarkIds: []
|
|
@@ -262,14 +263,15 @@ export default class ItemListTree extends Component {
|
|
|
262
263
|
...(cat.bookmarkGroupIds || []),
|
|
263
264
|
newCat.id
|
|
264
265
|
]
|
|
265
|
-
|
|
266
|
+
const { store } = window
|
|
267
|
+
store.setBookmarkGroups(
|
|
266
268
|
bookmarkGroups
|
|
267
269
|
)
|
|
268
|
-
|
|
270
|
+
store.batchDbAdd([{
|
|
269
271
|
db: 'bookmarkGroups',
|
|
270
272
|
obj: newCat
|
|
271
273
|
}])
|
|
272
|
-
|
|
274
|
+
store.batchDbUpdate([{
|
|
273
275
|
upsert: false,
|
|
274
276
|
id,
|
|
275
277
|
update: {
|
|
@@ -290,11 +292,12 @@ export default class ItemListTree extends Component {
|
|
|
290
292
|
|
|
291
293
|
del = (item, e) => {
|
|
292
294
|
e.stopPropagation()
|
|
295
|
+
const { store } = window
|
|
293
296
|
if (item.bookmarkIds) {
|
|
294
|
-
return
|
|
297
|
+
return store.delBookmarkGroup(item)
|
|
295
298
|
}
|
|
296
|
-
|
|
297
|
-
|
|
299
|
+
store.onDelItem(item, this.props.type)
|
|
300
|
+
store.delItem(item, this.props.type)
|
|
298
301
|
}
|
|
299
302
|
|
|
300
303
|
closeNewGroupForm = () => {
|
|
@@ -309,7 +312,7 @@ export default class ItemListTree extends Component {
|
|
|
309
312
|
expandedKeys
|
|
310
313
|
})
|
|
311
314
|
this.closeNewGroupForm()
|
|
312
|
-
|
|
315
|
+
window.store.setState(
|
|
313
316
|
'expandedKeys', expandedKeys
|
|
314
317
|
)
|
|
315
318
|
}
|
|
@@ -319,13 +322,14 @@ export default class ItemListTree extends Component {
|
|
|
319
322
|
) => {
|
|
320
323
|
const id = e.target.getAttribute('data-item-id')
|
|
321
324
|
const isGroup = e.target.getAttribute('data-is-group') === 'true'
|
|
325
|
+
const { store } = window
|
|
322
326
|
if (isGroup) {
|
|
323
|
-
|
|
327
|
+
store.storeAssign({
|
|
324
328
|
currentBookmarkGroupId: id
|
|
325
329
|
})
|
|
326
330
|
} else {
|
|
327
|
-
|
|
328
|
-
currentBookmarkGroupId: findBookmarkGroupId(
|
|
331
|
+
store.storeAssign({
|
|
332
|
+
currentBookmarkGroupId: findBookmarkGroupId(store.bookmarkGroups, id)
|
|
329
333
|
})
|
|
330
334
|
const { bookmarks } = this.props
|
|
331
335
|
const bookmark = find(
|
|
@@ -381,8 +385,9 @@ export default class ItemListTree extends Component {
|
|
|
381
385
|
id
|
|
382
386
|
]
|
|
383
387
|
)
|
|
388
|
+
const { store } = window
|
|
384
389
|
if (from) {
|
|
385
|
-
|
|
390
|
+
store.editBookmarkGroup(
|
|
386
391
|
from.id,
|
|
387
392
|
{
|
|
388
393
|
bookmarkIds: (from.bookmarkIds || []).filter(d => {
|
|
@@ -391,7 +396,7 @@ export default class ItemListTree extends Component {
|
|
|
391
396
|
}
|
|
392
397
|
)
|
|
393
398
|
}
|
|
394
|
-
|
|
399
|
+
store.editBookmarkGroup(
|
|
395
400
|
item.id,
|
|
396
401
|
{
|
|
397
402
|
bookmarkIds: uniq(
|
|
@@ -418,6 +423,10 @@ export default class ItemListTree extends Component {
|
|
|
418
423
|
args = [],
|
|
419
424
|
func
|
|
420
425
|
} = e.data || {}
|
|
426
|
+
if (action === commonActions.closeContextMenuAfter) {
|
|
427
|
+
window.removeEventListener('message', this.onContextAction)
|
|
428
|
+
return false
|
|
429
|
+
}
|
|
421
430
|
if (
|
|
422
431
|
action !== commonActions.clickContextMenu ||
|
|
423
432
|
id !== this.uid ||
|
|
@@ -436,7 +445,7 @@ export default class ItemListTree extends Component {
|
|
|
436
445
|
}
|
|
437
446
|
const menus = this.renderContextItems(item, isGroup)
|
|
438
447
|
this.uid = uid()
|
|
439
|
-
|
|
448
|
+
window.store.openContextMenu({
|
|
440
449
|
items: menus,
|
|
441
450
|
id: this.uid,
|
|
442
451
|
pos: this.computePos(e)
|
|
@@ -484,7 +493,7 @@ export default class ItemListTree extends Component {
|
|
|
484
493
|
bookmarkGroupSubParentId: ''
|
|
485
494
|
})
|
|
486
495
|
} else {
|
|
487
|
-
|
|
496
|
+
window.store.openBookmarkEdit(item)
|
|
488
497
|
}
|
|
489
498
|
}
|
|
490
499
|
|
|
@@ -755,7 +764,7 @@ export default class ItemListTree extends Component {
|
|
|
755
764
|
|
|
756
765
|
duplicateItem = (e, item) => {
|
|
757
766
|
e.stopPropagation()
|
|
758
|
-
const { addItem } =
|
|
767
|
+
const { addItem } = window.store
|
|
759
768
|
const bookmarkGroups = copy(
|
|
760
769
|
this.props.bookmarkGroups
|
|
761
770
|
)
|
|
@@ -771,7 +780,7 @@ export default class ItemListTree extends Component {
|
|
|
771
780
|
}
|
|
772
781
|
newbookmark.title = item.title + '(' + deplicateIndex + ')'
|
|
773
782
|
const categoryId = findBookmarkGroupId(bookmarkGroups, item.id)
|
|
774
|
-
|
|
783
|
+
window.store.storeAssign({
|
|
775
784
|
currentBookmarkGroupId: categoryId
|
|
776
785
|
})
|
|
777
786
|
// add bookmark to store
|
|
@@ -834,10 +843,10 @@ export default class ItemListTree extends Component {
|
|
|
834
843
|
}
|
|
835
844
|
return bg
|
|
836
845
|
})
|
|
837
|
-
|
|
846
|
+
window.store.setBookmarkGroups(
|
|
838
847
|
bookmarkGroups
|
|
839
848
|
)
|
|
840
|
-
|
|
849
|
+
window.store.batchDbUpdate(updates)
|
|
841
850
|
}
|
|
842
851
|
|
|
843
852
|
findBookmarkByTitle = (bookmarks, oldBookmark) => {
|
|
@@ -854,7 +863,7 @@ export default class ItemListTree extends Component {
|
|
|
854
863
|
item,
|
|
855
864
|
isGroup,
|
|
856
865
|
parentId,
|
|
857
|
-
leftSidebarWidth: this.props.
|
|
866
|
+
leftSidebarWidth: this.props.leftSidebarWidth,
|
|
858
867
|
staticList: this.props.staticList,
|
|
859
868
|
selectedItemId: this.props.activeItemId,
|
|
860
869
|
...pick(
|
|
@@ -909,8 +918,9 @@ export default class ItemListTree extends Component {
|
|
|
909
918
|
>
|
|
910
919
|
<FolderOutlined className='with-plus' />
|
|
911
920
|
</Button>
|
|
912
|
-
<
|
|
913
|
-
|
|
921
|
+
<BookmarkTransport
|
|
922
|
+
bookmarkGroups={this.props.bookmarkGroups}
|
|
923
|
+
bookmarks={this.props.bookmarks}
|
|
914
924
|
/>
|
|
915
925
|
</Space.Compact>
|
|
916
926
|
</div>
|
|
@@ -72,7 +72,6 @@ export default class VncSession extends RdpSession {
|
|
|
72
72
|
} = config
|
|
73
73
|
const { sessionId, id } = this.props
|
|
74
74
|
const tab = window.store.applyProfile(deepCopy(this.props.tab || {}))
|
|
75
|
-
console.log('vnc tab', this.props.tab)
|
|
76
75
|
const {
|
|
77
76
|
type,
|
|
78
77
|
term: terminalType,
|
|
@@ -148,7 +147,6 @@ export default class VncSession extends RdpSession {
|
|
|
148
147
|
}
|
|
149
148
|
|
|
150
149
|
onConnect = (event) => {
|
|
151
|
-
// console.log('onConnect', event)
|
|
152
150
|
this.setStatus(statusMap.success)
|
|
153
151
|
this.setState({
|
|
154
152
|
loading: false
|
|
@@ -160,7 +158,6 @@ export default class VncSession extends RdpSession {
|
|
|
160
158
|
}
|
|
161
159
|
|
|
162
160
|
onSecurityfailure = (event) => {
|
|
163
|
-
// console.log('onSecurityFailure', event)
|
|
164
161
|
message.error('Security Failure: ' + event.detail?.reason)
|
|
165
162
|
}
|
|
166
163
|
|
|
@@ -188,12 +185,10 @@ export default class VncSession extends RdpSession {
|
|
|
188
185
|
}
|
|
189
186
|
|
|
190
187
|
onClipboard = (event) => {
|
|
191
|
-
// console.log('onClipboard', event)
|
|
192
188
|
copy(event.detail.text)
|
|
193
189
|
}
|
|
194
190
|
|
|
195
191
|
onBell = (event) => {
|
|
196
|
-
// console.log('Bell', event)
|
|
197
192
|
message.warning('Bell')
|
|
198
193
|
}
|
|
199
194
|
|
|
@@ -263,7 +258,7 @@ export default class VncSession extends RdpSession {
|
|
|
263
258
|
}
|
|
264
259
|
|
|
265
260
|
render () {
|
|
266
|
-
const { width: w, height: h } = this.
|
|
261
|
+
const { width: w, height: h } = this.props
|
|
267
262
|
const vncProps = {
|
|
268
263
|
style: {
|
|
269
264
|
width: w + 'px',
|
package/client/store/common.js
CHANGED
|
@@ -153,7 +153,7 @@ export default Store => {
|
|
|
153
153
|
|
|
154
154
|
Store.prototype.setRightSidePanelWidth = function (v) {
|
|
155
155
|
ls.setItem(rightSidebarWidthKey, v)
|
|
156
|
-
window.store.
|
|
156
|
+
window.store.rightPanelWidth = v
|
|
157
157
|
}
|
|
158
158
|
Store.prototype.dismissDelKeyTip = function (v) {
|
|
159
159
|
ls.setItem(dismissDelKeyTipLsKey, 'y')
|
package/client/store/event.js
CHANGED
|
@@ -57,12 +57,12 @@ export default Store => {
|
|
|
57
57
|
document.activeElement.select()
|
|
58
58
|
postMessage({
|
|
59
59
|
event: 'selectall',
|
|
60
|
-
id: window.store.
|
|
60
|
+
id: window.store.currentTabId
|
|
61
61
|
})
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
Store.prototype.triggerResize = function () {
|
|
65
|
-
window.
|
|
65
|
+
window.store.resizeTrigger = window.store.resizeTrigger ? 0 : 1
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
Store.prototype.toggleTermFullscreen = function (terminalFullScreen) {
|
package/client/store/index.js
CHANGED
|
@@ -134,7 +134,6 @@ class Store {
|
|
|
134
134
|
get inActiveTerminal () {
|
|
135
135
|
const { store } = window
|
|
136
136
|
return !store.showModal &&
|
|
137
|
-
store.termFocused &&
|
|
138
137
|
store.currentTab &&
|
|
139
138
|
(
|
|
140
139
|
store.currentTab.pane === paneMap.ssh ||
|
|
@@ -211,14 +210,6 @@ class Store {
|
|
|
211
210
|
]
|
|
212
211
|
}
|
|
213
212
|
|
|
214
|
-
get config () {
|
|
215
|
-
return JSON.parse(window.store._config || '{}')
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
get sftpSortSetting () {
|
|
219
|
-
return JSON.parse(window.store._sftpSortSetting)
|
|
220
|
-
}
|
|
221
|
-
|
|
222
213
|
get onOperation () {
|
|
223
214
|
const {
|
|
224
215
|
store
|
|
@@ -229,26 +220,6 @@ class Store {
|
|
|
229
220
|
store.showFileModal
|
|
230
221
|
}
|
|
231
222
|
|
|
232
|
-
get topMenuHeight () {
|
|
233
|
-
return 0
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
get langs () {
|
|
237
|
-
return JSON.parse(window.store._langs)
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
get upgradeInfo () {
|
|
241
|
-
return JSON.parse(window.store._upgradeInfo)
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
get transferToConfirm () {
|
|
245
|
-
return JSON.parse(window.store._transferToConfirm)
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
get settingItem () {
|
|
249
|
-
return JSON.parse(window.store._settingItem)
|
|
250
|
-
}
|
|
251
|
-
|
|
252
223
|
get uiThemeConfig () {
|
|
253
224
|
const { store } = window
|
|
254
225
|
const themeConf = store.getUiThemeConfig()
|
|
@@ -293,7 +264,7 @@ class Store {
|
|
|
293
264
|
}
|
|
294
265
|
}
|
|
295
266
|
|
|
296
|
-
const
|
|
267
|
+
const arrGetterProps = [
|
|
297
268
|
'expandedKeys',
|
|
298
269
|
'checkedKeys',
|
|
299
270
|
'addressBookmarks',
|
|
@@ -314,7 +285,7 @@ const getterProps = [
|
|
|
314
285
|
'resolutions'
|
|
315
286
|
]
|
|
316
287
|
|
|
317
|
-
for (const prop of
|
|
288
|
+
for (const prop of arrGetterProps) {
|
|
318
289
|
Object.defineProperty(Store.prototype, prop, {
|
|
319
290
|
get: function () {
|
|
320
291
|
return JSON.parse(window.store[`_${prop}`] || '[]').filter(d => d)
|
|
@@ -322,6 +293,24 @@ for (const prop of getterProps) {
|
|
|
322
293
|
})
|
|
323
294
|
}
|
|
324
295
|
|
|
296
|
+
const getterProps = [
|
|
297
|
+
'langs',
|
|
298
|
+
'config',
|
|
299
|
+
'sftpSortSetting',
|
|
300
|
+
'upgradeInfo',
|
|
301
|
+
'transferToConfirm',
|
|
302
|
+
'terminalInfoProps',
|
|
303
|
+
'settingItem'
|
|
304
|
+
]
|
|
305
|
+
|
|
306
|
+
for (const prop of getterProps) {
|
|
307
|
+
Object.defineProperty(Store.prototype, prop, {
|
|
308
|
+
get: function () {
|
|
309
|
+
return JSON.parse(window.store[`_${prop}`] || '{}')
|
|
310
|
+
}
|
|
311
|
+
})
|
|
312
|
+
}
|
|
313
|
+
|
|
325
314
|
loadDataExtend(Store)
|
|
326
315
|
eventExtend(Store)
|
|
327
316
|
dbUpgradeExtend(Store)
|
|
@@ -346,6 +335,6 @@ transferExtend(Store)
|
|
|
346
335
|
addressBookmarkExtend(Store)
|
|
347
336
|
|
|
348
337
|
export const StateStore = Store
|
|
349
|
-
const store = manage(new Store())
|
|
338
|
+
const store = manage(new Store(), 1)
|
|
350
339
|
|
|
351
340
|
export default store
|