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
9f274608
authored
Dec 13, 2024
by
HynoR
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 增加价格和倍率的互斥验证,优化模型名称输入提示
parent
16b32cc6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletions
+6
-1
web/src/pages/Setting/Operation/ModelSettingsVisualEditor.js
+6
-1
No files found.
web/src/pages/Setting/Operation/ModelSettingsVisualEditor.js
View file @
9f274608
...
...
@@ -134,7 +134,6 @@ export default function ModelSettingsVisualEditor(props) {
<
Input
value
=
{
text
}
placeholder
=
"按量计价"
disabled
=
{
record
.
ratio
!==
''
}
onChange
=
{
value
=>
updateModel
(
record
.
name
,
'price'
,
value
)}
/
>
)
...
...
@@ -202,6 +201,11 @@ export default function ModelSettingsVisualEditor(props) {
showError
(
'模型名称已存在'
);
return
;
}
// 不允许同时添加固定价格和倍率
if
(
values
.
price
!==
''
&&
(
values
.
ratio
!==
''
||
values
.
completionRatio
!==
''
))
{
showError
(
'固定价格和倍率不能同时存在'
);
return
;
}
setModels
(
prev
=>
[{
name
:
values
.
name
,
price
:
values
.
price
||
''
,
...
...
@@ -263,6 +267,7 @@ export default function ModelSettingsVisualEditor(props) {
<
Form
.
Input
field
=
"name"
label
=
"模型名称"
placeholder
=
"strawberry"
required
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