@electerm/electerm-react 3.8.8 → 3.9.5

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 (33) hide show
  1. package/client/common/parse-quick-connect.js +9 -1
  2. package/client/common/pre.js +0 -1
  3. package/client/components/ai/ai-config-modal.jsx +52 -0
  4. package/client/components/ai/ai-config.jsx +5 -38
  5. package/client/components/ai/get-brand.js +0 -11
  6. package/client/components/bg/custom-css.jsx +2 -1
  7. package/client/components/bookmark-form/bookmark-from-history-modal.jsx +0 -1
  8. package/client/components/bookmark-form/config/rdp.js +4 -2
  9. package/client/components/icons/heartbeat.jsx +23 -0
  10. package/client/components/main/main.jsx +5 -1
  11. package/client/components/session/session.jsx +3 -3
  12. package/client/components/setting-sync/setting-sync-form.jsx +9 -1
  13. package/client/components/setting-sync/setting-sync.jsx +2 -1
  14. package/client/components/sftp/list-table-ui.jsx +29 -54
  15. package/client/components/sftp/paged-list.jsx +44 -44
  16. package/client/components/sftp/sftp-entry.jsx +5 -4
  17. package/client/components/sidebar/info-modal.jsx +8 -2
  18. package/client/components/terminal/reconnect-overlay.jsx +2 -15
  19. package/client/components/terminal/terminal-error-handle.jsx +43 -0
  20. package/client/components/terminal/terminal.jsx +38 -38
  21. package/client/components/terminal/terminal.styl +12 -7
  22. package/client/components/terminal/unix-timestamp-tooltip.jsx +85 -0
  23. package/client/components/tree-list/bookmark-toolbar.jsx +9 -71
  24. package/client/components/tree-list/bookmark-upload.js +106 -0
  25. package/client/components/widgets/widget-control.jsx +1 -0
  26. package/client/store/common.js +3 -11
  27. package/client/store/init-state.js +1 -0
  28. package/client/store/load-data.js +2 -2
  29. package/client/store/sync.js +3 -2
  30. package/client/store/tab.js +20 -0
  31. package/package.json +1 -1
  32. package/client/components/ai/providers.js +0 -14
  33. package/client/components/terminal/socket-close-warning.jsx +0 -94
@@ -362,6 +362,26 @@ export default Store => {
362
362
  store.updateHistory(newTab)
363
363
  }
364
364
 
365
+ // Dangerous props that should not be accepted from IPC
366
+ const dangerousTabProps = [
367
+ 'execLinux',
368
+ 'execMac',
369
+ 'execWindows',
370
+ 'execWindowsArgs',
371
+ 'execMacArgs',
372
+ 'execLinuxArgs',
373
+ 'setEnv',
374
+ 'runScripts',
375
+ 'interactiveValues'
376
+ ]
377
+
378
+ Store.prototype.ipcOpenTab = function (parsed) {
379
+ const safeTab = Object.fromEntries(
380
+ Object.entries(parsed).filter(([key]) => !dangerousTabProps.includes(key))
381
+ )
382
+ return window.store.addTab(safeTab)
383
+ }
384
+
365
385
  Store.prototype.clickNextTab = debounce(function () {
366
386
  window.store.clickBioTab(1)
367
387
  }, 100)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electerm/electerm-react",
3
- "version": "3.8.8",
3
+ "version": "3.9.5",
4
4
  "description": "react components src for electerm",
5
5
  "main": "./client/components/main/main.jsx",
6
6
  "license": "MIT",
@@ -1,14 +0,0 @@
1
- export default [
2
- {
3
- label: 'OpenAI',
4
- baseURL: 'https://api.openai.com/v1',
5
- homepage: 'https://openai.com',
6
- models: ['gpt-4', 'gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-4.5']
7
- },
8
- {
9
- label: 'DeepSeek',
10
- baseURL: 'https://api.deepseek.com/v1',
11
- homepage: 'https://deepseek.com',
12
- models: ['deepseek-chat', 'deepseek-coder', 'deepseek-reasoner']
13
- }
14
- ]
@@ -1,94 +0,0 @@
1
- import { useState, useEffect, useRef } from 'react'
2
- import { Button } from 'antd'
3
- import { ReloadOutlined } from '@ant-design/icons'
4
- import { notification } from '../common/notification'
5
-
6
- const e = window.translate
7
- const COUNTDOWN_SECONDS = 3
8
-
9
- export function showSocketCloseWarning ({
10
- tabId,
11
- tab,
12
- autoReconnect,
13
- delTab,
14
- reloadTab
15
- }) {
16
- const key = `open${Date.now()}`
17
-
18
- function closeNotification () {
19
- notification.destroy(key)
20
- }
21
-
22
- const descriptionNode = (
23
- <SocketCloseDescription
24
- autoReconnect={autoReconnect}
25
- onClose={() => {
26
- closeNotification()
27
- delTab(tabId)
28
- }}
29
- onReload={() => {
30
- closeNotification()
31
- reloadTab({ ...tab, autoReConnect: (tab.autoReConnect || 0) + 1 })
32
- }}
33
- />
34
- )
35
-
36
- notification.warning({
37
- key,
38
- message: e('socketCloseTip'),
39
- duration: autoReconnect ? COUNTDOWN_SECONDS + 2 : 30,
40
- description: descriptionNode
41
- })
42
-
43
- return { key }
44
- }
45
-
46
- function SocketCloseDescription ({ autoReconnect, onClose, onReload }) {
47
- const [countdown, setCountdown] = useState(COUNTDOWN_SECONDS)
48
- const timerRef = useRef(null)
49
-
50
- useEffect(() => {
51
- if (!autoReconnect) {
52
- return
53
- }
54
- timerRef.current = setInterval(() => {
55
- setCountdown(prev => {
56
- if (prev <= 1) {
57
- clearInterval(timerRef.current)
58
- onReload()
59
- return 0
60
- }
61
- return prev - 1
62
- })
63
- }, 1000)
64
-
65
- return () => {
66
- if (timerRef.current) {
67
- clearInterval(timerRef.current)
68
- }
69
- }
70
- }, [autoReconnect])
71
-
72
- return (
73
- <div className='pd2y'>
74
- {autoReconnect && (
75
- <div className='pd1b'>
76
- {e('autoReconnectTerminal')}: {countdown}s
77
- </div>
78
- )}
79
- <Button
80
- className='mg1r'
81
- type='primary'
82
- onClick={onClose}
83
- >
84
- {e('close')}
85
- </Button>
86
- <Button
87
- icon={<ReloadOutlined />}
88
- onClick={onReload}
89
- >
90
- {e('reload')}
91
- </Button>
92
- </div>
93
- )
94
- }