@electerm/electerm-react 2.3.6 → 2.3.30

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.
Files changed (50) hide show
  1. package/client/common/constants.js +1 -1
  2. package/client/common/has-active-input.js +10 -0
  3. package/client/common/ui-theme.js +25 -12
  4. package/client/components/ai/ai.styl +1 -3
  5. package/client/components/bg/custom-css.jsx +2 -2
  6. package/client/components/common/highlight.styl +1 -2
  7. package/client/components/common/input-context-menu.jsx +294 -0
  8. package/client/components/file-transfer/transfer.styl +6 -8
  9. package/client/components/footer/footer.styl +2 -5
  10. package/client/components/layout/layout.styl +2 -3
  11. package/client/components/main/error-wrapper.jsx +3 -3
  12. package/client/components/main/main.jsx +2 -1
  13. package/client/components/main/ui-theme.jsx +46 -6
  14. package/client/components/main/upgrade.styl +4 -6
  15. package/client/components/main/wrapper.styl +5 -27
  16. package/client/components/quick-commands/qm.styl +3 -5
  17. package/client/components/session/session.styl +11 -13
  18. package/client/components/setting-panel/list.styl +5 -5
  19. package/client/components/setting-panel/setting-wrap.styl +1 -6
  20. package/client/components/setting-panel/terminal-bg-config.jsx +3 -0
  21. package/client/components/setting-sync/setting-sync-form.jsx +0 -1
  22. package/client/components/sftp/file-item.jsx +8 -5
  23. package/client/components/sftp/sftp-entry.jsx +18 -4
  24. package/client/components/sftp/sftp.styl +24 -28
  25. package/client/components/sftp/transfer-tag.styl +3 -5
  26. package/client/components/side-panel-r/right-side-panel.styl +7 -9
  27. package/client/components/sidebar/index.jsx +6 -0
  28. package/client/components/sidebar/info.styl +0 -12
  29. package/client/components/sidebar/sidebar.styl +15 -16
  30. package/client/components/sys-menu/sub-tab-menu.jsx +2 -2
  31. package/client/components/sys-menu/sys-menu.styl +11 -11
  32. package/client/components/tabs/add-btn.jsx +258 -0
  33. package/client/components/tabs/add-btn.styl +12 -0
  34. package/client/components/tabs/index.jsx +8 -56
  35. package/client/components/tabs/tabs.styl +30 -31
  36. package/client/components/terminal/term-search.styl +3 -3
  37. package/client/components/terminal/terminal.jsx +2 -2
  38. package/client/components/terminal/terminal.styl +21 -22
  39. package/client/components/terminal-info/terminal-info.styl +7 -7
  40. package/client/components/theme/terminal-theme-list.styl +2 -2
  41. package/client/components/theme/theme-list-item.jsx +62 -20
  42. package/client/components/tree-list/tree-expander.jsx +4 -2
  43. package/client/css/basic.styl +5 -8
  44. package/client/css/includes/theme.styl +16 -0
  45. package/client/store/ui-theme.js +0 -35
  46. package/package.json +1 -1
  47. package/client/components/common/native-input.styl +0 -7
  48. package/client/components/setting-sync/sync.styl +0 -7
  49. package/client/css/antd-overwrite.styl +0 -10
  50. package/client/css/includes/theme-default.styl +0 -20
@@ -1,4 +1,3 @@
1
- @require '../../css/includes/theme-default'
2
1
  @keyframes rotate
3
2
  from
4
3
  background-position -3000px
@@ -10,7 +9,7 @@
10
9
  left 0
11
10
  width 100%
12
11
  height 1px
13
- background text-dark
12
+ background var(--text-dark)
14
13
  display none
15
14
  .type-tab-txt
16
15
  position relative
@@ -20,14 +19,13 @@
20
19
  display inline-block
21
20
  vertical-align middle
22
21
  line-height 30px
23
- color text-dark
24
22
  padding 0 20px 0 0
25
23
  margin-right 0px
26
24
  font-size 14px
27
25
  cursor pointer
28
26
  &:hover
29
27
  &.active
30
- color text
28
+ color var(--text-light)
31
29
  &.active
32
30
  .type-tab-line
33
31
  display inline-block
