@electerm/electerm-react 2.3.58 → 2.3.75

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.
@@ -239,6 +239,7 @@ export const regexHelpLink = 'https://github.com/electerm/electerm/wiki/Terminal
239
239
  export const connectionHoppingWikiLink = 'https://github.com/electerm/electerm/wiki/Connection-Hopping-Behavior-Change-in-electerm-since-v1.50.65'
240
240
  export const aiConfigWikiLink = 'https://github.com/electerm/electerm/wiki/AI-model-config-guide'
241
241
  export const rdpWikiLink = 'https://github.com/electerm/electerm/wiki/RDP-session-known-issues'
242
+ export const vncWikiLink = 'https://github.com/electerm/electerm/wiki/VNC-session-known-issues'
242
243
  export const modals = {
243
244
  hide: 0,
244
245
  setting: 1,
@@ -2,9 +2,5 @@ export default [
2
2
  {
3
3
  name: 'homepage',
4
4
  url: 'https://electerm.html5beta.com'
5
- },
6
- {
7
- name: 'github',
8
- url: 'https://github.com/electerm/electerm/releases'
9
5
  }
10
6
  ]
@@ -20,7 +20,11 @@ import SshHostSelector from './ssh-host-selector.jsx'
20
20
  import SshAuthTypeSelector from './ssh-auth-type-selector.jsx'
21
21
  import SshAuthSelector from './ssh-auth-selector.jsx'
22
22
  import CategorySelect from './category-select.jsx'
23
- import RdpAlert from './rdp-alert.jsx'
23
+ import WikiAlert from './wiki-alert.jsx'
24
+ import {
25
+ rdpWikiLink,
26
+ vncWikiLink
27
+ } from '../../../common/constants.js'
24
28
 
25
29
  const Fragment = React.Fragment
26
30
  const FormItem = Form.Item
@@ -122,7 +126,9 @@ export function renderFormItem (item, formItemLayout, form, ctxProps, index) {
122
126
  case 'warning':
123
127
  return <Alert key={name} type='warning' {...item.props} />
124
128
  case 'rdpWarning':
125
- return <RdpAlert key={name} />
129
+ return <WikiAlert key={name} wikiUrl={rdpWikiLink} />
130
+ case 'vncWarning':
131
+ return <WikiAlert key={name} wikiUrl={vncWikiLink} />
126
132
  case 'categorySelect':
127
133
  return (
128
134
  <CategorySelect
@@ -0,0 +1,9 @@
1
+ import Link from '../../common/external-link'
2
+
3
+ export default function WikiAlert ({ wikiUrl }) {
4
+ return (
5
+ <div className='alignright bold pd2'>
6
+ <Link to={wikiUrl}>WIKI: {wikiUrl}</Link>
7
+ </div>
8
+ )
9
+ }
@@ -24,6 +24,7 @@ const vncConfig = {
24
24
  key: 'auth',
25
25
  label: e('auth'),
26
26
  fields: [
27
+ { type: 'vncWarning', name: 'vncWarning' },
27
28
  commonFields.category,
28
29
  commonFields.colorTitle,
29
30
  { type: 'input', name: 'host', label: e('host'), rules: [{ required: true, message: e('host') + ' required' }] },
@@ -66,7 +66,11 @@ export default class BookmarkIndex2 extends PureComponent {
66
66
  >
67
67
  {keys.map(v => {
68
68
  const txt = v === 'ssh' ? 'Ssh/Sftp' : e(v)
69
- return (<Radio.Button key={v} value={v}>{txt}</Radio.Button>)
69
+ let sup = null
70
+ if (v === connectionMap.vnc || v === connectionMap.rdp) {
71
+ sup = <sup className='color-red'>Beta</sup>
72
+ }
73
+ return (<Radio.Button key={v} value={v}>{txt}{sup}</Radio.Button>)
70
74
  })}
71
75
  </Radio.Group>
72
76
  )
@@ -1,6 +1,8 @@
1
- import { useEffect } from 'react'
1
+ import { useEffect, useRef } from 'react'
2
2
 
3
3
  export default function AppDrag (props) {
4
+ const isDraggingRef = useRef(false)
5
+
4
6
  function canOperate (e) {
5
7
  const {
6
8
  target
@@ -20,12 +22,16 @@ export default function AppDrag (props) {
20
22
  function onMouseDown (e) {
21
23
  // e.stopPropagation()
22
24
  if (canOperate(e)) {
25
+ isDraggingRef.current = true
23
26
  window.pre.runSync('windowMove', true)
24
27
  }
25
28
  }
26
29
 
27
30
  function onMouseUp (e) {
28
- window.pre.runSync('windowMove', false)
31
+ if (isDraggingRef.current) {
32
+ isDraggingRef.current = false
33
+ window.pre.runSync('windowMove', false)
34
+ }
29
35
  }
30
36
 
31
37
  function onDoubleClick (e) {
@@ -44,7 +50,14 @@ export default function AppDrag (props) {
44
50
  }
45
51
 
46
52
  useEffect(() => {
53
+ // Listen for mouseup at document level to catch mouseup outside window
54
+ document.addEventListener('mouseup', onMouseUp)
47
55
  window.addEventListener('contextmenu', onMouseUp)
56
+
57
+ return () => {
58
+ document.removeEventListener('mouseup', onMouseUp)
59
+ window.removeEventListener('contextmenu', onMouseUp)
60
+ }
48
61
  }, [])
49
62
  return (
50
63
  <div
@@ -67,45 +67,7 @@ for $i, $index in 5 16 32
67
67
  display inline-block
68
68
  vertical-align middle
69
69
 
70
- .ibblock
71
- display inline-block
72
- vertical-align baseline
73
-
74
- .itblock
75
- display inline-block
76
- vertical-align top
77
-
78
- .border
79
- border 1px solid #e4e4e4
80
-
81
- .borderl
82
- border-left 1px solid #e4e4e4
83
-
84
- .borderr
85
- border-right 1px solid #e4e4e4
86
-
87
- .borderb
88
- border-bottom 1px solid #e4e4e4
89
- &.dashed
90
- border-bottom 1px dashed #e4e4e4
91
-
92
- .bordert
93
- border-top 1px solid #e4e4e4
94
-
95
- .borderr
96
- border-right 1px solid #e4e4e4
97
-
98
- .borderl
99
- border-left 1px solid #e4e4e4
100
-
101
- .border-dashed
102
- border-style dashed
103
- .border-dotted
104
- border-style dotted
105
-
106
- .hide,
107
- .hide1,
108
- .hide2
70
+ .hide
109
71
  display none
110
72
 
111
73
  .hidden
@@ -128,7 +90,7 @@ for $i, $index in 5 16 32
128
90
  .fix
129
91
  &:after
130
92
  clear both
131
-
93
+
132
94
  .overhide
133
95
  overflow hidden
134
96
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electerm/electerm-react",
3
- "version": "2.3.58",
3
+ "version": "2.3.75",
4
4
  "description": "react components src for electerm",
5
5
  "main": "./client/components/main/main.jsx",
6
6
  "license": "MIT",
@@ -1,13 +0,0 @@
1
- import { Alert } from 'antd'
2
- import { rdpWikiLink } from '../../../common/constants'
3
- import Link from '../../common/external-link'
4
-
5
- export default function RdpAlert () {
6
- return (
7
- <Alert
8
- message={<Link to={rdpWikiLink}>WIKI: {rdpWikiLink}</Link>}
9
- type='warning'
10
- className='mg2y'
11
- />
12
- )
13
- }