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
26de9e47
authored
Jul 29, 2023
by
JustSong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix model mapping cannot be deleted
parent
da017113
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
web/src/pages/Channel/EditChannel.js
+6
-3
No files found.
web/src/pages/Channel/EditChannel.js
View file @
26de9e47
...
@@ -153,7 +153,10 @@ const EditChannel = () => {
...
@@ -153,7 +153,10 @@ const EditChannel = () => {
localInputs
.
base_url
=
localInputs
.
base_url
.
slice
(
0
,
localInputs
.
base_url
.
length
-
1
);
localInputs
.
base_url
=
localInputs
.
base_url
.
slice
(
0
,
localInputs
.
base_url
.
length
-
1
);
}
}
if
(
localInputs
.
type
===
3
&&
localInputs
.
other
===
''
)
{
if
(
localInputs
.
type
===
3
&&
localInputs
.
other
===
''
)
{
localInputs
.
other
=
'2023-03-15-preview'
;
localInputs
.
other
=
'2023-06-01-preview'
;
}
if
(
localInputs
.
model_mapping
===
''
)
{
localInputs
.
model_mapping
=
'{}'
;
}
}
let
res
;
let
res
;
localInputs
.
models
=
localInputs
.
models
.
join
(
','
);
localInputs
.
models
=
localInputs
.
models
.
join
(
','
);
...
@@ -213,7 +216,7 @@ const EditChannel = () => {
...
@@ -213,7 +216,7 @@ const EditChannel = () => {
<
Form
.
Input
<
Form
.
Input
label
=
'默认 API 版本'
label
=
'默认 API 版本'
name
=
'other'
name
=
'other'
placeholder
=
{
'请输入默认 API 版本,例如:2023-0
3-15
-preview,该配置可以被实际的请求查询参数所覆盖'
}
placeholder
=
{
'请输入默认 API 版本,例如:2023-0
6-01
-preview,该配置可以被实际的请求查询参数所覆盖'
}
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
value
=
{
inputs
.
other
}
value
=
{
inputs
.
other
}
autoComplete
=
'new-password'
autoComplete
=
'new-password'
...
@@ -318,7 +321,7 @@ const EditChannel = () => {
...
@@ -318,7 +321,7 @@ const EditChannel = () => {
<
/div
>
<
/div
>
<
Form
.
Field
>
<
Form
.
Field
>
<
Form
.
TextArea
<
Form
.
TextArea
label
=
'模型
映射
'
label
=
'模型
重定向
'
placeholder
=
{
`此项可选,用于修改请求体中的模型名称,为一个 JSON 字符串,键为请求中模型名称,值为要替换的模型名称,例如:\n
${
JSON
.
stringify
(
MODEL_MAPPING_EXAMPLE
,
null
,
2
)}
`
}
placeholder
=
{
`此项可选,用于修改请求体中的模型名称,为一个 JSON 字符串,键为请求中模型名称,值为要替换的模型名称,例如:\n
${
JSON
.
stringify
(
MODEL_MAPPING_EXAMPLE
,
null
,
2
)}
`
}
name
=
'model_mapping'
name
=
'model_mapping'
onChange
=
{
handleInputChange
}
onChange
=
{
handleInputChange
}
...
...
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