@electerm/electerm-react 1.51.3 → 1.51.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/common/constants.js +1 -2
- package/client/common/db.js +10 -9
- package/client/components/batch-op/batch-op.jsx +16 -5
- package/client/components/bookmark-form/index.jsx +1 -1
- package/client/components/bookmark-form/ssh-form.jsx +3 -23
- package/client/components/bookmark-form/use-submit.jsx +6 -15
- package/client/components/context-menu/context-menu.styl +5 -5
- package/client/components/context-menu/history.jsx +2 -11
- package/client/components/context-menu/sub-tab-menu.jsx +1 -1
- package/client/components/footer/footer-entry.jsx +1 -6
- package/client/components/layout/layout-item.jsx +2 -2
- package/client/components/main/main.jsx +9 -5
- package/client/components/session/session.jsx +15 -1
- package/client/components/session/session.styl +3 -2
- package/client/components/setting-panel/list.styl +0 -1
- package/client/components/setting-panel/on-tree-drop.js +5 -5
- package/client/components/setting-panel/setting-modal.jsx +0 -12
- package/client/components/sftp/confirm-modal-store.jsx +0 -7
- package/client/components/sftp/file-mode-modal.jsx +2 -2
- package/client/components/sftp/sftp-entry.jsx +2 -2
- package/client/components/sftp/transfer-conflict-store.jsx +69 -66
- package/client/components/sftp/transport-action-store.jsx +32 -50
- package/client/components/sftp/transports-action-store.jsx +15 -15
- package/client/components/sftp/transports-ui-store.jsx +9 -5
- package/client/components/sidebar/bookmark-select.jsx +1 -1
- package/client/components/sidebar/bookmark.jsx +4 -63
- package/client/components/sidebar/history-item.jsx +34 -0
- package/client/components/sidebar/history.jsx +17 -52
- package/client/components/sidebar/index.jsx +4 -34
- package/client/components/sidebar/sidebar-panel.jsx +107 -0
- package/client/components/sidebar/sidebar.styl +14 -0
- package/client/components/sidebar/transfer-list-control.jsx +1 -0
- package/client/components/sidebar/transfer.styl +1 -1
- package/client/components/sidebar/transport-ui.jsx +179 -37
- package/client/components/tabs/index.jsx +4 -4
- package/client/components/tabs/tab.jsx +19 -10
- package/client/components/tree-list/tree-list.jsx +8 -10
- package/client/entry/worker.js +5 -3
- package/client/store/bookmark-group.js +3 -5
- package/client/store/common.js +11 -1
- package/client/store/db-upgrade.js +0 -2
- package/client/store/index.js +0 -3
- package/client/store/init-state.js +4 -3
- package/client/store/item.js +0 -19
- package/client/store/load-data.js +2 -0
- package/client/store/setting.js +2 -51
- package/client/store/sidebar.js +7 -8
- package/client/store/sync.js +7 -7
- package/client/store/tab.js +72 -4
- package/client/store/transfer-history.js +3 -9
- package/client/store/transfer-list.js +75 -75
- package/client/store/watch.js +9 -1
- package/package.json +1 -1
- package/client/components/setting-panel/tab-history.jsx +0 -43
|
@@ -12,9 +12,11 @@ import {
|
|
|
12
12
|
getFileExt,
|
|
13
13
|
checkFolderSize
|
|
14
14
|
} from './file-read'
|
|
15
|
-
import { findIndex, find } from 'lodash-es'
|
|
16
15
|
import generate from '../../common/uid'
|
|
17
16
|
import resolve from '../../common/resolve'
|
|
17
|
+
import deepCopy from 'json-deep-copy'
|
|
18
|
+
|
|
19
|
+
const { assign } = Object
|
|
18
20
|
|
|
19
21
|
export default class TransferConflictStore extends PureComponent {
|
|
20
22
|
state = {
|
|
@@ -27,7 +29,7 @@ export default class TransferConflictStore extends PureComponent {
|
|
|
27
29
|
|
|
28
30
|
componentDidUpdate (prevProps) {
|
|
29
31
|
if (
|
|
30
|
-
prevProps.
|
|
32
|
+
prevProps.fileTransferChanged !== this.props.fileTransferChanged
|
|
31
33
|
) {
|
|
32
34
|
this.watchFile()
|
|
33
35
|
}
|
|
@@ -56,17 +58,16 @@ export default class TransferConflictStore extends PureComponent {
|
|
|
56
58
|
const newName = ext
|
|
57
59
|
? `${base}(rename-${renameId}).${ext}`
|
|
58
60
|
: `${base}(rename-${renameId})`
|
|
59
|
-
|
|
60
|
-
...tr,
|
|
61
|
+
assign(tr, {
|
|
61
62
|
renameId,
|
|
62
63
|
newName,
|
|
63
64
|
oldName: base,
|
|
64
65
|
toPath: resolve(path, newName)
|
|
65
|
-
}
|
|
66
|
+
})
|
|
66
67
|
if (action) {
|
|
67
|
-
|
|
68
|
+
tr.action = action
|
|
68
69
|
}
|
|
69
|
-
return
|
|
70
|
+
return tr
|
|
70
71
|
}
|
|
71
72
|
|
|
72
73
|
updateTransferAction = (data) => {
|
|
@@ -79,56 +80,48 @@ export default class TransferConflictStore extends PureComponent {
|
|
|
79
80
|
fromFile
|
|
80
81
|
} = transfer
|
|
81
82
|
this.clear()
|
|
82
|
-
|
|
83
|
+
|
|
83
84
|
const { store } = window
|
|
84
|
-
const
|
|
85
|
+
const { fileTransfers } = store
|
|
86
|
+
const index = fileTransfers.findIndex(d => d.id === id)
|
|
85
87
|
if (index < 0) {
|
|
86
|
-
return
|
|
88
|
+
return
|
|
87
89
|
}
|
|
88
|
-
fileTransfers[index]
|
|
89
|
-
|
|
90
|
+
const tr = fileTransfers[index]
|
|
91
|
+
tr.fromFile = deepCopy(fromFile)
|
|
92
|
+
tr.action = action
|
|
93
|
+
tr.r = Math.random()
|
|
90
94
|
if (action === 'skip') {
|
|
91
|
-
fileTransfers.splice(index, 1)
|
|
95
|
+
return fileTransfers.splice(index, 1)
|
|
92
96
|
} else if (action === 'cancel') {
|
|
93
|
-
|
|
97
|
+
return store.skipAllTransfersSinceIndex(index)
|
|
94
98
|
}
|
|
95
99
|
if (action.includes('All')) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
return t
|
|
99
|
-
}
|
|
100
|
-
return {
|
|
101
|
-
...t,
|
|
102
|
-
action: action.replace('All', '')
|
|
103
|
-
}
|
|
100
|
+
return store.updateTransfersFromIndex(index, {
|
|
101
|
+
action: action.replace('All', '')
|
|
104
102
|
})
|
|
105
103
|
}
|
|
106
104
|
if (action.includes('rename')) {
|
|
107
|
-
|
|
108
|
-
} else if (action === 'skipAll') {
|
|
109
|
-
fileTransfers.splice(index, 1)
|
|
105
|
+
return this.rename(tr)
|
|
110
106
|
}
|
|
111
|
-
store.setFileTransfers(fileTransfers)
|
|
112
107
|
}
|
|
113
108
|
|
|
114
109
|
tagTransferError = (id, errorMsg) => {
|
|
115
|
-
|
|
116
|
-
const
|
|
117
|
-
|
|
110
|
+
this.clear()
|
|
111
|
+
const { store } = window
|
|
112
|
+
const { fileTransfers } = store
|
|
113
|
+
const index = fileTransfers.findIndex(d => d.id === id)
|
|
114
|
+
if (index < 0) {
|
|
118
115
|
return
|
|
119
116
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
|
|
118
|
+
const [tr] = fileTransfers.splice(index, 1)
|
|
119
|
+
assign(tr, {
|
|
123
120
|
host: tr.host,
|
|
124
121
|
error: errorMsg,
|
|
125
122
|
finishTime: Date.now()
|
|
126
123
|
})
|
|
127
|
-
|
|
128
|
-
if (index >= 0) {
|
|
129
|
-
fileTransfers.splice(index, 1)
|
|
130
|
-
}
|
|
131
|
-
store.setFileTransfers(fileTransfers)
|
|
124
|
+
store.addTransferHistory(tr)
|
|
132
125
|
}
|
|
133
126
|
|
|
134
127
|
setConflict (tr) {
|
|
@@ -157,6 +150,18 @@ export default class TransferConflictStore extends PureComponent {
|
|
|
157
150
|
window.addEventListener('message', this.onDecision)
|
|
158
151
|
}
|
|
159
152
|
|
|
153
|
+
updateData = () => {
|
|
154
|
+
const {
|
|
155
|
+
store
|
|
156
|
+
} = window
|
|
157
|
+
const {
|
|
158
|
+
fileTransfers
|
|
159
|
+
} = store
|
|
160
|
+
if (fileTransfers.length > 0) {
|
|
161
|
+
fileTransfers[0].r = Math.random()
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
160
165
|
setCanTransfer = (fromFile, tr) => {
|
|
161
166
|
this.clear()
|
|
162
167
|
const {
|
|
@@ -164,20 +169,20 @@ export default class TransferConflictStore extends PureComponent {
|
|
|
164
169
|
} = window
|
|
165
170
|
const {
|
|
166
171
|
fileTransfers
|
|
167
|
-
} =
|
|
168
|
-
const index = findIndex(
|
|
172
|
+
} = store
|
|
173
|
+
const index = fileTransfers.findIndex(t => {
|
|
169
174
|
return t.id === tr.id
|
|
170
175
|
})
|
|
171
|
-
if (index
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
fromFile
|
|
175
|
-
}
|
|
176
|
-
Object.assign(fileTransfers[index], up)
|
|
177
|
-
} else if (fileTransfers[0]) {
|
|
178
|
-
fileTransfers[0].r = Math.random()
|
|
176
|
+
if (index < 0) {
|
|
177
|
+
setTimeout(this.updateData, 0)
|
|
178
|
+
return
|
|
179
179
|
}
|
|
180
|
-
|
|
180
|
+
const up = {
|
|
181
|
+
action: 'transfer',
|
|
182
|
+
fromFile
|
|
183
|
+
}
|
|
184
|
+
assign(fileTransfers[index], up)
|
|
185
|
+
// may have issue
|
|
181
186
|
}
|
|
182
187
|
|
|
183
188
|
clear = () => {
|
|
@@ -188,25 +193,24 @@ export default class TransferConflictStore extends PureComponent {
|
|
|
188
193
|
const { store } = window
|
|
189
194
|
const {
|
|
190
195
|
fileTransfers
|
|
191
|
-
} =
|
|
192
|
-
if (!fileTransfers.length
|
|
196
|
+
} = store
|
|
197
|
+
if (!fileTransfers.length) {
|
|
193
198
|
return this.clear()
|
|
194
199
|
}
|
|
195
200
|
const tr = fileTransfers
|
|
196
|
-
.
|
|
201
|
+
.find(t => {
|
|
197
202
|
return (
|
|
198
203
|
!t.action ||
|
|
199
204
|
!t.fromFile ||
|
|
200
205
|
t.fromFile.isDirectory
|
|
201
206
|
)
|
|
202
|
-
})
|
|
207
|
+
})
|
|
203
208
|
if (!tr) {
|
|
204
209
|
this.onConfirm = false
|
|
205
210
|
return this.clear()
|
|
206
211
|
}
|
|
207
212
|
if (this.currentId) {
|
|
208
|
-
|
|
209
|
-
return store.setFileTransfers(fileTransfers)
|
|
213
|
+
return
|
|
210
214
|
}
|
|
211
215
|
this.currentId = tr.id
|
|
212
216
|
const {
|
|
@@ -225,7 +229,6 @@ export default class TransferConflictStore extends PureComponent {
|
|
|
225
229
|
? tr.fromFile
|
|
226
230
|
: await this.checkExist(typeFrom, fromPath, sessionId)
|
|
227
231
|
if (!fromFile) {
|
|
228
|
-
this.currentId = ''
|
|
229
232
|
return this.tagTransferError(id, 'file not exist')
|
|
230
233
|
}
|
|
231
234
|
let toFile = false
|
|
@@ -249,33 +252,33 @@ export default class TransferConflictStore extends PureComponent {
|
|
|
249
252
|
tr.skipExpand = true
|
|
250
253
|
}
|
|
251
254
|
if (fromPath === toPath && typeFrom === typeTo) {
|
|
255
|
+
assign(tr, {
|
|
256
|
+
operation: 'cp',
|
|
257
|
+
fromFile
|
|
258
|
+
})
|
|
252
259
|
return this.updateTransferAction({
|
|
253
260
|
id,
|
|
254
261
|
action: 'rename',
|
|
255
|
-
transfer:
|
|
256
|
-
...tr,
|
|
257
|
-
operation: 'cp',
|
|
258
|
-
fromFile
|
|
259
|
-
}
|
|
262
|
+
transfer: tr
|
|
260
263
|
})
|
|
261
264
|
} else if (toFile && !action && !skipConfirm) {
|
|
262
265
|
this.waitForSignal(id)
|
|
263
266
|
if (!this.onConfirm) {
|
|
264
267
|
this.onConfirm = true
|
|
265
|
-
|
|
266
|
-
...tr,
|
|
268
|
+
assign(tr, {
|
|
267
269
|
fromFile,
|
|
268
270
|
toFile
|
|
269
271
|
})
|
|
272
|
+
return this.setConflict(tr)
|
|
270
273
|
}
|
|
271
274
|
} else if (toFile && !tr.fromFile && action) {
|
|
275
|
+
assign(tr, {
|
|
276
|
+
fromFile
|
|
277
|
+
})
|
|
272
278
|
return this.updateTransferAction({
|
|
273
279
|
id,
|
|
274
280
|
action,
|
|
275
|
-
transfer:
|
|
276
|
-
...tr,
|
|
277
|
-
fromFile
|
|
278
|
-
}
|
|
281
|
+
transfer: tr
|
|
279
282
|
})
|
|
280
283
|
}
|
|
281
284
|
this.setCanTransfer(fromFile, tr)
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Component } from 'react'
|
|
2
2
|
import copy from 'json-deep-copy'
|
|
3
|
-
import {
|
|
3
|
+
import { isFunction } from 'lodash-es'
|
|
4
4
|
import generate from '../../common/uid'
|
|
5
5
|
import { typeMap, transferTypeMap, commonActions } from '../../common/constants'
|
|
6
6
|
import fs from '../../common/fs'
|
|
7
7
|
import format, { computeLeftTime, computePassedTime } from './transfer-speed-format'
|
|
8
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
getFolderFromFilePath
|
|
10
|
+
} from './file-read'
|
|
9
11
|
import resolve from '../../common/resolve'
|
|
10
12
|
import delay from '../../common/wait'
|
|
11
13
|
import postMsg from '../../common/post-msg'
|
|
@@ -35,15 +37,9 @@ export default class TransportAction extends Component {
|
|
|
35
37
|
this.initTransfer()
|
|
36
38
|
}
|
|
37
39
|
if (
|
|
38
|
-
this.props.
|
|
39
|
-
prevProps.cancel !== true
|
|
40
|
+
this.props.pausing !== prevProps.pausing
|
|
40
41
|
) {
|
|
41
|
-
this.
|
|
42
|
-
}
|
|
43
|
-
if (
|
|
44
|
-
this.props.pause !== prevProps.pause
|
|
45
|
-
) {
|
|
46
|
-
if (this.props.pause) {
|
|
42
|
+
if (this.props.pausing) {
|
|
47
43
|
this.pause()
|
|
48
44
|
} else {
|
|
49
45
|
this.resume()
|
|
@@ -54,32 +50,24 @@ export default class TransportAction extends Component {
|
|
|
54
50
|
componentWillUnmount () {
|
|
55
51
|
this.transport && this.transport.destroy()
|
|
56
52
|
this.transport = null
|
|
57
|
-
|
|
58
|
-
this.timer = null
|
|
53
|
+
this.inst = null
|
|
59
54
|
}
|
|
60
55
|
|
|
61
56
|
update = (up) => {
|
|
62
|
-
const {
|
|
57
|
+
const { transfer } = this.props
|
|
63
58
|
const {
|
|
64
59
|
store
|
|
65
60
|
} = window
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return store.setFileTransfers(fileTransfers)
|
|
69
|
-
}
|
|
70
|
-
store.editTransfer(
|
|
71
|
-
fileTransfers[index].id,
|
|
61
|
+
store.updateTransfer(
|
|
62
|
+
transfer.id,
|
|
72
63
|
up
|
|
73
64
|
)
|
|
74
|
-
Object.assign(fileTransfers[index], up)
|
|
75
|
-
store.setFileTransfers(fileTransfers)
|
|
76
65
|
}
|
|
77
66
|
|
|
78
67
|
insert = (insts) => {
|
|
79
|
-
const { fileTransfers
|
|
80
|
-
const index =
|
|
68
|
+
const { fileTransfers } = window.store
|
|
69
|
+
const { index } = this.props
|
|
81
70
|
fileTransfers.splice(index, 1, ...insts)
|
|
82
|
-
window.store.setFileTransfers(fileTransfers)
|
|
83
71
|
}
|
|
84
72
|
|
|
85
73
|
remoteList = () => {
|
|
@@ -112,22 +100,26 @@ export default class TransportAction extends Component {
|
|
|
112
100
|
} = transfer
|
|
113
101
|
const cb = this[typeTo + 'List']
|
|
114
102
|
const finishTime = Date.now()
|
|
103
|
+
if (next) {
|
|
104
|
+
setTimeout(() => {
|
|
105
|
+
window.store.fileTransfers.splice(
|
|
106
|
+
this.props.index, 0, copy(next)
|
|
107
|
+
)
|
|
108
|
+
}, 0)
|
|
109
|
+
}
|
|
115
110
|
if (!config.disableTransferHistory) {
|
|
111
|
+
delete transfer.next
|
|
112
|
+
Object.assign(transfer, update, {
|
|
113
|
+
finishTime,
|
|
114
|
+
startTime: this.startTime,
|
|
115
|
+
size: transfer.fromFile.size,
|
|
116
|
+
next: null,
|
|
117
|
+
speed: format(transfer.fromFile.size, this?.startTime)
|
|
118
|
+
})
|
|
116
119
|
window.store.addTransferHistory(
|
|
117
|
-
|
|
118
|
-
...transfer,
|
|
119
|
-
...update,
|
|
120
|
-
finishTime,
|
|
121
|
-
startTime: this.startTime,
|
|
122
|
-
size: transfer.fromFile.size,
|
|
123
|
-
next: null,
|
|
124
|
-
speed: format(transfer.fromFile.size, this?.startTime)
|
|
125
|
-
}
|
|
120
|
+
transfer
|
|
126
121
|
)
|
|
127
122
|
}
|
|
128
|
-
if (next) {
|
|
129
|
-
this.insert([copy(next)])
|
|
130
|
-
}
|
|
131
123
|
this.cancel(cb)
|
|
132
124
|
}
|
|
133
125
|
|
|
@@ -160,21 +152,11 @@ export default class TransportAction extends Component {
|
|
|
160
152
|
return
|
|
161
153
|
}
|
|
162
154
|
this.onCancel = true
|
|
163
|
-
const {
|
|
164
|
-
transfer
|
|
165
|
-
} = this.props
|
|
166
|
-
let {
|
|
167
|
-
fileTransfers
|
|
168
|
-
} = this.props
|
|
169
|
-
const { id } = transfer
|
|
170
155
|
this.transport && this.transport.destroy()
|
|
171
156
|
this.transport = null
|
|
172
|
-
fileTransfers
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
this.timer = setTimeout(() => {
|
|
176
|
-
window.store.setFileTransfers(fileTransfers)
|
|
177
|
-
}, 100)
|
|
157
|
+
window.store.fileTransfers.splice(
|
|
158
|
+
this.props.index, 1
|
|
159
|
+
)
|
|
178
160
|
if (isFunction(callback)) {
|
|
179
161
|
callback()
|
|
180
162
|
}
|
|
@@ -247,9 +229,9 @@ export default class TransportAction extends Component {
|
|
|
247
229
|
originalId: transfer.id,
|
|
248
230
|
id: generate()
|
|
249
231
|
}
|
|
250
|
-
delete newTrans1.fromFile
|
|
251
232
|
delete newTrans1.inited
|
|
252
233
|
delete newTrans1.zip
|
|
234
|
+
delete newTrans1.fromFile
|
|
253
235
|
const newTrans2 = copy(newTrans1)
|
|
254
236
|
newTrans2.unzip = true
|
|
255
237
|
newTrans2.id = generate()
|
|
@@ -14,7 +14,7 @@ export default class TransportsActionStore extends Component {
|
|
|
14
14
|
|
|
15
15
|
componentDidUpdate (prevProps) {
|
|
16
16
|
if (
|
|
17
|
-
prevProps.
|
|
17
|
+
prevProps.fileTransferChanged !== this.props.fileTransferChanged
|
|
18
18
|
) {
|
|
19
19
|
this.control()
|
|
20
20
|
}
|
|
@@ -22,11 +22,11 @@ export default class TransportsActionStore extends Component {
|
|
|
22
22
|
|
|
23
23
|
control = async () => {
|
|
24
24
|
const { store } = window
|
|
25
|
-
|
|
25
|
+
const {
|
|
26
26
|
fileTransfers
|
|
27
|
-
} =
|
|
27
|
+
} = store
|
|
28
28
|
|
|
29
|
-
fileTransfers
|
|
29
|
+
fileTransfers.forEach(t => {
|
|
30
30
|
const {
|
|
31
31
|
typeTo,
|
|
32
32
|
typeFrom,
|
|
@@ -37,7 +37,6 @@ export default class TransportsActionStore extends Component {
|
|
|
37
37
|
if (typeTo === typeFrom && ready && !inited) {
|
|
38
38
|
t.inited = true
|
|
39
39
|
}
|
|
40
|
-
return t
|
|
41
40
|
})
|
|
42
41
|
// if (pauseAllTransfer) {
|
|
43
42
|
// return store.setFileTransfers(fileTransfers)
|
|
@@ -46,15 +45,16 @@ export default class TransportsActionStore extends Component {
|
|
|
46
45
|
const {
|
|
47
46
|
typeTo,
|
|
48
47
|
typeFrom,
|
|
49
|
-
inited
|
|
48
|
+
inited,
|
|
49
|
+
pausing
|
|
50
50
|
} = t
|
|
51
|
-
return typeTo !== typeFrom && inited
|
|
51
|
+
return typeTo !== typeFrom && inited && pausing !== true
|
|
52
52
|
}).length
|
|
53
53
|
if (count >= maxTransport) {
|
|
54
|
-
return
|
|
54
|
+
return
|
|
55
55
|
}
|
|
56
56
|
const len = fileTransfers.length
|
|
57
|
-
const ids = []
|
|
57
|
+
// const ids = []
|
|
58
58
|
for (let i = 0; i < len; i++) {
|
|
59
59
|
const tr = fileTransfers[i]
|
|
60
60
|
const {
|
|
@@ -62,13 +62,11 @@ export default class TransportsActionStore extends Component {
|
|
|
62
62
|
typeFrom,
|
|
63
63
|
inited,
|
|
64
64
|
fromFile,
|
|
65
|
-
error,
|
|
66
|
-
id,
|
|
67
65
|
action
|
|
68
66
|
} = tr
|
|
69
|
-
if (!error) {
|
|
70
|
-
|
|
71
|
-
}
|
|
67
|
+
// if (!error) {
|
|
68
|
+
// ids.push(id)
|
|
69
|
+
// }
|
|
72
70
|
const isTransfer = typeTo !== typeFrom
|
|
73
71
|
const ready = (
|
|
74
72
|
action && fromFile
|
|
@@ -90,8 +88,10 @@ export default class TransportsActionStore extends Component {
|
|
|
90
88
|
count++
|
|
91
89
|
tr.inited = true
|
|
92
90
|
}
|
|
91
|
+
if (count >= maxTransport) {
|
|
92
|
+
break
|
|
93
|
+
}
|
|
93
94
|
}
|
|
94
|
-
store.setFileTransfers(fileTransfers)
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
render () {
|
|
@@ -11,13 +11,17 @@ export default function TransportsUI (props) {
|
|
|
11
11
|
}
|
|
12
12
|
return fileTransfers.map((t, i) => {
|
|
13
13
|
const { id } = t
|
|
14
|
+
const trProps = {
|
|
15
|
+
transfer: t,
|
|
16
|
+
index: i,
|
|
17
|
+
inited: t.inited,
|
|
18
|
+
cancel: t.cancel,
|
|
19
|
+
pausing: t.pausing,
|
|
20
|
+
config: props.config
|
|
21
|
+
}
|
|
14
22
|
return (
|
|
15
23
|
<Transport
|
|
16
|
-
{...
|
|
17
|
-
transfer={t}
|
|
18
|
-
inited={t.inited}
|
|
19
|
-
cancel={t.cancel}
|
|
20
|
-
pause={t.pausing}
|
|
24
|
+
{...trProps}
|
|
21
25
|
key={id + ':tr:' + i}
|
|
22
26
|
/>
|
|
23
27
|
)
|
|
@@ -1,77 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* bookmark select
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { memo } from 'react'
|
|
6
5
|
import BookmarkSelect from './bookmark-select'
|
|
7
|
-
import { pick } from 'lodash-es'
|
|
8
|
-
import { ArrowsAltOutlined, EditOutlined, PlusCircleOutlined, ShrinkOutlined, PushpinOutlined } from '@ant-design/icons'
|
|
9
|
-
import { Tooltip } from 'antd'
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export default memo(function BookmarkPanel (props) {
|
|
14
|
-
const { pinned } = props
|
|
15
|
-
const prps = {
|
|
16
|
-
className: 'font16 mg1x mg2l pointer iblock control-icon'
|
|
17
|
-
}
|
|
18
|
-
const prps1 = {
|
|
19
|
-
className: prps.className + (pinned ? ' pinned' : '')
|
|
20
|
-
}
|
|
7
|
+
export default function BookmarkPanel (props) {
|
|
21
8
|
const { store } = window
|
|
22
|
-
const pop1 = {
|
|
23
|
-
...prps,
|
|
24
|
-
onClick: store.onNewSsh
|
|
25
|
-
}
|
|
26
|
-
const pop2 = {
|
|
27
|
-
...prps,
|
|
28
|
-
onClick: store.expandBookmarks
|
|
29
|
-
}
|
|
30
|
-
const pop3 = {
|
|
31
|
-
...prps,
|
|
32
|
-
onClick: store.collapseBookmarks
|
|
33
|
-
}
|
|
34
9
|
return (
|
|
35
10
|
<div
|
|
36
|
-
className='sidebar-panel
|
|
37
|
-
{...pick(props, ['onMouseEnter', 'onMouseLeave'])}
|
|
11
|
+
className='sidebar-panel-bookmarks'
|
|
38
12
|
>
|
|
39
|
-
<div className='pd1y pd2t pd2x'>
|
|
40
|
-
<div className='fix'>
|
|
41
|
-
<div className='fleft'>{e('bookmarks')}</div>
|
|
42
|
-
<div className='fright'>
|
|
43
|
-
<Tooltip title={e('newBookmark')}>
|
|
44
|
-
<PlusCircleOutlined
|
|
45
|
-
{...pop1}
|
|
46
|
-
/>
|
|
47
|
-
</Tooltip>
|
|
48
|
-
<Tooltip title={`${e('edit')} ${e('bookmarks')}`}>
|
|
49
|
-
<EditOutlined
|
|
50
|
-
{...pop1}
|
|
51
|
-
/>
|
|
52
|
-
</Tooltip>
|
|
53
|
-
<Tooltip title={e('expandAll')}>
|
|
54
|
-
<ArrowsAltOutlined
|
|
55
|
-
{...pop2}
|
|
56
|
-
/>
|
|
57
|
-
</Tooltip>
|
|
58
|
-
<Tooltip title={e('collapseAll')}>
|
|
59
|
-
<ShrinkOutlined
|
|
60
|
-
{...pop3}
|
|
61
|
-
/>
|
|
62
|
-
</Tooltip>
|
|
63
|
-
<Tooltip title={e('pin')}>
|
|
64
|
-
<PushpinOutlined
|
|
65
|
-
{...prps1}
|
|
66
|
-
onClick={store.handlePin}
|
|
67
|
-
/>
|
|
68
|
-
</Tooltip>
|
|
69
|
-
</div>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
13
|
<div className='pd2l sidebar-inner'>
|
|
73
14
|
<BookmarkSelect store={store} from='sidebar' />
|
|
74
15
|
</div>
|
|
75
16
|
</div>
|
|
76
17
|
)
|
|
77
|
-
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import createTitle, { createTitleWithTag } from '../../common/create-title'
|
|
2
|
+
import { DeleteOutlined } from '@ant-design/icons'
|
|
3
|
+
|
|
4
|
+
export default function HistoryItem (props) {
|
|
5
|
+
const { store } = window
|
|
6
|
+
const {
|
|
7
|
+
item,
|
|
8
|
+
index
|
|
9
|
+
} = props
|
|
10
|
+
function handleClick () {
|
|
11
|
+
store.onSelectHistory(item.tab)
|
|
12
|
+
}
|
|
13
|
+
function handleDelete (e) {
|
|
14
|
+
e.stopPropagation()
|
|
15
|
+
store.history.splice(index, 1)
|
|
16
|
+
}
|
|
17
|
+
const title = createTitleWithTag(item.tab)
|
|
18
|
+
const tt = createTitle(item.tab)
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
className='item-list-unit'
|
|
22
|
+
title={tt}
|
|
23
|
+
onClick={handleClick}
|
|
24
|
+
>
|
|
25
|
+
<div className='elli pd1y pd2x'>
|
|
26
|
+
{title}
|
|
27
|
+
</div>
|
|
28
|
+
<DeleteOutlined
|
|
29
|
+
className='list-item-edit'
|
|
30
|
+
onClick={handleDelete}
|
|
31
|
+
/>
|
|
32
|
+
</div>
|
|
33
|
+
)
|
|
34
|
+
}
|