@electerm/electerm-react 1.40.2 → 1.40.16

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.
@@ -27,7 +27,7 @@ const {
27
27
  export default class Upgrade extends PureComponent {
28
28
  state = {
29
29
  showCount: 0,
30
- mirror: mirrors['download-electerm']
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.github
118
+ const nextMirror = mirror === mirrors['download-electerm']
119
119
  ? mirrors.sourceforge
120
- : mirrors.github
120
+ : mirrors['download-electerm']
121
121
  this.setState({
122
122
  mirror: nextMirror
123
123
  }, next)
@@ -11,7 +11,7 @@
11
11
  z-index 89
12
12
  height auto
13
13
  bottom 36px
14
- background alpha(main-dark, .9)
14
+
15
15
  .qm-pinned
16
16
  .qm-wrap-tooltip
17
17
  height 180px
@@ -34,6 +34,7 @@
34
34
  .list-item-edit
35
35
  .list-item-remove
36
36
  display block
37
- .list-item-edit
38
- .list-item-apply
39
- right 20px
37
+ .item-list
38
+ .list-item-edit
39
+ .list-item-apply
40
+ right 20px
@@ -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 = e => {
117
+ handleChange = keyword => {
118
118
  this.setState({
119
- keyword: e.target.value
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
- <Search
345
- onChange={this.handleChange}
346
- value={this.state.keyword}
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
+ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electerm/electerm-react",
3
- "version": "1.40.2",
3
+ "version": "1.40.16",
4
4
  "description": "react components src for electerm",
5
5
  "main": "./client/components/main/main.jsx",
6
6
  "license": "MIT",