@electerm/electerm-react 2.3.113 → 2.3.118

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.
@@ -676,7 +676,9 @@ export default class SettingCommon extends Component {
676
676
  'debug'
677
677
  ].map(this.renderToggle)
678
678
  }
679
- <DeepLinkControl />
679
+ {
680
+ window.et.isWebApp ? null : <DeepLinkControl />
681
+ }
680
682
  {this.renderLoginPass()}
681
683
  {this.renderReset()}
682
684
  </div>
@@ -167,6 +167,16 @@ class ShortcutControl extends React.PureComponent {
167
167
  window.store.onNewSsh()
168
168
  }, 500)
169
169
 
170
+ toggleAddBtnShortcut = throttle((e) => {
171
+ e.stopPropagation()
172
+ const { currentLayoutBatch } = window.store
173
+ // Find the add button for the active layout (batch)
174
+ const addBtnElement = document.querySelector(`.v${currentLayoutBatch + 1} .tabs-add-btn`)
175
+ if (addBtnElement) {
176
+ addBtnElement.click()
177
+ }
178
+ }, 500)
179
+
170
180
  togglefullscreenShortcut = throttle((e) => {
171
181
  e.stopPropagation()
172
182
  const x = document.querySelector('.term-fullscreen-control') ||
@@ -31,6 +31,11 @@ export default () => {
31
31
  shortcut: 'ctrl+n',
32
32
  shortcutMac: 'meta+n'
33
33
  },
34
+ {
35
+ name: 'app_toggleAddBtn',
36
+ shortcut: 'alt+n',
37
+ shortcutMac: 'alt+n'
38
+ },
34
39
  {
35
40
  name: 'app_togglefullscreen',
36
41
  shortcut: 'alt+f',
@@ -57,8 +57,6 @@ export default function AddBtnMenu ({
57
57
  left: menuPosition === 'right'
58
58
  }
59
59
 
60
- console.log('render add btn menu', dragProps)
61
-
62
60
  return (
63
61
  <div
64
62
  ref={menuRef}
@@ -46,6 +46,10 @@ export default class AddBtn extends Component {
46
46
  document.body.removeChild(this.portalContainer)
47
47
  this.portalContainer = null
48
48
  }
49
+ // Clear focus timeout
50
+ if (this.çƒ) {
51
+ clearTimeout(this.focusTimeout)
52
+ }
49
53
  }
50
54
 
51
55
  componentDidUpdate (prevProps, prevState) {
@@ -111,6 +115,17 @@ export default class AddBtn extends Component {
111
115
  )
112
116
  }
113
117
 
118
+ focusSearchInput = () => {
119
+ // Focus the search input after the menu renders
120
+ this.focusTimeout = setTimeout(() => {
121
+ const searchInput = this.menuRef.current?.querySelector('.ant-input')
122
+ if (searchInput) {
123
+ searchInput.focus()
124
+ searchInput.select()
125
+ }
126
+ }, 500)
127
+ }
128
+
114
129
  handleAddBtnClick = () => {
115
130
  if (this.state.open) {
116
131
  this.setState({ open: false })
@@ -157,7 +172,7 @@ export default class AddBtn extends Component {
157
172
  menuPosition,
158
173
  menuTop,
159
174
  menuLeft
160
- })
175
+ }, this.focusSearchInput)
161
176
 
162
177
  window.openTabBatch = this.props.batch
163
178
  }
@@ -83,7 +83,6 @@ export default class VncSession extends RdpSession {
83
83
  username,
84
84
  password
85
85
  } = tab
86
- console.log('vnc tab', tab)
87
86
  const opts = clone({
88
87
  term: terminalType || config.terminalType,
89
88
  tabId: id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electerm/electerm-react",
3
- "version": "2.3.113",
3
+ "version": "2.3.118",
4
4
  "description": "react components src for electerm",
5
5
  "main": "./client/components/main/main.jsx",
6
6
  "license": "MIT",