@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.
- package/client/components/setting-panel/setting-common.jsx +3 -1
- package/client/components/shortcuts/shortcut-control.jsx +10 -0
- package/client/components/shortcuts/shortcuts-defaults.js +5 -0
- package/client/components/tabs/add-btn-menu.jsx +0 -2
- package/client/components/tabs/add-btn.jsx +16 -1
- package/client/components/vnc/vnc-session.jsx +0 -1
- package/package.json +1 -1
|
@@ -676,7 +676,9 @@ export default class SettingCommon extends Component {
|
|
|
676
676
|
'debug'
|
|
677
677
|
].map(this.renderToggle)
|
|
678
678
|
}
|
|
679
|
-
|
|
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') ||
|
|
@@ -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
|
}
|