@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
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* file transfer list related functions
|
|
3
|
+
*/
|
|
4
|
+
const { assign } = Object
|
|
5
|
+
|
|
2
6
|
export default Store => {
|
|
3
7
|
Store.prototype.handleTransferTab = function (tab) {
|
|
4
8
|
window.store.transferTab = tab
|
|
5
9
|
}
|
|
6
10
|
|
|
7
|
-
Store.prototype.
|
|
8
|
-
const {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return t.sessionId === sessId
|
|
13
|
-
})
|
|
14
|
-
const idsToRm = arr2.reduce((prev, curr) => {
|
|
15
|
-
if (!list.find(l => l.id === curr.id)) {
|
|
16
|
-
prev.push(curr.id)
|
|
17
|
-
}
|
|
18
|
-
return prev
|
|
19
|
-
}, [])
|
|
20
|
-
if (idsToRm.length) {
|
|
21
|
-
oldList = oldList.filter(t => {
|
|
22
|
-
return !idsToRm.includes(t.id)
|
|
23
|
-
})
|
|
24
|
-
}
|
|
25
|
-
for (const ntm of list) {
|
|
26
|
-
const index = findIndex(oldList, t => {
|
|
27
|
-
return t.id === ntm.id
|
|
28
|
-
})
|
|
29
|
-
if (index >= 0) {
|
|
30
|
-
oldList[index] = ntm
|
|
31
|
-
continue
|
|
32
|
-
} else {
|
|
33
|
-
oldList.unshift(ntm)
|
|
34
|
-
}
|
|
11
|
+
Store.prototype.updateTransfer = function (id, update) {
|
|
12
|
+
const { fileTransfers } = window.store
|
|
13
|
+
const index = fileTransfers.findIndex(t => t.id === id)
|
|
14
|
+
if (index < 0) {
|
|
15
|
+
return
|
|
35
16
|
}
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
Store.prototype.getTransfers = function () {
|
|
39
|
-
return window.store.getItems('fileTransfers')
|
|
40
|
-
}
|
|
41
|
-
Store.prototype.delTransfers = function (ids) {
|
|
42
|
-
return window.store.delItems(ids, 'fileTransfers')
|
|
43
|
-
}
|
|
44
|
-
Store.prototype.editTransfer = function (id, updates) {
|
|
45
|
-
return window.store.editItem(id, updates, 'fileTransfers')
|
|
46
|
-
}
|
|
47
|
-
Store.prototype.addTransfers = function (objs) {
|
|
48
|
-
return window.store.addItems(objs, 'fileTransfers')
|
|
17
|
+
assign(fileTransfers[index], update)
|
|
49
18
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const { store } = window
|
|
55
|
-
store.setFileTransfers([
|
|
56
|
-
...store.fileTransfers,
|
|
57
|
-
...objs
|
|
58
|
-
])
|
|
19
|
+
|
|
20
|
+
Store.prototype.addTransferList = function (items) {
|
|
21
|
+
const { fileTransfers } = window.store
|
|
22
|
+
fileTransfers.push(...items)
|
|
59
23
|
}
|
|
24
|
+
|
|
60
25
|
Store.prototype.toggleTransfer = function (itemId) {
|
|
61
|
-
const {
|
|
62
|
-
const
|
|
63
|
-
const index = findIndex(fileTransfers, t => t.id === itemId)
|
|
26
|
+
const { fileTransfers } = window.store
|
|
27
|
+
const index = fileTransfers.findIndex(t => t.id === itemId)
|
|
64
28
|
if (index < 0) {
|
|
65
29
|
return
|
|
66
30
|
}
|
|
67
31
|
fileTransfers[index].pausing = !fileTransfers[index].pausing
|
|
68
|
-
store.setFileTransfers(fileTransfers)
|
|
69
32
|
}
|
|
70
33
|
|
|
71
34
|
Store.prototype.pauseAll = function () {
|
|
72
|
-
const {
|
|
73
|
-
store.pauseAllTransfer = true
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
35
|
+
const { fileTransfers } = window.store
|
|
36
|
+
window.store.pauseAllTransfer = true
|
|
37
|
+
const len = fileTransfers.length
|
|
38
|
+
for (let i = 0; i < len; i++) {
|
|
39
|
+
fileTransfers[i].pausing = true
|
|
40
|
+
}
|
|
78
41
|
}
|
|
42
|
+
|
|
79
43
|
Store.prototype.resumeAll = function () {
|
|
80
|
-
const {
|
|
81
|
-
store.pauseAllTransfer = false
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
44
|
+
const { fileTransfers } = window.store
|
|
45
|
+
window.store.pauseAllTransfer = false
|
|
46
|
+
const len = fileTransfers.length
|
|
47
|
+
for (let i = 0; i < len; i++) {
|
|
48
|
+
fileTransfers[i].pausing = false
|
|
49
|
+
}
|
|
86
50
|
}
|
|
51
|
+
|
|
87
52
|
Store.prototype.cancelAll = function () {
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
53
|
+
const { fileTransfers } = window.store
|
|
54
|
+
const len = fileTransfers.length
|
|
55
|
+
for (let i = len - 1; i >= 0; i--) {
|
|
56
|
+
fileTransfers[i].cancel = true
|
|
57
|
+
fileTransfers.splice(i, 1)
|
|
58
|
+
}
|
|
92
59
|
}
|
|
60
|
+
|
|
93
61
|
Store.prototype.cancelTransfer = function (itemId) {
|
|
94
|
-
const {
|
|
95
|
-
const
|
|
96
|
-
const index = findIndex(fileTransfers, t => t.id === itemId)
|
|
62
|
+
const { fileTransfers } = window.store
|
|
63
|
+
const index = fileTransfers.findIndex(t => t.id === itemId)
|
|
97
64
|
if (index < 0) {
|
|
98
65
|
return
|
|
99
66
|
}
|
|
100
67
|
fileTransfers[index].cancel = true
|
|
101
|
-
|
|
68
|
+
fileTransfers.splice(index, 1)
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
Store.prototype.removeTransfer = function (id) {
|
|
72
|
+
const { fileTransfers } = window.store
|
|
73
|
+
const index = fileTransfers.findIndex(t => t.id === id)
|
|
74
|
+
if (index > -1) {
|
|
75
|
+
fileTransfers.splice(index, 1)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
Store.prototype.skipAllTransfersSinceIndex = function (index) {
|
|
80
|
+
window.store.fileTransfers.splice(index)
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
Store.prototype.updateTransfersFromIndex = function (index, update) {
|
|
84
|
+
const { fileTransfers } = window.store
|
|
85
|
+
if (index < 0 || index >= fileTransfers.length) {
|
|
86
|
+
return
|
|
87
|
+
}
|
|
88
|
+
const len = fileTransfers.length
|
|
89
|
+
for (let i = index; i < len; i++) {
|
|
90
|
+
assign(fileTransfers[i], update)
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Add a new method to find index by ID and then update
|
|
95
|
+
Store.prototype.updateTransfersFromId = function (id, update) {
|
|
96
|
+
const { fileTransfers } = window.store
|
|
97
|
+
const index = fileTransfers.findIndex(t => t.id === id)
|
|
98
|
+
if (index < 0) {
|
|
99
|
+
return
|
|
100
|
+
}
|
|
101
|
+
window.store.updateTransfersFromIndex(index, update)
|
|
102
102
|
}
|
|
103
103
|
}
|
package/client/store/watch.js
CHANGED
|
@@ -43,7 +43,7 @@ export default store => {
|
|
|
43
43
|
await store.uploadSettingAll()
|
|
44
44
|
}
|
|
45
45
|
return store['_' + name]
|
|
46
|
-
}
|
|
46
|
+
}).start()
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
autoRun(async () => {
|
|
@@ -97,6 +97,11 @@ export default store => {
|
|
|
97
97
|
return store._checkedKeys
|
|
98
98
|
}).start()
|
|
99
99
|
|
|
100
|
+
autoRun(() => {
|
|
101
|
+
ls.setItemJSON('history', store.history)
|
|
102
|
+
return store.history
|
|
103
|
+
}).start()
|
|
104
|
+
|
|
100
105
|
autoRun(() => {
|
|
101
106
|
const tabs = store.getTabs()
|
|
102
107
|
const { activeTabId } = store
|
|
@@ -106,6 +111,9 @@ export default store => {
|
|
|
106
111
|
window.pre.runGlobalAsync('setTitle', title)
|
|
107
112
|
window.store.currentLayoutBatch = tab.batch
|
|
108
113
|
}
|
|
114
|
+
if (tab && store.rightPanelVisible) {
|
|
115
|
+
window.store.openInfoPanel()
|
|
116
|
+
}
|
|
109
117
|
return store.activeTabId
|
|
110
118
|
}).start()
|
|
111
119
|
}
|
package/package.json
CHANGED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import SettingCol from './col'
|
|
2
|
-
import BookmarkForm from '../bookmark-form'
|
|
3
|
-
import List from './list'
|
|
4
|
-
import {
|
|
5
|
-
settingMap
|
|
6
|
-
} from '../../common/constants'
|
|
7
|
-
|
|
8
|
-
const e = window.translate
|
|
9
|
-
|
|
10
|
-
export default function TabHistory (props) {
|
|
11
|
-
const {
|
|
12
|
-
settingTab
|
|
13
|
-
} = props
|
|
14
|
-
if (settingTab !== settingMap.history) {
|
|
15
|
-
return null
|
|
16
|
-
}
|
|
17
|
-
const {
|
|
18
|
-
settingItem,
|
|
19
|
-
listProps,
|
|
20
|
-
formProps
|
|
21
|
-
} = props
|
|
22
|
-
return (
|
|
23
|
-
<div
|
|
24
|
-
className='setting-tabs-history'
|
|
25
|
-
>
|
|
26
|
-
<SettingCol>
|
|
27
|
-
<List
|
|
28
|
-
{...listProps}
|
|
29
|
-
/>
|
|
30
|
-
{
|
|
31
|
-
settingItem.id
|
|
32
|
-
? (
|
|
33
|
-
<BookmarkForm
|
|
34
|
-
key={settingItem.id}
|
|
35
|
-
{...formProps}
|
|
36
|
-
/>
|
|
37
|
-
)
|
|
38
|
-
: <div className='form-wrap pd2 aligncenter'>{e('notFoundContent')}</div>
|
|
39
|
-
}
|
|
40
|
-
</SettingCol>
|
|
41
|
-
</div>
|
|
42
|
-
)
|
|
43
|
-
}
|