@electerm/electerm-react 1.91.1 → 1.91.8

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.
@@ -63,6 +63,7 @@ export default {
63
63
  modelAI: 'deepseek-chat',
64
64
  roleAI: '终端专家,提供不同系统下命令,简要解释用法,用markdown格式',
65
65
  apiPathAI: '/chat/completions',
66
+ proxyAI: '',
66
67
  sessionLogPath: '',
67
68
  sshSftpSplitView: false,
68
69
  showCmdSuggestions: false,
@@ -46,7 +46,8 @@ export default function AIChat (props) {
46
46
  buildRole(),
47
47
  props.config.baseURLAI,
48
48
  props.config.apiPathAI,
49
- props.config.apiKeyAI
49
+ props.config.apiKeyAI,
50
+ props.config.proxyAI
50
51
  ).catch(
51
52
  window.store.onError
52
53
  )
@@ -3,5 +3,7 @@ export const aiConfigsArr = [
3
3
  'modelAI',
4
4
  'roleAI',
5
5
  'apiKeyAI',
6
- 'apiPathAI'
6
+ 'apiPathAI',
7
+ 'languageAI',
8
+ 'proxyAI'
7
9
  ]
@@ -26,6 +26,12 @@ const defaultRoles = [
26
26
  }
27
27
  ]
28
28
 
29
+ const proxyOptions = [
30
+ { value: 'socks5://127.0.0.1:1080' },
31
+ { value: 'http://127.0.0.1:8080' },
32
+ { value: 'https://proxy.example.com:3128' }
33
+ ]
34
+
29
35
  export default function AIConfigForm ({ initialValues, onSubmit, showAIConfig }) {
30
36
  const [form] = Form.useForm()
31
37
  const [modelOptions, setModelOptions] = useState([])
@@ -171,6 +177,21 @@ export default function AIConfigForm ({ initialValues, onSubmit, showAIConfig })
171
177
  </AutoComplete>
172
178
  </Form.Item>
173
179
 
180
+ <Form.Item
181
+ label={e('proxy')}
182
+ name='proxyAI'
183
+ tooltip='Proxy for AI API requests (e.g., socks5://127.0.0.1:1080)'
184
+ >
185
+ <AutoComplete
186
+ options={proxyOptions}
187
+ placeholder='Enter proxy URL (optional)'
188
+ filterOption={filter}
189
+ allowClear
190
+ >
191
+ <Input />
192
+ </AutoComplete>
193
+ </Form.Item>
194
+
174
195
  <Form.Item>
175
196
  <Button type='primary' htmlType='submit'>
176
197
  {e('save')}
@@ -21,7 +21,8 @@ function buildTreeData (bookmarkGroups, tree) {
21
21
  const y = {
22
22
  key: x.id,
23
23
  value: x.id,
24
- title: x.title
24
+ title: x.title,
25
+ selectable: false // Make categories non-selectable
25
26
  }
26
27
  y.children = [
27
28
  ...(x.bookmarkGroupIds || []).map(buildSubCats),
@@ -49,6 +50,7 @@ function buildTreeData (bookmarkGroups, tree) {
49
50
  title: d.title,
50
51
  value: d.id,
51
52
  key: d.id,
53
+ selectable: false, // Make categories non-selectable
52
54
  children: [
53
55
  ...(d.bookmarkGroupIds || []).map(buildSubCats),
54
56
  ...(d.bookmarkIds || []).map(buildLeaf)
@@ -82,13 +84,26 @@ export default function BookmarkSelect (props) {
82
84
  props.onSelect(item)
83
85
  }
84
86
  }
87
+
88
+ // Custom filter function to only match leaf nodes
89
+ function filterTreeNode (inputValue, treeNode) {
90
+ // Skip filtering for category nodes
91
+ if (treeNode.selectable === false) {
92
+ return false
93
+ }
94
+
95
+ // Match against searchText which includes both title and host
96
+ return treeNode.title && treeNode.title.toLowerCase().includes(inputValue.toLowerCase())
97
+ }
98
+
85
99
  const treeData = buildTreeData(bookmarkGroups, tree)
86
100
  const treeProps = {
87
101
  treeData,
88
102
  onChange: onSelect,
89
103
  placeholder: e('chooseFromBookmarks'),
90
104
  showSearch: true,
91
- value: undefined
105
+ value: undefined,
106
+ filterTreeNode
92
107
  }
93
108
  return (
94
109
  <TreeSelect {...treeProps} />
@@ -27,10 +27,6 @@ class MenuBtn extends PureComponent {
27
27
  window.store.addTab()
28
28
  }
29
29
 
30
- onNewWindow = () => {
31
- window.store.onNewWindow()
32
- }
33
-
34
30
  openAbout = () => {
35
31
  window.store.openAbout()
36
32
  }
@@ -80,11 +76,6 @@ class MenuBtn extends PureComponent {
80
76
  icon: 'RightSquareFilled',
81
77
  text: e('newTab')
82
78
  },
83
- {
84
- func: 'onNewWindow',
85
- icon: 'WindowsOutlined',
86
- text: e('newWindow')
87
- },
88
79
  // {
89
80
  // type: 'hr'
90
81
  // },
@@ -314,7 +314,7 @@ export default Store => {
314
314
  }
315
315
 
316
316
  Store.prototype.aiConfigMissing = function () {
317
- return aiConfigsArr.some(k => !window.store.config[k])
317
+ return aiConfigsArr.slice(0, -1).some(k => !window.store.config[k])
318
318
  }
319
319
 
320
320
  Store.prototype.addCmdHistory = action(function (cmd) {
@@ -512,7 +512,9 @@ export default (Store) => {
512
512
  'dataSyncSelected',
513
513
  'baseURLAI',
514
514
  'modelAI',
515
- 'roleAI'
515
+ 'roleAI',
516
+ 'languageAI',
517
+ 'proxyAI'
516
518
  ]
517
519
  return pick(store.config, configSyncKeys)
518
520
  }
@@ -61,10 +61,6 @@ export default Store => {
61
61
  store.openSettingModal()
62
62
  }
63
63
 
64
- Store.prototype.onNewWindow = async function () {
65
- window.pre.runGlobalAsync('openNewInstance')
66
- }
67
-
68
64
  Store.prototype.confirmExit = function (type) {
69
65
  const { store } = window
70
66
  let mod = null
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@electerm/electerm-react",
3
- "version": "1.91.1",
3
+ "version": "1.91.8",
4
4
  "description": "react components src for electerm",
5
5
  "main": "./client/components/main/main.jsx",
6
6
  "license": "MIT",