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
b1074b43
authored
May 15, 2023
by
JustSong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: add refresh button
parent
f46f4151
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletions
+13
-1
web/src/components/ChannelsTable.js
+7
-1
web/src/components/TokensTable.js
+6
-0
No files found.
web/src/components/ChannelsTable.js
View file @
b1074b43
...
...
@@ -60,6 +60,11 @@ const ChannelsTable = () => {
})();
};
const
refresh
=
async
()
=>
{
setLoading
(
true
);
await
loadChannels
(
0
);
}
useEffect
(()
=>
{
loadChannels
(
0
)
.
then
()
...
...
@@ -174,7 +179,7 @@ const ChannelsTable = () => {
const
res
=
await
API
.
get
(
`/api/channel/test`
);
const
{
success
,
message
}
=
res
.
data
;
if
(
success
)
{
show
Success
(
"已成功开始测试所有已启用通道,请刷新页面查看结果。"
);
show
Info
(
"已成功开始测试所有已启用通道,请刷新页面查看结果。"
);
}
else
{
showError
(
message
);
}
...
...
@@ -359,6 +364,7 @@ const ChannelsTable = () => {
(
channels
.
length
%
ITEMS_PER_PAGE
===
0
?
1
:
0
)
}
/
>
<
Button
size
=
'small'
onClick
=
{
refresh
}
loading
=
{
loading
}
>
刷新
<
/Button
>
<
/Table.HeaderCell
>
<
/Table.Row
>
<
/Table.Footer
>
...
...
web/src/components/TokensTable.js
View file @
b1074b43
...
...
@@ -66,6 +66,11 @@ const TokensTable = () => {
})();
};
const
refresh
=
async
()
=>
{
setLoading
(
true
);
await
loadTokens
(
0
);
}
useEffect
(()
=>
{
loadTokens
(
0
)
.
then
()
...
...
@@ -334,6 +339,7 @@ const TokensTable = () => {
<
Button
size
=
'small'
as
=
{
Link
}
to
=
'/token/add'
loading
=
{
loading
}
>
添加新的令牌
<
/Button
>
<
Button
size
=
'small'
onClick
=
{
refresh
}
loading
=
{
loading
}
>
刷新
<
/Button
>
<
Pagination
floated
=
'right'
activePage
=
{
activePage
}
...
...
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