@@ -36,34 +34,34 @@
36
34
  .type-tab.sftp
37
35
  .type-tab-line
38
36
  display inline-block
39
- background linear-gradient(to right, success 0%, main 25%, error 50%, primary 75%, success 100%)
37
+ background linear-gradient(to right, var(--success) 0%, var(--main) 25%, var(--error) 50%, var(--primary) 75%, var(--success) 100%)
40
38
  animation: rotate 60s infinite linear
41
39
  .disable-ssh
42
40
  .type-tab.ssh
43
41
  display none
44
42
  .spliter
45
- color text
43
+ color var(--text)
46
44
  &:hover
47
- color text-light
45
+ color var(--text-light)
48
46
 
49
47
  .sessions
50
48
  position absolute
51
- background main
49
+ background var(--main)
52
50
  .session-wrap
53
51
  display none
54
52
  position absolute
55
53
  overflow hidden
56
54
  z-index 3
57
55
  padding-top 36px
58
- box-shadow 0px 0px 1px 1px lighten(main, 20%)
56
+ box-shadow 0px 0px 1px 1px var(--main-darker)
59
57
  &.session-batch-active
60
58
  display block
61
59
 
62
60
  .web-session-wrap
63
61
  height 100vh
64
- background main
62
+ background var(--main)
65
63
  .session-v-wrap
66
- background main
64
+ background var(--main)
67
65
  overflow scroll
68
66
  z-index 99
69
67
  .vnc-session-wrap > div
@@ -76,8 +74,8 @@
76
74
  .sess-icon
77
75
  margin-right 10px
78
76
  &.active
79
- color warn
77
+ color var(--warn)
80
78
 
81
79
  .split-view-toggle
82
80
  &.active
83
- color success
81
+ color var(--success)
@@ -1,4 +1,4 @@
1
- @require '../../css/includes/theme-default'
1
+
2
2
  .item-list-wrap
3
3
  overflow-y scroll
4
4
  &::-webkit-scrollbar
@@ -22,13 +22,13 @@
22
22
  cursor pointer
23
23
  line-height 1.8
24
24
  &.active
25
- background primary
26
- color contrastColor(primary)
25
+ background var(--primary)
26
+ color var(--primary-contrast)
27
27
  &.current
28
28
  font-weight bold
29
29
  &:hover
30
- background darken(primary, 30%)
31
- color contrastColor(darken(primary, 30%))
30
+ background var(--primary)
31
+ color var(--primary-contrast)
32
32
  .list-item-apply
33
33
  .list-item-edit
34
34
  .list-item-remove
@@ -1,7 +1,3 @@
1
- @require '../../css/includes/theme-default'
2
-
3
- .setting-wrap
4
- color text
5
1
 
6
2
  body .ant-drawer .ant-drawer-content-wrapper
7
3
  left 43px
@@ -9,11 +5,10 @@ body .ant-drawer .ant-drawer-content-wrapper
9
5
  position absolute
10
6
  top 70px
11
7
  font-size 16px
12
- color text
13
8
  cursor pointer
14
9
  z-index 889
15
10
  &:hover
16
- color text
11
+ color var(--success)
17
12
  .alt-close-setting-wrap
18
13
  right 20px
19
14
  .close-setting-wrap
