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
589243cd
authored
Jun 17, 2023
by
JustSong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: fix footer not updated asap
parent
247b707d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
8 deletions
+29
-8
web/src/components/Footer.js
+22
-2
web/src/components/OtherSetting.js
+7
-6
No files found.
web/src/components/Footer.js
View file @
589243cd
import
React
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Container
,
Segment
}
from
'semantic-ui-react'
;
import
{
Container
,
Segment
}
from
'semantic-ui-react'
;
import
{
getFooterHTML
,
getSystemName
}
from
'../helpers'
;
import
{
getFooterHTML
,
getSystemName
}
from
'../helpers'
;
const
Footer
=
()
=>
{
const
Footer
=
()
=>
{
const
systemName
=
getSystemName
();
const
systemName
=
getSystemName
();
const
footer
=
getFooterHTML
();
const
[
footer
,
setFooter
]
=
useState
(
getFooterHTML
());
let
remainCheckTimes
=
5
;
const
loadFooter
=
()
=>
{
let
footer_html
=
localStorage
.
getItem
(
'footer_html'
);
if
(
footer_html
)
{
setFooter
(
footer_html
);
}
};
useEffect
(()
=>
{
const
timer
=
setInterval
(()
=>
{
if
(
remainCheckTimes
<=
0
)
{
clearInterval
(
timer
);
return
;
}
remainCheckTimes
--
;
loadFooter
();
},
200
);
return
()
=>
clearTimeout
(
timer
);
},
[]);
return
(
return
(
<
Segment
vertical
>
<
Segment
vertical
>
...
...
web/src/components/OtherSetting.js
View file @
589243cd
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Button
,
Divider
,
Form
,
Grid
,
Header
,
Modal
}
from
'semantic-ui-react'
;
import
{
Button
,
Divider
,
Form
,
Grid
,
Header
,
M
essage
,
M
odal
}
from
'semantic-ui-react'
;
import
{
API
,
showError
,
showSuccess
}
from
'../helpers'
;
import
{
API
,
showError
,
showSuccess
}
from
'../helpers'
;
import
{
marked
}
from
'marked'
;
import
{
marked
}
from
'marked'
;
...
@@ -10,13 +10,13 @@ const OtherSetting = () => {
...
@@ -10,13 +10,13 @@ const OtherSetting = () => {
About
:
''
,
About
:
''
,
SystemName
:
''
,
SystemName
:
''
,
Logo
:
''
,
Logo
:
''
,
HomePageContent
:
''
,
HomePageContent
:
''
});
});
let
[
loading
,
setLoading
]
=
useState
(
false
);
let
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
showUpdateModal
,
setShowUpdateModal
]
=
useState
(
false
);
const
[
showUpdateModal
,
setShowUpdateModal
]
=
useState
(
false
);
const
[
updateData
,
setUpdateData
]
=
useState
({
const
[
updateData
,
setUpdateData
]
=
useState
({
tag_name
:
''
,
tag_name
:
''
,
content
:
''
,
content
:
''
});
});
const
getOptions
=
async
()
=>
{
const
getOptions
=
async
()
=>
{
...
@@ -43,7 +43,7 @@ const OtherSetting = () => {
...
@@ -43,7 +43,7 @@ const OtherSetting = () => {
setLoading
(
true
);
setLoading
(
true
);
const
res
=
await
API
.
put
(
'/api/option/'
,
{
const
res
=
await
API
.
put
(
'/api/option/'
,
{
key
,
key
,
value
,
value
});
});
const
{
success
,
message
}
=
res
.
data
;
const
{
success
,
message
}
=
res
.
data
;
if
(
success
)
{
if
(
success
)
{
...
@@ -97,7 +97,7 @@ const OtherSetting = () => {
...
@@ -97,7 +97,7 @@ const OtherSetting = () => {
}
else
{
}
else
{
setUpdateData
({
setUpdateData
({
tag_name
:
tag_name
,
tag_name
:
tag_name
,
content
:
marked
.
parse
(
body
)
,
content
:
marked
.
parse
(
body
)
});
});
setShowUpdateModal
(
true
);
setShowUpdateModal
(
true
);
}
}
...
@@ -153,7 +153,7 @@ const OtherSetting = () => {
...
@@ -153,7 +153,7 @@ const OtherSetting = () => {
style
=
{{
minHeight
:
150
,
fontFamily
:
'JetBrains Mono, Consolas'
}}
style
=
{{
minHeight
:
150
,
fontFamily
:
'JetBrains Mono, Consolas'
}}
/
>
/
>
<
/Form.Group
>
<
/Form.Group
>
<
Form
.
Button
onClick
=
{()
=>
submitOption
(
'HomePageContent'
)}
>
保存首页内容
<
/Form.Button
>
<
Form
.
Button
onClick
=
{()
=>
submitOption
(
'HomePageContent'
)}
>
保存首页内容
<
/Form.Button
>
<
Form
.
Group
widths
=
'equal'
>
<
Form
.
Group
widths
=
'equal'
>
<
Form
.
TextArea
<
Form
.
TextArea
label
=
'关于'
label
=
'关于'
...
@@ -165,6 +165,7 @@ const OtherSetting = () => {
...
@@ -165,6 +165,7 @@ const OtherSetting = () => {
/
>
/
>
<
/Form.Group
>
<
/Form.Group
>
<
Form
.
Button
onClick
=
{
submitAbout
}
>
保存关于
<
/Form.Button
>
<
Form
.
Button
onClick
=
{
submitAbout
}
>
保存关于
<
/Form.Button
>
<
Message
>
移除
One
API
的版权标识必须首先获得授权,后续版本将通过授权码强制执行。
<
/Message
>
<
Form
.
Group
widths
=
'equal'
>
<
Form
.
Group
widths
=
'equal'
>
<
Form
.
Input
<
Form
.
Input
label
=
'页脚'
label
=
'页脚'
...
...
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