@electerm/electerm-react 2.11.16 → 2.12.0

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.
@@ -32,6 +32,7 @@ export default {
32
32
  enableSixel: true,
33
33
  terminalType: 'xterm-256color',
34
34
  keepaliveCountMax: 10,
35
+ keyword2FA: 'verification code,otp,one-time,two-factor,2fa,totp,authenticator,duo,yubikey,security code,mfa,passcode',
35
36
  saveTerminalLogToFile: false,
36
37
  checkUpdateOnStart: true,
37
38
  cursorBlink: false,
@@ -584,6 +584,10 @@ export default class SettingCommon extends Component {
584
584
  {
585
585
  this.renderTextExec('execLinux')
586
586
  }
587
+ <div className='pd1b'>{e('keyword2FA')}</div>
588
+ {
589
+ this.renderText('keyword2FA')
590
+ }
587
591
  {
588
592
  [
589
593
  'autoRefreshWhenSwitchToSftp',
@@ -302,7 +302,7 @@ export default class Sftp extends Component {
302
302
  }, () => this[`${type}List`]())
303
303
  }
304
304
 
305
- updateCwd = (cwd) => {
305
+ updateCwd = (cwd = this.props.cwd) => {
306
306
  if (!this.state.inited) {
307
307
  return
308
308
  }
@@ -219,6 +219,27 @@ class ShortcutControl extends React.PureComponent {
219
219
  }
220
220
  }, 1000)
221
221
 
222
+ clickSftpIcon = () => {
223
+ const icon = document.querySelector('.session-current .sftp-follow-ssh-icon')
224
+ if (!icon) return
225
+ icon.click()
226
+ }
227
+
228
+ syncSftpPathShortcut = throttle((e) => {
229
+ e.stopPropagation()
230
+ const { activeTabId } = window.store
231
+ if (!activeTabId) return
232
+ // Get the SFTP component which can sync the path
233
+ const sftp = refs.get('sftp-' + activeTabId)
234
+ if (!sftp) return
235
+ this.clickSftpIcon()
236
+ // Wait for the path to be synced
237
+ setTimeout(() => {
238
+ this.clickSftpIcon()
239
+ sftp.updateCwd()
240
+ }, 100)
241
+ }, 1000)
242
+
222
243
  render () {
223
244
  return null
224
245
  }
@@ -115,6 +115,11 @@ export default () => {
115
115
  name: 'terminal_zoomoutTerminal',
116
116
  shortcut: 'ctrl+▼',
117
117
  shortcutMac: 'meta+▼'
118
+ },
119
+ {
120
+ name: 'terminal_syncSftpPath',
121
+ shortcut: 'alt+shift+f11',
122
+ shortcutMac: 'alt+shift+f11'
118
123
  }
119
124
  ]
120
125
  }
@@ -1097,6 +1097,7 @@ class Term extends Component {
1097
1097
  'execWindowsArgs',
1098
1098
  'execMacArgs',
1099
1099
  'execLinuxArgs',
1100
+ 'keyword2FA',
1100
1101
  'debug'
1101
1102
  ]),
1102
1103
  keepaliveInterval: tab.keepaliveInterval || config.keepaliveInterval,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electerm/electerm-react",
3
- "version": "2.11.16",
3
+ "version": "2.12.0",
4
4
  "description": "react components src for electerm",
5
5
  "main": "./client/components/main/main.jsx",
6
6
  "license": "MIT",