@electerm/electerm-react 1.37.36 → 1.37.46

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.
@@ -6,7 +6,11 @@
6
6
  */
7
7
 
8
8
  export default (basePath, nameOrDot) => {
9
- const sep = basePath.includes('\\') || basePath.includes(':\\') || /^[a-z]+:$/i.test(basePath)
9
+ const sep = (basePath.includes('\\') ||
10
+ basePath.includes(':\\') ||
11
+ /^[a-z]+:$/i.test(basePath) ||
12
+ /^[a-z]+:$/i.test(nameOrDot)
13
+ )
10
14
  ? '\\'
11
15
  : '/'
12
16
  if (nameOrDot === '..') {
@@ -18,12 +22,15 @@ export default (basePath, nameOrDot) => {
18
22
  const res = arr.slice(0, length - 1).join(sep)
19
23
  return res || '/'
20
24
  }
21
- const pre = nameOrDot.includes(':\\') && basePath === '/'
25
+ const pre = (nameOrDot.includes(':\\') || /^[a-z]+:$/i.test(nameOrDot)) && basePath === '/'
22
26
  ? ''
23
27
  : basePath
24
- return pre +
25
- (basePath.endsWith(sep) ? '' : sep) +
26
- nameOrDot
28
+ const mid = (basePath.endsWith(sep) ? '' : sep)
29
+ let ff = pre + mid + nameOrDot
30
+ if (/^\\[a-z]+:$/i.test(ff)) {
31
+ ff = ff.slice(1)
32
+ }
33
+ return ff
27
34
  }
28
35
 
29
36
  export const osResolve = (...args) => {
@@ -6,6 +6,7 @@ import fetch from './fetch-from-server'
6
6
  import {
7
7
  baseUpdateCheckUrls, packInfo
8
8
  } from './constants'
9
+ import dayjs from 'dayjs'
9
10
 
10
11
  async function fetchData (url, options) {
11
12
  const data = {
@@ -75,5 +76,10 @@ export async function getLatestReleaseInfo () {
75
76
  url = `${baseUpdateCheckUrls[1]}/data/electerm-github-release.json`
76
77
  res = await getInfo(url)
77
78
  }
78
- return res?.release?.body
79
+ return res && res.release
80
+ ? {
81
+ body: res.release.body,
82
+ date: dayjs(res.release.published_at).format('YYYY-MM-DD')
83
+ }
84
+ : undefined
79
85
  }
@@ -246,7 +246,7 @@ export default class Upgrade extends PureComponent {
246
246
  return (
247
247
  <div className='pd1t'>
248
248
  <div className='bold'>Changelog:</div>
249
- <Markdown text={releaseInfo} />
249
+ <Markdown text={releaseInfo.body} />
250
250
  <Link
251
251
  to={packInfo.releases}
252
252
  >{e('moreChangeLog')}
@@ -279,6 +279,7 @@ export default class Upgrade extends PureComponent {
279
279
  showUpgradeModal,
280
280
  upgradePercent,
281
281
  shouldUpgrade,
282
+ releaseInfo,
282
283
  error
283
284
  } = this.props.upgradeInfo
284
285
  if (error) {
@@ -317,7 +318,7 @@ export default class Upgrade extends PureComponent {
317
318
  <div className={cls}>
318
319
  <div className='upgrade-panel-title'>
319
320
  <MinusSquareOutlined className='pointer font16 close-upgrade-panel' onClick={this.handleMinimize} />
320
- {e('newVersion')} <b>{remoteVersion}</b>
321
+ {e('newVersion')} <b>{remoteVersion} [{releaseInfo.date}]</b>
321
322
  </div>
322
323
  <div className='upgrade-panel-body'>
323
324
  {
@@ -373,11 +373,11 @@ export default class Sftp extends Component {
373
373
  }
374
374
 
375
375
  doCopy = (type, e) => {
376
- this[type + 'Dom'].onCopy(e, this.state.selectedFiles)
376
+ this[type + 'Dom'].onCopy(this.state.selectedFiles)
377
377
  }
378
378
 
379
379
  doCut = (type, e) => {
380
- this[type + 'Dom'].onCut(e, this.state.selectedFiles)
380
+ this[type + 'Dom'].onCut(this.state.selectedFiles)
381
381
  }
382
382
 
383
383
  doPaste = (type) => {
@@ -396,7 +396,7 @@ export default class Sftp extends Component {
396
396
  }
397
397
  const { type } = lastClickedFile
398
398
  const { inputFocus, onDelete } = this
399
- if (keyControlPressed(e) && keyPressed(e, 'a') && !inputFocus) {
399
+ if (keyControlPressed(e) && keyPressed(e, 'keyA') && !inputFocus) {
400
400
  e.stopPropagation()
401
401
  this.selectAll(type, e)
402
402
  } else if (keyPressed(e, 'arrowdown') && !inputFocus) {
@@ -411,13 +411,13 @@ export default class Sftp extends Component {
411
411
  } else if (keyPressed(e, 'enter') && !inputFocus && !onDelete) {
412
412
  e.stopPropagation()
413
413
  this.enter(type, e)
414
- } else if (keyControlPressed(e) && keyPressed(e, 'c') && !inputFocus) {
414
+ } else if (keyControlPressed(e) && keyPressed(e, 'keyC') && !inputFocus) {
415
415
  e.stopPropagation()
416
416
  this.doCopy(type, e)
417
- } else if (keyControlPressed(e) && keyPressed(e, 'x') && !inputFocus) {
417
+ } else if (keyControlPressed(e) && keyPressed(e, 'keyX') && !inputFocus) {
418
418
  e.stopPropagation()
419
419
  this.doCut(type, e)
420
- } else if (keyControlPressed(e) && keyPressed(e, 'v') && !inputFocus) {
420
+ } else if (keyControlPressed(e) && keyPressed(e, 'keyV') && !inputFocus) {
421
421
  e.stopPropagation()
422
422
  this.doPaste(type, e)
423
423
  } else if (keyPressed(e, 'f5')) {
@@ -63,7 +63,6 @@ export default () => {
63
63
  name: 'terminal_paste',
64
64
  shortcut: 'ctrl+v,ctrl+shift+v',
65
65
  shortcutMac: 'meta+v',
66
- hidden: true,
67
66
  readonly: true
68
67
  },
69
68
  {
@@ -23,6 +23,7 @@ import findParentBySel from '../../common/find-parent'
23
23
  import WindowControl from './window-control'
24
24
  import BookmarksList from '../sidebar/bookmark-select'
25
25
  import AppDrag from './app-drag'
26
+ import classNames from 'classnames'
26
27
 
27
28
  const { prefix } = window
28
29
  const e = prefix('tabs')
@@ -176,16 +177,19 @@ export default class Tabs extends React.Component {
176
177
  }
177
178
 
178
179
  renderAddBtn = () => {
179
- if (!this.props.tabs.length) {
180
- return null
181
- }
180
+ const cls = classNames(
181
+ 'pointer tabs-add-btn font16',
182
+ {
183
+ empty: !this.props.tabs.length
184
+ }
185
+ )
182
186
  return (
183
187
  <Popover
184
188
  content={this.renderMenus()}
185
189
  >
186
190
  <PlusCircleOutlined
187
191
  title={e('openNewTerm')}
188
- className='pointer tabs-add-btn font16'
192
+ className={cls}
189
193
  onClick={() => this.props.addTab()}
190
194
  />
191
195
  </Popover>
@@ -121,6 +121,10 @@
121
121
  margin 10px 3px 0 3px
122
122
  -webkit-app-region no-drag
123
123
  color text
124
+ &.empty
125
+ font-size 20px
126
+ margin-left 20px
127
+ margin-top 20px
124
128
  &:hover
125
129
  color text-light
126
130
  .tabs-extra
@@ -131,6 +135,7 @@
131
135
  line-height 20px
132
136
  z-index 20
133
137
  -webkit-app-region no-drag
138
+
134
139
  // .ant-btn
135
140
  // background #333
136
141
  // color #aaa
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electerm/electerm-react",
3
- "version": "1.37.36",
3
+ "version": "1.37.46",
4
4
  "description": "react components src for electerm",
5
5
  "main": "./client/components/main/main.jsx",
6
6
  "license": "MIT",