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
76072de6
authored
Aug 06, 2025
by
Calcium-Ion
Committed by
GitHub
Aug 06, 2025
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1510 from RedwindA/fix/manual-price-edit-modelName-check
fix:修复添加模型倍率时的输入框锁定
parents
e7c657ef
b0dc31c4
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 @
76072de6
...
...
@@ -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