@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.
- package/client/common/default-setting.js +1 -0
- package/client/components/ai/ai-chat.jsx +2 -1
- package/client/components/ai/ai-config-props.js +3 -1
- package/client/components/ai/ai-config.jsx +21 -0
- package/client/components/bookmark-form/bookmark-select.jsx +17 -2
- package/client/components/sys-menu/menu-btn.jsx +0 -9
- package/client/store/common.js +1 -1
- package/client/store/sync.js +3 -1
- package/client/store/system-menu.js +0 -4
- package/package.json +1 -1
|
@@ -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
|
// },
|
package/client/store/common.js
CHANGED
|
@@ -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) {
|
package/client/store/sync.js
CHANGED
|
@@ -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
|