@@ -23,6 +23,9 @@ export default function TerminalBackgroundConfig ({
23
23
  isGlobal = false,
24
24
  batchUpdate
25
25
  }) {
26
+ if (!config) {
27
+ return null
28
+ }
26
29
  const [showTextModal, setShowTextModal] = useState(false)
27
30
  const value = config[name]
28
31
  const defaultValue = defaultSettings[name]
@@ -12,7 +12,6 @@ import Link from '../common/external-link'
12
12
  import dayjs from 'dayjs'
13
13
  import eq from 'fast-deep-equal'
14
14
  import { syncTokenCreateUrls, syncTypes } from '../../common/constants'
15
- import './sync.styl'
16
15
  import HelpIcon from '../common/help-icon'
17
16
  import ServerDataStatus from './server-data-status'
18
17
  import Password from '../common/password'
@@ -119,7 +119,7 @@ export default class FileSection extends React.Component {
119
119
 
120
120
  onCopy = (targetFiles, isCut) => {
121
121
  const { file } = this.state
122
- const selected = this.isSelected(file)
122
+ const selected = this.isSelected(file.id)
123
123
  const files = targetFiles ||
124
124
  (
125
125
  selected
@@ -138,7 +138,7 @@ export default class FileSection extends React.Component {
138
138
 
139
139
  onCopyPath = (targetFiles) => {
140
140
  const { file } = this.state
141
- const selected = this.isSelected(file)
141
+ const selected = this.isSelected(file.id)
142
142
  const files = targetFiles ||
143
143
  (
144
144
  selected
@@ -339,7 +339,7 @@ export default class FileSection extends React.Component {
339
339
  }
340
340
 
341
341
  transferDrop = (fromFiles, toFile, operation) => {
342
- const files = this.isSelected(fromFiles[0])
342
+ const files = this.isSelected(fromFiles[0]?.id)
343
343
  ? this.props.getSelectedFiles()
344
344
  : fromFiles
345
345
  return this.doTransferSelected(
@@ -351,8 +351,8 @@ export default class FileSection extends React.Component {
351
351
  )
352
352
  }
353
353
 
354
- isSelected = file => {
355
- return this.props.selectedFiles.has(file.id)
354
+ isSelected = (fileId = '') => {
355
+ return this.props.selectedFiles.has(fileId)
356
356
  }
357
357
 
358
358
  doRename = () => {
@@ -872,6 +872,9 @@ export default class FileSection extends React.Component {
872
872
  }
873
873
 
874
874
  handleContextMenuCapture = (e) => {
875
+ if (!this.isSelected(this.state.file.id)) {
876
+ this.onClick(e)
877
+ }
875
878
  this.contextMenuPosition = {
876
879
  clientY: e.clientY
877
880
  }
@@ -27,7 +27,7 @@ import fs from '../../common/fs'
27
27
  import ListTable from './list-table-ui'
28
28
  import deepCopy from 'json-deep-copy'
29
29
  import isValidPath from '../../common/is-valid-path'
30
-
30
+ import { LoadingOutlined } from '@ant-design/icons'
31
31
  import * as owner from './owner-list'
32
32
  import AddressBar from './address-bar'
33
33
  import getProxy from '../../common/get-proxy'
@@ -47,7 +47,8 @@ export default class Sftp extends Component {
47
47
  onEditFile: false,
48
48
  ...this.defaultState(),
49
49
  loadingSftp: false,
50
- inited: false
50
+ inited: false,
51
+ ready: false
51
52
  }
52
53
  this.retryCount = 0
53
54
  }
@@ -58,6 +59,11 @@ export default class Sftp extends Component {
58
59
  if (this.props.isFtp) {
59
60
  this.initFtpData()
60
61
  }
62
+ this.timer = setTimeout(() => {
63
+ this.setState({
64
+ ready: true
65
+ })
66
+ }, 100)
61
67
  }
62
68
 
63
69
  componentDidUpdate (prevProps, prevState) {
@@ -1261,10 +1267,18 @@ export default class Sftp extends Component {
1261
1267
  }
1262
1268
 
1263
1269
  render () {
1264
- const { height } = this.props
1265
1270
  const {
1266
- id
1271
+ id,
1272
+ ready
1267
1273
  } = this.state
1274
+ if (!ready) {
1275
+ return (
1276
+ <div className='pd3 aligncenter'>
1277
+ <LoadingOutlined />
1278
+ </div>
1279
+ )
1280
+ }
1281
+ const { height } = this.props
1268
1282
  const all = {
1269
1283
  className: 'sftp-wrap overhide relative',
1270
1284
  id: `id-${id}`,
@@ -1,5 +1,3 @@
1
- @require '../../css/includes/theme-default'
2
-
3
1
  .sftp-wrap
4
2
  display flex
5
3
  flex-direction row
@@ -17,15 +15,15 @@
17
15
  margin-bottom 4px
18
16
  &:nth-child(even)
19
17
  .sftp-file-prop
20
- background main
18
+ background var(--main)
21
19
  &:hover
22
20
  .sftp-file-prop
23
- background-color primary
24
- color contrastColor(primary)
21
+ background-color var(--primary)
22
+ color var(--primary-contrast)
25
23
  &.selected
26
24
  .sftp-file-prop
27
- background-color darken(primary, 30%)
28
- color contrastColor(primary)
25
+ background-color var(--primary)
26
+ color var(--primary-contrast)
29
27
  .sftp-history
30
28
  position absolute
31
29
  left 0
@@ -35,20 +33,21 @@
35
33
  box-shadow none
36
34
  border none
37
35
  height 0
38
- background main
36
+ background var(--main)
39
37
  overflow hidden
40
38
  border-radius 3px
41
39
  &.focused
42
40
  height auto
43
- border 1px solid main-dark
44
- box-shadow 0px 0px 3px 3px lighten(main, 5%)
41
+ border 1px solid var(--main-darker)
42
+ box-shadow 0px 0px 3px 3px var(--main-lighter)
45
43
 
46
44
  .sftp-history-item
47
45
  padding 5px 10px
48
46
  cursor pointer
49
- border-bottom 1px solid primary
47
+ border-bottom 1px solid var(--main-darker)
50
48
  &:hover
51
- background main-dark
49
+ background var(--primary)
50
+ color var(--primary-contrast)
52
51
 
53
52
  .sftp-item-title
54
53
  width 100%
@@ -57,11 +56,11 @@
57
56
  .sftp-item-size
58
57
  width 24%
59
58
  .sftp-status-success
60
- color success
59
+ color var(--success)
61
60
  .sftp-status-exception
62
- color error
61
+ color var(--error)
63
62
  .sftp-status-active
64
- color primary
63
+ color var(--primary)
65
64
 
66
65
  .virtual-file
67
66
  .sftp-item
@@ -87,10 +86,9 @@
87
86
  margin-left 70px
88
87
 
89
88
  .sftp-sort-btn
90
- color text
91
89
  &.active
92
90
  font-weight bold
93
- color text-light
91
+ color var(--text-light)
94
92
 
95
93
  //list table
96
94
  .sftp-file-prop
@@ -98,13 +96,13 @@
98
96
  height 32px
99
97
  line-height 30px
100
98
  padding 0 5px
101
- background main
99
+ background var(--main)
102
100
  overflow hidden
103
101
  white-space nowrap
104
102
  text-overflow ellipsis
105
103
  pointer-events none
106
104
  cursor default
107
- color text
105
+ color var(--text)
108
106
 
109
107
  .file-bg
110
108
  position absolute
@@ -118,11 +116,10 @@
118
116
  height 28px
119
117
  line-height 25px
120
118
  padding 0 5px
121
- background main
119
+ background var(--main)
122
120
  overflow hidden
123
121
  white-space nowrap
124
122
  text-overflow ellipsis
125
- color text
126
123
 
127
124
  .sftp-file-table-header
128
125
  height 30px
@@ -134,8 +131,8 @@
134
131
  .sftp-item
135
132
  &.sftp-dragover
136
133
  .sftp-file-prop
137
- background primary !important
138
- color text-light !important
134
+ background var(--primary) !important
135
+ color var(--text) !important
139
136
  &.sftp-dragover-multi
140
137
  &:after
141
138
  &:before
@@ -144,7 +141,7 @@
144
141
  top 2px
145
142
  width 100%
146
143
  height 100%
147
- background main-light
144
+ background var(--main-lighter)
148
145
  content ''
149
146
  z-index -1
150
147
  &:after
@@ -158,12 +155,11 @@
158
155
 
159
156
  //sftp
160
157
  .sftp-panel
161
- background main
162
- color text
158
+ background var(--main)
163
159
 
164
160
  .file-list
165
161
  ::-webkit-scrollbar-thumb
166
- background-color primary !important
162
+ background-color var(--primary) !important
167
163
 
168
164
  .pager-wrap
169
165
  z-index 4
@@ -175,4 +171,4 @@
175
171
  .keyword-filter-icon
176
172
  &:hover
177
173
  &.active
178
- color success
174
+ color var(--success)
@@ -1,11 +1,9 @@
1
- @require '../../css/includes/theme-default'
2
1
  .transfer-tag
3
- color text
4
2
  border-radius 2px
5
3
  padding 0 2px
6
4
  .transfer-status-init
7
- color primary
5
+ color var(--primary)
8
6
  .transfer-status-started
9
- color success
7
+ color var(--success)
10
8
  .transfer-status-error
11
- color error
9
+ color var(--error)
@@ -1,14 +1,12 @@
1
- @require '../../css/includes/theme-default'
2
-
3
1
  .right-side-panel
4
2
  position absolute
5
3
  right 0
6
4
  top 36px
7
5
  bottom 0
8
6
  z-index 200
9
- background main
10
- color text-light
11
- border-left 1px solid darken(main, 30%)
7
+ background var(--main)
8
+ color var(--text)
9
+ border-left 1px solid var(--main-darker)
12
10
  &.right-side-panel-pinned
13
11
  top 0
14
12
 
@@ -17,16 +15,16 @@
17
15
  right auto
18
16
  display block
19
17
  .right-panel-title
20
- border-bottom 1px solid darken(main, 30%)
18
+ border-bottom 1px solid var(--main-darker)
21
19
  .right-side-panel-controls
22
- color text-dark
20
+ color var(--text)
23
21
  font-size 16px
24
22
  &:hover
25
- color text
23
+ color var(--success)
26
24
  cursor pointer
27
25
  &.right-side-panel-pin
28
26
  &.pinned
29
- color success
27
+ color var(--success)
30
28
  .right-side-panel-content
31
29
  padding 10px
32
30
  overflow-y scroll
@@ -20,6 +20,7 @@ import {
20
20
  } from '../../common/constants'
21
21
  import SideIcon from './side-icon'
22
22
  import SidePanel from './side-panel'
23
+ import hasActiveInput from '../../common/has-active-input'
23
24
  import './sidebar.styl'
24
25
 
25
26
  const e = window.translate
@@ -50,6 +51,11 @@ export default memo(function Sidebar (props) {
50
51
  if (pinned) {
51
52
  return false
52
53
  }
54
+
55
+ if (hasActiveInput()) {
56
+ return false
57
+ }
58
+
53
59
  handler.current = setTimeout(
54
60
  () => store.setOpenedSideBar(''),
55
61
  400
@@ -1,4 +1,3 @@
1
- @require '../../css/includes/theme-default'
2
1
 
3
2
  // from https://freefrontend.com/css-border-animations/
4
3
  .morph-shape
@@ -7,17 +6,6 @@
7
6
  transition all 1s ease-in-out
8
7
  z-index 5
9
8
 
10
- // @keyframes morph
11
- // 0%
12
- // border-radius 60% 40% 30% 70% / 60% 30% 70% 40%
13
- // background linear-gradient(45deg, primary 0%, success 100%)
14
- // 50%
15
- // border-radius 30% 60% 70% 40% / 50% 60% 30% 60%
16
- // background linear-gradient(45deg, main 0%, success 100%)
17
-
18
- // 100%
19
- // border-radius 60% 40% 30% 70% / 60% 30% 70% 40%
20
- // background linear-gradient(45deg, primary 0%, success 100%)
21
9
  .info-modal
22
10
  .ant-modal-header
23
11
  border none
@@ -1,4 +1,4 @@
1
- @require '../../css/includes/theme-default'
1
+
2
2
  .animate-fast
3
3
  animation-duration .2s
4
4
  .sidebar-panel
@@ -9,8 +9,7 @@
9
9
  z-index 200
10
10
  width 0
11
11
  overflow-y scroll
12
- background main
13
- color text
12
+ background var(--main)
14
13
  .item-list-unit:hover
15
14
  .list-item-remove
16
15
  display none !important
@@ -22,7 +21,7 @@
22
21
  width 36px
23
22
  z-index 100
24
23
  bottom 0
25
- background main-dark
24
+ background var(--main-dark)
26
25
 
27
26
  .item-list
28
27
  padding-right 0
@@ -52,20 +51,20 @@
52
51
  .history-panel
53
52
  width 100%
54
53
  .control-icon-text
55
- color text
54
+ color var(--text)
56
55
  &:hover
57
- color text-light
56
+ color var(--success)
58
57
  .control-icon-wrap
59
58
  padding 14px 0
60
59
  text-align center
61
60
  &.active
62
61
  .control-icon
63
- color text-light
62
+ color var(--text-light)
64
63
  .control-icon
65
- color text-dark
64
+ color var(--text-dark)
66
65
  cursor pointer
67
66
  &:hover
68
- color text-light
67
+ color var(--text-light)
69
68
  .sidebar-list
70
69
  position absolute
71
70
  left 43px
@@ -84,22 +83,22 @@
84
83
  display block
85
84
  .sidebar-panel
86
85
  .pinned
87
- color success
86
+ color var(--success)
88
87
  //btns
89
88
  .btns
90
- background main-dark
91
- border-color primary
89
+ background var(--main-dark)
90
+ border-color var(--primary)
92
91
  .open-about-icon
93
- color text-dark
92
+ color var(--text-dark)
94
93
  &:hover
95
- color text-light
94
+ color var(--text-light)
96
95
 
97
96
  .btns .upgrade-icon
98
- color success
97
+ color var(--success)
99
98
  .close-info-modal
100
99
  cursor pointer
101
100
  &:hover
102
- color text-light
101
+ color var(--text-light)
103
102
  .logo-filter
104
103
  filter invert(80%)
105
104
  .sidebar-inner
@@ -1,5 +1,5 @@
1
1
  import { PureComponent } from 'react'
2
- import { createTitleWithTag } from '../../common/create-title'
2
+ import createTitle from '../../common/create-title'
3
3
 
4
4
  export default class TabsSubMenuChild extends PureComponent {
5
5
  handleClick = () => {
@@ -8,7 +8,7 @@ export default class TabsSubMenuChild extends PureComponent {
8
8
 
9
9
  render () {
10
10
  const { item } = this.props
11
- const title = createTitleWithTag(item)
11
+ const title = createTitle(item)
12
12
  return (
13
13
  <div
14
14
  className='sub-context-menu-item'
@@ -1,4 +1,3 @@
1
- @require '../../css/includes/theme-default'
2
1
  .context-menu
3
2
  position: relative
4
3
  width 280px
@@ -6,7 +5,6 @@
6
5
  .context-item
7
6
  -webkit-app-region no-drag
8
7
  position relative
9
- color text
10
8
  height 28px
11
9
  line-height 28px
12
10
  padding 0 16px
@@ -15,7 +13,7 @@
15
13
  color #eee
16
14
  cursor pointer
17
15
  &.disabled
18
- color lighten(text, 15%)
16
+ color var(--text-disabled)
19
17
  &:hover
20
18
  color #777
21
19
  background #333
@@ -30,30 +28,32 @@
30
28
  position absolute
31
29
  right 16px
32
30
  top 0
33
- color lighten(text, 20%)
31
+ color var(--text-light)
34
32
 
35
33
  .context-menu
36
34
  hr
37
35
  margin 0
38
36
  border none
39
- border-bottom 1px solid main-light
37
+ border-bottom 1px solid var(--main-darker)
40
38
  .sub-context-menu
41
39
  display none
42
40
  width 200px
43
41
  position absolute
44
42
  left 100%
45
43
  top 0
46
- background main
47
- box-shadow 0px 0px 3px 3px lighten(main, 35%)
44
+ background var(--main)
45
+ box-shadow 0px 0px 3px 3px var(--main-darker)
48
46
  max-height 300px
49
47
  overflow-y scroll
48
+ color var(--text)
50
49
  .with-sub-menu
51
50
  &:hover
52
51
  .sub-context-menu
53
52
  display block
53
+
54
54
  .sub-context-menu-item
55
55
  cursor pointer
56
- padding 10px 16px
56
+ padding 5px 16px
57
57
  overflow hidden
58
58
  white-space nowrap
59
59
  text-overflow ellipsis
@@ -68,17 +68,17 @@
68
68
  width 28px
69
69
  height 28px
70
70
  border-radius 30px
71
- color lighten(text, 20%)
71
+ color var(--text-light)
72
72
  font-size 16px
73
73
  text-align center
74
74
  display inline-block
75
75
  line-height 28px
76
76
  cursor pointer
77
77
  &:hover
78
- color text
78
+ color var(--text)
79
79
  .is-main
80
80
  .menu-control
81
81
  img
82
- border 1px solid text-dark
82
+ border 1px solid var(--text-dark)
83
83
  border-radius 28px
84
84
  background #000