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
256de6c4
authored
Mar 15, 2024
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 添加回调未开启提示
parent
aff01586
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
1 deletions
+18
-1
controller/misc.go
+2
-0
web/src/components/MjLogsTable.js
+13
-1
web/src/components/OperationSetting.js
+2
-0
web/src/components/SiderBar.js
+1
-0
No files found.
controller/misc.go
View file @
256de6c4
...
...
@@ -5,6 +5,7 @@ import (
"fmt"
"net/http"
"one-api/common"
"one-api/constant"
"one-api/model"
"strings"
...
...
@@ -59,6 +60,7 @@ func GetStatus(c *gin.Context) {
"data_export_default_time"
:
common
.
DataExportDefaultTime
,
"default_collapse_sidebar"
:
common
.
DefaultCollapseSidebar
,
"enable_online_topup"
:
common
.
PayAddress
!=
""
&&
common
.
EpayId
!=
""
&&
common
.
EpayKey
!=
""
,
"mj_notify_enabled"
:
constant
.
MjNotifyEnabled
,
},
})
return
...
...
web/src/components/MjLogsTable.js
View file @
256de6c4
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
API
,
copy
,
isAdmin
,
showError
,
showSuccess
,
timestamp2string
}
from
'../helpers'
;
import
{
Button
,
Form
,
ImagePreview
,
Layout
,
Modal
,
Progress
,
Table
,
Tag
,
Typography
}
from
'@douyinfe/semi-ui'
;
import
{
B
anner
,
B
utton
,
Form
,
ImagePreview
,
Layout
,
Modal
,
Progress
,
Table
,
Tag
,
Typography
}
from
'@douyinfe/semi-ui'
;
import
{
ITEMS_PER_PAGE
}
from
'../constants'
;
...
...
@@ -289,6 +289,7 @@ const LogsTable = () => {
const
[
logType
,
setLogType
]
=
useState
(
0
);
const
isAdminUser
=
isAdmin
();
const
[
isModalOpenurl
,
setIsModalOpenurl
]
=
useState
(
false
);
const
[
showBanner
,
setShowBanner
]
=
useState
(
false
);
// 定义模态框图片URL的状态和更新函数
const
[
modalImageUrl
,
setModalImageUrl
]
=
useState
(
''
);
...
...
@@ -380,11 +381,22 @@ const LogsTable = () => {
refresh
().
then
();
},
[
logType
]);
useEffect
(()
=>
{
const
mjNotifyEnabled
=
localStorage
.
getItem
(
'mj_notify_enabled'
);
if
(
mjNotifyEnabled
!==
'true'
)
{
setShowBanner
(
true
);
}
},
[]);
return
(
<>
<
Layout
>
{
isAdminUser
&&
showBanner
?
<
Banner
type
=
"info"
description
=
"当前未开启Midjourney回调,部分项目可能无法获得绘图结果,可在运营设置中开启。"
/>
:
<><
/
>
}
<
Form
layout
=
"horizontal"
style
=
{{
marginTop
:
10
}}
>
<>
<
Form
.
Input
field
=
"channel_id"
label
=
"渠道 ID"
style
=
{{
width
:
176
}}
value
=
{
channel_id
}
...
...
web/src/components/OperationSetting.js
View file @
256de6c4
...
...
@@ -88,6 +88,8 @@ const OperationSetting = () => {
if
(
name
.
endsWith
(
'Enabled'
)
||
name
===
'DataExportInterval'
||
name
===
'DataExportDefaultTime'
||
name
===
'DefaultCollapseSidebar'
)
{
if
(
name
===
'DataExportDefaultTime'
)
{
localStorage
.
setItem
(
'data_export_default_time'
,
value
);
}
else
if
(
name
===
'MjNotifyEnabled'
)
{
localStorage
.
setItem
(
'mj_notify_enabled'
,
value
);
}
await
updateOption
(
name
,
value
);
}
else
{
...
...
web/src/components/SiderBar.js
View file @
256de6c4
...
...
@@ -130,6 +130,7 @@ const SiderBar = () => {
localStorage
.
setItem
(
'enable_data_export'
,
data
.
enable_data_export
);
localStorage
.
setItem
(
'data_export_default_time'
,
data
.
data_export_default_time
);
localStorage
.
setItem
(
'default_collapse_sidebar'
,
data
.
default_collapse_sidebar
);
localStorage
.
setItem
(
'mj_notify_enabled'
,
data
.
mj_notify_enabled
);
if
(
data
.
chat_link
)
{
localStorage
.
setItem
(
'chat_link'
,
data
.
chat_link
);
}
else
{
...
...
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