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
ed432c5a
authored
Nov 03, 2023
by
CaIon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复令牌bug
parent
40c626cb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
121 additions
and
103 deletions
+121
-103
web/src/App.js
+0
-0
web/src/components/LogsTable.js
+1
-1
web/src/components/TokensTable.js
+8
-7
web/src/index.css
+10
-1
web/src/index.js
+4
-4
web/src/pages/Token/EditToken.js
+1
-0
web/src/pages/TopUp/index.js
+97
-90
No files found.
web/src/App.js
View file @
ed432c5a
This diff is collapsed.
Click to expand it.
web/src/components/LogsTable.js
View file @
ed432c5a
...
...
@@ -71,7 +71,7 @@ const LogsTable = () => {
isAdminUser
?
record
.
type
===
0
||
record
.
type
===
2
?
<
div
>
{
<
Tag
color
=
{
stringToColor
(
text
)
}
size
=
'large'
>
{
text
}
<
/Tag>
}
{
<
Tag
color
=
{
colors
[
parseInt
(
text
)
%
colors
.
length
]
}
size
=
'large'
>
{
text
}
<
/Tag>
}
<
/div
>
:
<><
/
>
...
...
web/src/components/TokensTable.js
View file @
ed432c5a
...
...
@@ -187,21 +187,21 @@ const TokensTable = () => {
const
closeEdit
=
()
=>
{
setShowEdit
(
false
);
setEditingToken
({
id
:
undefined
,
});
//
setEditingToken({
//
id: undefined,
//
});
}
const
setTokensFormat
=
(
tokens
)
=>
{
setTokens
(
tokens
);
if
(
tokens
.
length
==
=
ITEMS_PER_PAGE
)
{
if
(
tokens
.
length
>
=
ITEMS_PER_PAGE
)
{
setTokenCount
(
tokens
.
length
+
ITEMS_PER_PAGE
);
}
else
{
setTokenCount
(
tokens
.
length
);
}
}
//
let pageData = tokens.slice((activePage - 1) * ITEMS_PER_PAGE, activePage * ITEMS_PER_PAGE);
let
pageData
=
tokens
.
slice
((
activePage
-
1
)
*
ITEMS_PER_PAGE
,
activePage
*
ITEMS_PER_PAGE
);
const
loadTokens
=
async
(
startIdx
)
=>
{
setLoading
(
true
);
const
res
=
await
API
.
get
(
`/api/token/?p=
${
startIdx
}
`
);
...
...
@@ -450,11 +450,12 @@ const TokensTable = () => {
onClick
=
{
searchTokens
}
style
=
{{
marginRight
:
8
}}
>
查询
<
/Button
>
<
/Form
>
<
Table
style
=
{{
marginTop
:
20
}}
columns
=
{
columns
}
dataSource
=
{
tokens
}
pagination
=
{{
<
Table
style
=
{{
marginTop
:
20
}}
columns
=
{
columns
}
dataSource
=
{
pageData
}
pagination
=
{{
currentPage
:
activePage
,
pageSize
:
ITEMS_PER_PAGE
,
total
:
tokenCount
,
pageSizeOpts
:
[
10
,
20
,
50
,
100
],
showSizeChanger
:
true
,
pageSizeOptions
:
[
10
,
20
,
50
,
100
],
onPageChange
:
handlePageChange
,
}}
loading
=
{
loading
}
rowSelection
=
{
rowSelection
}
>
<
/Table
>
...
...
web/src/index.css
View file @
ed432c5a
...
...
@@ -8,6 +8,15 @@ body {
scrollbar-width
:
none
;
color
:
var
(
--semi-color-text-0
)
!important
;
background-color
:
var
(
--semi-color-bg-0
)
!important
;
height
:
100%
;
}
#root
{
height
:
100%
;
}
.semi-layout
{
height
:
100%
;
}
.tableShow
{
...
...
@@ -40,7 +49,7 @@ code {
/*display: flex;*/
/*flex-direction: column;*/
/*width: 100%;*/
height
:
100
vh
;
height
:
100
%
;
overflow
:
hidden
;
}
...
...
web/src/index.js
View file @
ed432c5a
...
...
@@ -22,7 +22,6 @@ root.render(
<
UserProvider
>
<
BrowserRouter
>
<
Layout
>
<
Sider
>
<
SiderBar
/>
<
/Sider
>
...
...
@@ -37,11 +36,12 @@ root.render(
>
<
App
/>
<
/Content
>
<
Footer
><
/Footer
>
{
/*<Layout.Footer>*/
}
{
/* <Footer></Footer>*/
}
{
/*</Layout.Footer>*/
}
<
/Layout
>
<
ToastContainer
/>
<
/Layout
>
<
ToastContainer
/>
{
/*<Footer />*/
}
<
/BrowserRouter
>
<
/UserProvider
>
<
/StatusProvider
>
...
...
web/src/pages/Token/EditToken.js
View file @
ed432c5a
...
...
@@ -112,6 +112,7 @@ const EditToken = (props) => {
return
(
<>
<
SideSheet
placement
=
{
isEdit
?
'right'
:
'left'
}
title
=
{
<
Title
level
=
{
3
}
>
{
isEdit
?
'更新令牌信息'
:
'创建新的令牌'
}
<
/Title>
}
headerStyle
=
{{
borderBottom
:
'1px solid var(--semi-color-border)'
}}
bodyStyle
=
{{
borderBottom
:
'1px solid var(--semi-color-border)'
}}
...
...
web/src/pages/TopUp/index.js
View file @
ed432c5a
This diff is collapsed.
Click to expand it.
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