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
9033b7c3
authored
Mar 02, 2024
by
QuentinHsu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: the content displayed on the homepage is incorrect
parent
556b16b9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
32 deletions
+28
-32
web/src/pages/Home/index.js
+28
-32
No files found.
web/src/pages/Home/index.js
View file @
9033b7c3
import
React
,
{
useContext
,
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useContext
,
useEffect
,
useState
}
from
'react'
;
import
{
Card
,
Grid
,
Header
,
Segment
}
from
'semantic-ui-react
'
;
import
{
Card
,
Col
,
Row
}
from
'@douyinfe/semi-ui
'
;
import
{
API
,
showError
,
showNotice
,
timestamp2string
}
from
'../../helpers'
;
import
{
API
,
showError
,
showNotice
,
timestamp2string
}
from
'../../helpers'
;
import
{
StatusContext
}
from
'../../context/Status'
;
import
{
StatusContext
}
from
'../../context/Status'
;
import
{
marked
}
from
'marked'
;
import
{
marked
}
from
'marked'
;
...
@@ -44,7 +44,7 @@ const Home = () => {
...
@@ -44,7 +44,7 @@ const Home = () => {
const
getStartTimeString
=
()
=>
{
const
getStartTimeString
=
()
=>
{
const
timestamp
=
statusState
?.
status
?.
start_time
;
const
timestamp
=
statusState
?.
status
?.
start_time
;
return
timestamp2string
(
timestamp
)
;
return
statusState
.
status
?
timestamp2string
(
timestamp
)
:
''
;
};
};
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -55,67 +55,63 @@ const Home = () => {
...
@@ -55,67 +55,63 @@ const Home = () => {
<>
<>
{
{
homePageContentLoaded
&&
homePageContent
===
''
?
<>
homePageContentLoaded
&&
homePageContent
===
''
?
<>
<
Segment
>
<
Card
<
Header
as
=
'h3'
>
系统状况
<
/Header
>
bordered
=
{
false
}
<
Grid
columns
=
{
2
}
stackable
>
headerLine
=
{
false
}
<
Grid
.
Column
>
title
=
'系统状况'
<
Card
fluid
>
bodyStyle
=
{{
padding
:
'10px 20px'
}}
<
Card
.
Content
>
>
<
Card
.
Header
>
系统信息
<
/Card.Header
>
<
Row
gutter
=
{
16
}
>
<
Card
.
Meta
>
系统信息总览
<
/Card.Meta
>
<
Col
span
=
{
12
}
>
<
Card
.
Description
>
<
Card
<
p
>
名称:
{
statusState
?.
status
?.
system_name
}
<
/p
>
title
=
'系统信息'
<
p
>
版本:
{
statusState
?.
status
?.
version
?
statusState
?.
status
?.
version
:
"unknown"
}
<
/p
>
headerExtraContent
=
{
<
span
style
=
{{
fontSize
:
'12px'
,
color
:
'var(--semi-color-text-1)'
}}
>
系统信息总览
<
/span>}
>
<
p
>
名称:
{
statusState
?.
system_name
}
<
/p
>
<
p
>
版本:
{
statusState
?.
version
?
statusState
?.
version
:
"unknown"
}
<
/p
>
<
p
>
<
p
>
源码:
源码:
<
a
<
a
href
=
'https://github.com/songquanpeng/one-api'
href
=
'https://github.com/songquanpeng/one-api'
target
=
'_blank'
target
=
'_blank'
rel
=
"noreferrer"
>
>
https
:
//github.com/songquanpeng/one-api
https
:
//github.com/songquanpeng/one-api
<
/a
>
<
/a
>
<
/p
>
<
/p
>
<
p
>
启动时间:
{
getStartTimeString
()}
<
/p
>
<
p
>
启动时间:
{
getStartTimeString
()}
<
/p
>
<
/Card.Description
>
<
/Card.Content
>
<
/Card
>
<
/Card
>
<
/Grid.Column
>
<
/Col
>
<
Grid
.
Column
>
<
Col
span
=
{
12
}
>
<
Card
fluid
>
<
Card
<
Card
.
Content
>
title
=
'系统配置'
<
Card
.
Header
>
系统配置
<
/Card.Header
>
headerExtraContent
=
{
<
span
style
=
{{
fontSize
:
'12px'
,
color
:
'var(--semi-color-text-1)'
}}
>
系统配置总览
<
/span>}
>
<
Card
.
Meta
>
系统配置总览
<
/Card.Meta
>
<
Card
.
Description
>
<
p
>
<
p
>
邮箱验证:
邮箱验证:
{
statusState
?.
status
?.
email_verification
===
true
{
statusState
?.
email_verification
===
true
?
'已启用'
?
'已启用'
:
'未启用'
}
:
'未启用'
}
<
/p
>
<
/p
>
<
p
>
<
p
>
GitHub
身份验证:
GitHub
身份验证:
{
statusState
?.
status
?.
github_oauth
===
true
{
statusState
?.
github_oauth
===
true
?
'已启用'
?
'已启用'
:
'未启用'
}
:
'未启用'
}
<
/p
>
<
/p
>
<
p
>
<
p
>
微信身份验证:
微信身份验证:
{
statusState
?.
status
?.
wechat_login
===
true
{
statusState
?.
wechat_login
===
true
?
'已启用'
?
'已启用'
:
'未启用'
}
:
'未启用'
}
<
/p
>
<
/p
>
<
p
>
<
p
>
Turnstile
用户校验:
Turnstile
用户校验:
{
statusState
?.
status
?.
turnstile_check
===
true
{
statusState
?.
turnstile_check
===
true
?
'已启用'
?
'已启用'
:
'未启用'
}
:
'未启用'
}
<
/p
>
<
/p
>
<
/Card.Description
>
<
/Card.Content
>
<
/Card
>
<
/Card
>
<
/
Grid.Column
>
<
/
Col
>
<
/
Grid
>
<
/
Row
>
<
/
Segment
>
<
/
Card
>
<
/> : <
>
<
/> : <
>
{
{
homePageContent
.
startsWith
(
'https://'
)
?
<
iframe
homePageContent
.
startsWith
(
'https://'
)
?
<
iframe
...
...
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