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
3baf231a
authored
Nov 27, 2023
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
移除检查更新
parent
633f1eff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
23 deletions
+28
-23
controller/relay-image.go
+3
-0
controller/relay-openai.go
+2
-0
web/src/components/OtherSetting.js
+23
-23
No files found.
controller/relay-image.go
View file @
3baf231a
...
...
@@ -36,6 +36,9 @@ func relayImageHelper(c *gin.Context, relayMode int) *OpenAIErrorWithStatusCode
if
imageRequest
.
Size
==
""
{
imageRequest
.
Size
=
"1024x1024"
}
if
imageRequest
.
N
==
0
{
imageRequest
.
N
=
1
}
// Prompt validation
if
imageRequest
.
Prompt
==
""
{
return
errorWrapper
(
errors
.
New
(
"prompt is required"
),
"required_field_missing"
,
http
.
StatusBadRequest
)
...
...
controller/relay-openai.go
View file @
3baf231a
...
...
@@ -54,6 +54,7 @@ func openaiStreamHandler(c *gin.Context, resp *http.Response, relayMode int) (*O
err
:=
json
.
Unmarshal
(
common
.
StringToByteSlice
(
streamResp
),
&
streamResponses
)
if
err
!=
nil
{
common
.
SysError
(
"error unmarshalling stream response: "
+
err
.
Error
())
wg
.
Done
()
return
// just ignore the error
}
for
_
,
streamResponse
:=
range
streamResponses
{
...
...
@@ -66,6 +67,7 @@ func openaiStreamHandler(c *gin.Context, resp *http.Response, relayMode int) (*O
err
:=
json
.
Unmarshal
(
common
.
StringToByteSlice
(
streamResp
),
&
streamResponses
)
if
err
!=
nil
{
common
.
SysError
(
"error unmarshalling stream response: "
+
err
.
Error
())
wg
.
Done
()
return
// just ignore the error
}
for
_
,
streamResponse
:=
range
streamResponses
{
...
...
web/src/components/OtherSetting.js
View file @
3baf231a
...
...
@@ -108,7 +108,7 @@ const OtherSetting = () => {
<
Grid
.
Column
>
<
Form
loading
=
{
loading
}
>
<
Header
as
=
'h3'
>
通用设置
<
/Header
>
<
Form
.
Button
onClick
=
{
checkUpdate
}
>
检查更新
<
/Form.Button
>
{
/*<Form.Button onClick={checkUpdate}>检查更新</Form.Button>*/
}
<
Form
.
Group
widths
=
'equal'
>
<
Form
.
TextArea
label
=
'公告'
...
...
@@ -178,28 +178,28 @@ const OtherSetting = () => {
<
Form
.
Button
onClick
=
{
submitFooter
}
>
设置页脚
<
/Form.Button
>
<
/Form
>
<
/Grid.Column
>
<
Modal
onClose
=
{()
=>
setShowUpdateModal
(
false
)
}
onOpen
=
{()
=>
setShowUpdateModal
(
true
)
}
open
=
{
showUpdateModal
}
>
<
Modal
.
Header
>
新版本:
{
updateData
.
tag_name
}
<
/Modal.Header
>
<
Modal
.
Content
>
<
Modal
.
Description
>
<
div
dangerouslySetInnerHTML
=
{{
__html
:
updateData
.
content
}}
><
/div
>
<
/Modal.Description
>
<
/Modal.Content
>
<
Modal
.
Actions
>
<
Button
onClick
=
{()
=>
setShowUpdateModal
(
false
)}
>
关闭
<
/Button
>
<
Button
content
=
'详情'
onClick
=
{()
=>
{
setShowUpdateModal
(
false
);
openGitHubRelease
();
}
}
/
>
<
/Modal.Actions
>
<
/Modal
>
{
/*<Modal*/
}
{
/* onClose={() => setShowUpdateModal(false)}*/
}
{
/* onOpen={() => setShowUpdateModal(true)}*/
}
{
/* open={showUpdateModal}*/
}
{
/*>*/
}
{
/* <Modal.Header>新版本:{updateData.tag_name}</Modal.Header>*/
}
{
/* <Modal.Content>*/
}
{
/* <Modal.Description>*/
}
{
/* <div dangerouslySetInnerHTML={{ __html: updateData.content }}></div>*/
}
{
/* </Modal.Description>*/
}
{
/* </Modal.Content>*/
}
{
/* <Modal.Actions>*/
}
{
/* <Button onClick={() => setShowUpdateModal(false)}>关闭</Button>*/
}
{
/* <Button*/
}
{
/* content='详情'*/
}
{
/* onClick={() => {*/
}
{
/* setShowUpdateModal(false);*/
}
{
/* openGitHubRelease();*/
}
{
/* }}*/
}
{
/* />*/
}
{
/* </Modal.Actions>*/
}
{
/*</Modal>*/
}
<
/Grid
>
);
};
...
...
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