@electerm/electerm-react 3.15.161 → 3.15.166
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.
|
@@ -251,6 +251,7 @@ export const checkedKeysLsKey = 'checked-keys'
|
|
|
251
251
|
export const quickCommandLabelsLsKey = 'quick-command-label'
|
|
252
252
|
export const localAddrBookmarkLsKey = 'local-addr-bookmark-keys'
|
|
253
253
|
export const dismissDelKeyTipLsKey = 'dismiss-del-key-tip'
|
|
254
|
+
export const treeSortLsKey = 'tree-sort'
|
|
254
255
|
export const sshTunnelHelpLink = 'https://github.com/electerm/electerm/wiki/How-to-use-ssh-tunnel'
|
|
255
256
|
export const proxyHelpLink = 'https://github.com/electerm/electerm/wiki/proxy-format'
|
|
256
257
|
export const regexHelpLink = 'https://github.com/electerm/electerm/wiki/Terminal-keywords-highlight-regular-expression-exmaples'
|
|
@@ -69,6 +69,23 @@ export async function getLatestReleaseVersion (n) {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
export function getDownloadUrl (browserDownloadUrl, mirror) {
|
|
73
|
+
if (!browserDownloadUrl) {
|
|
74
|
+
return ''
|
|
75
|
+
}
|
|
76
|
+
if (mirror === 'gh-proxy') {
|
|
77
|
+
return `https://electerm-mirror.html5beta.com/${browserDownloadUrl}`
|
|
78
|
+
} if (mirror === 'sourceforge') {
|
|
79
|
+
const arr = browserDownloadUrl.split('/')
|
|
80
|
+
const len = arr.length
|
|
81
|
+
return `https://master.dl.sourceforge.net/project/electerm.mirror/${arr[len - 2]}/${arr[len - 1]}?viasf=1`
|
|
82
|
+
} else if (mirror === 'r2') {
|
|
83
|
+
return `https://electerm-store.html5beta.com/r/${browserDownloadUrl.split('/').pop()}`
|
|
84
|
+
} else {
|
|
85
|
+
return browserDownloadUrl
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
72
89
|
export async function getLatestReleaseInfo () {
|
|
73
90
|
let url = `${baseUpdateCheckUrls[0]}/data/electerm-github-release.json`
|
|
74
91
|
let res = await getInfo(url)
|
|
@@ -76,10 +93,14 @@ export async function getLatestReleaseInfo () {
|
|
|
76
93
|
url = `${baseUpdateCheckUrls[1]}/data/electerm-github-release.json`
|
|
77
94
|
res = await getInfo(url)
|
|
78
95
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
96
|
+
if (!res || !res.release) {
|
|
97
|
+
return undefined
|
|
98
|
+
}
|
|
99
|
+
const { installSrc } = window.store
|
|
100
|
+
const asset = (res.release.assets || []).find(r => r.name.includes(installSrc))
|
|
101
|
+
return {
|
|
102
|
+
body: res.release.body,
|
|
103
|
+
date: dayjs(res.release.published_at).format('YYYY-MM-DD'),
|
|
104
|
+
browserDownloadUrl: asset ? asset.browser_download_url : ''
|
|
105
|
+
}
|
|
85
106
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PureComponent } from 'react'
|
|
2
2
|
import { CloseOutlined, MinusSquareOutlined, UpCircleOutlined } from '@ant-design/icons'
|
|
3
3
|
import { Button, Select, Space } from 'antd'
|
|
4
|
-
import { getLatestReleaseInfo, getLatestReleaseVersion } from '../../common/update-check'
|
|
4
|
+
import { getLatestReleaseInfo, getLatestReleaseVersion, getDownloadUrl } from '../../common/update-check'
|
|
5
5
|
import upgrade from '../../common/upgrade'
|
|
6
6
|
import compare from '../../common/version-compare'
|
|
7
7
|
import Link from '../common/external-link'
|
|
@@ -136,6 +136,14 @@ export default class Upgrade extends PureComponent {
|
|
|
136
136
|
}
|
|
137
137
|
)
|
|
138
138
|
}
|
|
139
|
+
if (window.et.downloadUpgradeFromBrowser) {
|
|
140
|
+
const { releaseInfo } = this.props.upgradeInfo
|
|
141
|
+
const downloadUrl = getDownloadUrl(releaseInfo?.browserDownloadUrl, this.state.mirror)
|
|
142
|
+
if (downloadUrl) {
|
|
143
|
+
window.openLink(downloadUrl)
|
|
144
|
+
}
|
|
145
|
+
return
|
|
146
|
+
}
|
|
139
147
|
this.changeProps({
|
|
140
148
|
upgrading: true
|
|
141
149
|
})
|
|
@@ -9,8 +9,10 @@ import { uniq, filter, pick } from 'lodash-es'
|
|
|
9
9
|
import {
|
|
10
10
|
maxBookmarkGroupTitleLength,
|
|
11
11
|
defaultBookmarkGroupId,
|
|
12
|
-
settingMap
|
|
12
|
+
settingMap,
|
|
13
|
+
treeSortLsKey
|
|
13
14
|
} from '../../common/constants'
|
|
15
|
+
import { getItemJSON, setItemJSON } from '../../common/safe-local-storage'
|
|
14
16
|
import findParentBySel from '../../common/find-parent'
|
|
15
17
|
import copy from 'json-deep-copy'
|
|
16
18
|
import NewButtonsGroup from './bookmark-toolbar'
|
|
@@ -45,7 +47,7 @@ export default class ItemListTree extends Component {
|
|
|
45
47
|
categoryColor: '',
|
|
46
48
|
categoryId: '',
|
|
47
49
|
searchSelectedRowKey: '',
|
|
48
|
-
sort: null
|
|
50
|
+
sort: getItemJSON(treeSortLsKey, null)
|
|
49
51
|
}
|
|
50
52
|
this.listRef = React.createRef()
|
|
51
53
|
}
|
|
@@ -111,6 +113,7 @@ export default class ItemListTree extends Component {
|
|
|
111
113
|
}
|
|
112
114
|
|
|
113
115
|
handleSortChange = sort => {
|
|
116
|
+
setItemJSON(treeSortLsKey, sort)
|
|
114
117
|
this.setState({ sort })
|
|
115
118
|
}
|
|
116
119
|
|
package/client/store/tab.js
CHANGED