@electerm/electerm-react 1.40.6 → 1.40.18
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/components/main/upgrade.jsx +3 -3
- package/client/components/quick-commands/qm.styl +1 -1
- package/client/components/sftp/transfer-conflict-store.jsx +1 -1
- package/client/components/sftp/transport-action-store.jsx +3 -3
- package/client/components/sftp/zip.js +1 -1
- package/client/components/tree-list/tree-list.jsx +6 -6
- package/client/components/tree-list/tree-search.jsx +27 -0
- package/package.json +1 -1
|
@@ -27,7 +27,7 @@ const {
|
|
|
27
27
|
export default class Upgrade extends PureComponent {
|
|
28
28
|
state = {
|
|
29
29
|
showCount: 0,
|
|
30
|
-
mirror: mirrors
|
|
30
|
+
mirror: mirrors.github
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
downloadTimer = null
|
|
@@ -115,9 +115,9 @@ export default class Upgrade extends PureComponent {
|
|
|
115
115
|
const next = mirror !== mirrors.sourceforge
|
|
116
116
|
? this.doUpgrade
|
|
117
117
|
: undefined
|
|
118
|
-
const nextMirror = mirror === mirrors
|
|
118
|
+
const nextMirror = mirror === mirrors['download-electerm']
|
|
119
119
|
? mirrors.sourceforge
|
|
120
|
-
: mirrors
|
|
120
|
+
: mirrors['download-electerm']
|
|
121
121
|
this.setState({
|
|
122
122
|
mirror: nextMirror
|
|
123
123
|
}, next)
|
|
@@ -240,7 +240,7 @@ export default class TransferConflictStore extends Component {
|
|
|
240
240
|
} else {
|
|
241
241
|
toFile = await this.checkExist(typeTo, toPath, sessionId)
|
|
242
242
|
}
|
|
243
|
-
if (fromFile.isDirectory) {
|
|
243
|
+
if (fromFile.isDirectory && typeFrom !== typeTo) {
|
|
244
244
|
const props = {
|
|
245
245
|
sftp: window.sftps[sessionId]
|
|
246
246
|
}
|
|
@@ -380,12 +380,12 @@ export default class TransportAction extends Component {
|
|
|
380
380
|
})
|
|
381
381
|
this.inst.startTime = t
|
|
382
382
|
this.inst.started = true
|
|
383
|
-
if (
|
|
383
|
+
if (typeFrom === typeTo) {
|
|
384
|
+
return this.mvOrCp()
|
|
385
|
+
} else if (unzip && inited) {
|
|
384
386
|
this.unzipFile()
|
|
385
387
|
} else if (zip && inited) {
|
|
386
388
|
this.zipTransfer()
|
|
387
|
-
} else if (typeFrom === typeTo) {
|
|
388
|
-
return this.mvOrCp()
|
|
389
389
|
} else if (isDirectory && expanded && this.isTransferAction(action)) {
|
|
390
390
|
return this.mkdir()
|
|
391
391
|
.then(this.onEnd)
|
|
@@ -16,7 +16,7 @@ export async function zipCmd (pid, sessionId, filePath) {
|
|
|
16
16
|
const id = generate()
|
|
17
17
|
const { path, name } = getFolderFromFilePath(filePath, isRemote)
|
|
18
18
|
const np = resolve(temp, `electerm-${id}.tar`)
|
|
19
|
-
const cmd = `tar -C ${path} -cf ${np} ${name}`
|
|
19
|
+
const cmd = `tar -C "${path}" -cf "${np}" "${name}"`
|
|
20
20
|
await runCmd(pid, sessionId, cmd)
|
|
21
21
|
return np
|
|
22
22
|
}
|
|
@@ -32,7 +32,6 @@ import {
|
|
|
32
32
|
} from '../../common/constants'
|
|
33
33
|
import findParentBySel from '../../common/find-parent'
|
|
34
34
|
import copy from 'json-deep-copy'
|
|
35
|
-
import Search from '../common/search'
|
|
36
35
|
import Btns from './bookmark-transport'
|
|
37
36
|
import findBookmarkGroupId from '../../common/find-bookmark-group-id'
|
|
38
37
|
import getInitItem from '../../common/init-setting-item'
|
|
@@ -41,6 +40,7 @@ import deepEqual from 'fast-deep-equal'
|
|
|
41
40
|
import './tree-list.styl'
|
|
42
41
|
import TreeExpander from './tree-expander'
|
|
43
42
|
import TreeListItem from './tree-list-item'
|
|
43
|
+
import TreeSearch from './tree-search'
|
|
44
44
|
|
|
45
45
|
const e = window.translate
|
|
46
46
|
|
|
@@ -114,9 +114,9 @@ export default class ItemListTree extends Component {
|
|
|
114
114
|
this.onExpand(nkeys)
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
handleChange =
|
|
117
|
+
handleChange = keyword => {
|
|
118
118
|
this.setState({
|
|
119
|
-
keyword
|
|
119
|
+
keyword
|
|
120
120
|
})
|
|
121
121
|
}
|
|
122
122
|
|
|
@@ -341,9 +341,9 @@ export default class ItemListTree extends Component {
|
|
|
341
341
|
renderSearch = () => {
|
|
342
342
|
return (
|
|
343
343
|
<div className='pd1y'>
|
|
344
|
-
<
|
|
345
|
-
|
|
346
|
-
|
|
344
|
+
<TreeSearch
|
|
345
|
+
onSearch={this.handleChange}
|
|
346
|
+
keyword={this.state.keyword}
|
|
347
347
|
/>
|
|
348
348
|
</div>
|
|
349
349
|
)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { useState, memo } from 'react'
|
|
2
|
+
import { debounce } from 'lodash-es'
|
|
3
|
+
import Search from '../common/search'
|
|
4
|
+
import runIdle from '../../common/run-idle'
|
|
5
|
+
|
|
6
|
+
export default memo(function TreeSearchComponent ({ onSearch, keyword }) {
|
|
7
|
+
const [searchTerm, setSearchTerm] = useState(keyword)
|
|
8
|
+
|
|
9
|
+
const performSearch = debounce((term) => {
|
|
10
|
+
runIdle(() => {
|
|
11
|
+
onSearch(term)
|
|
12
|
+
})
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
const handleChange = (e) => {
|
|
16
|
+
const term = e.target.value
|
|
17
|
+
setSearchTerm(term)
|
|
18
|
+
performSearch(term)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Search
|
|
23
|
+
onChange={handleChange}
|
|
24
|
+
value={searchTerm}
|
|
25
|
+
/>
|
|
26
|
+
)
|
|
27
|
+
})
|