Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
new-api
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b0dc31c4
authored
Aug 05, 2025
by
RedwindA
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(web): 修复模型倍率设置中添加新模型时输入框锁定的问题
parent
2286ec06
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
12 deletions
+5
-12
web/src/pages/Setting/Ratio/ModelSettingsVisualEditor.js
+5
-12
No files found.
web/src/pages/Setting/Ratio/ModelSettingsVisualEditor.js
View file @
b0dc31c4
...
...
@@ -44,6 +44,7 @@ export default function ModelSettingsVisualEditor(props) {
const
{
t
}
=
useTranslation
();
const
[
models
,
setModels
]
=
useState
([]);
const
[
visible
,
setVisible
]
=
useState
(
false
);
const
[
isEditMode
,
setIsEditMode
]
=
useState
(
false
);
const
[
currentModel
,
setCurrentModel
]
=
useState
(
null
);
const
[
searchText
,
setSearchText
]
=
useState
(
''
);
const
[
currentPage
,
setCurrentPage
]
=
useState
(
1
);
...
...
@@ -386,9 +387,11 @@ export default function ModelSettingsVisualEditor(props) {
setCurrentModel
(
null
);
setPricingMode
(
'per-token'
);
setPricingSubMode
(
'ratio'
);
setIsEditMode
(
false
);
};
const
editModel
=
(
record
)
=>
{
setIsEditMode
(
true
);
// Determine which pricing mode to use based on the model's current configuration
let
initialPricingMode
=
'per-token'
;
let
initialPricingSubMode
=
'ratio'
;
...
...
@@ -500,13 +503,7 @@ export default function ModelSettingsVisualEditor(props) {
<
/Space
>
<
Modal
title
=
{
currentModel
&&
currentModel
.
name
&&
models
.
some
((
model
)
=>
model
.
name
===
currentModel
.
name
)
?
t
(
'编辑模型'
)
:
t
(
'添加模型'
)
}
title
=
{
isEditMode
?
t
(
'编辑模型'
)
:
t
(
'添加模型'
)}
visible
=
{
visible
}
onCancel
=
{()
=>
{
resetModalState
();
...
...
@@ -562,11 +559,7 @@ export default function ModelSettingsVisualEditor(props) {
label
=
{
t
(
'模型名称'
)}
placeholder
=
'strawberry'
required
disabled
=
{
currentModel
&&
currentModel
.
name
&&
models
.
some
((
model
)
=>
model
.
name
===
currentModel
.
name
)
}
disabled
=
{
isEditMode
}
onChange
=
{(
value
)
=>
setCurrentModel
((
prev
)
=>
({
...
prev
,
name
:
value
}))
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment