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
e22e41c9
authored
Nov 12, 2024
by
licoy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 优化数据管理操作栏均为顶部
parent
fac2f50b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
134 additions
and
137 deletions
+134
-137
web/src/components/ChannelsTable.js
+55
-64
web/src/components/LogsTable.js
+16
-14
web/src/components/RedemptionsTable.js
+27
-24
web/src/components/TokensTable.js
+27
-24
web/src/components/UsersTable.js
+9
-11
No files found.
web/src/components/ChannelsTable.js
View file @
e22e41c9
...
@@ -17,7 +17,7 @@ import {
...
@@ -17,7 +17,7 @@ import {
renderQuota
,
renderQuota
,
}
from
'../helpers/render'
;
}
from
'../helpers/render'
;
import
{
import
{
Button
,
Button
,
Divider
,
Dropdown
,
Dropdown
,
Form
,
Form
,
InputNumber
,
InputNumber
,
...
@@ -720,7 +720,7 @@ const ChannelsTable = () => {
...
@@ -720,7 +720,7 @@ const ChannelsTable = () => {
}}
}}
labelPosition
=
'left'
labelPosition
=
'left'
>
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
div
style
=
{{
display
:
'flex'
}}
>
<
Space
>
<
Space
>
<
Form
.
Input
<
Form
.
Input
field
=
'search_keyword'
field
=
'search_keyword'
...
@@ -745,7 +745,7 @@ const ChannelsTable = () => {
...
@@ -745,7 +745,7 @@ const ChannelsTable = () => {
<
Form
.
Select
<
Form
.
Select
field
=
'group'
field
=
'group'
label
=
'分组'
label
=
'分组'
optionList
=
{[{
label
:
'选择分组'
,
value
:
null
},
...
groupOptions
]}
optionList
=
{[{
label
:
'选择分组'
,
value
:
null
},
...
groupOptions
]}
initValue
=
{
null
}
initValue
=
{
null
}
onChange
=
{(
v
)
=>
{
onChange
=
{(
v
)
=>
{
setSearchGroup
(
v
);
setSearchGroup
(
v
);
...
@@ -757,16 +757,25 @@ const ChannelsTable = () => {
...
@@ -757,16 +757,25 @@ const ChannelsTable = () => {
type
=
'primary'
type
=
'primary'
htmlType
=
'submit'
htmlType
=
'submit'
className
=
'btn-margin-right'
className
=
'btn-margin-right'
style
=
{{
marginRight
:
8
}}
style
=
{{
marginRight
:
8
}}
>
>
查询
查询
<
/Button
>
<
/Button
>
<
/Space
>
<
/Space
>
<
/div
>
<
/div
>
<
/Form
>
<
/Form
>
<
div
style
=
{{
marginTop
:
10
,
display
:
'flex'
}}
>
<
Divider
style
=
{{
marginBottom
:
15
}}
/
>
<
Space
>
<
div
<
Space
>
style
=
{{
display
:
isMobile
()
?
''
:
'flex'
,
marginTop
:
isMobile
()
?
0
:
-
45
,
zIndex
:
999
,
pointerEvents
:
'none'
,
}}
>
<
Space
style
=
{{
pointerEvents
:
'auto'
,
marginTop
:
isMobile
()
?
0
:
45
}}
>
<
Typography
.
Text
strong
>
使用
ID
排序
<
/Typography.Text
>
<
Typography
.
Text
strong
>
使用
ID
排序
<
/Typography.Text
>
<
Switch
<
Switch
checked
=
{
idSort
}
checked
=
{
idSort
}
...
@@ -783,56 +792,10 @@ const ChannelsTable = () => {
...
@@ -783,56 +792,10 @@ const ChannelsTable = () => {
});
});
}}
}}
><
/Switch
>
><
/Switch
>
<
/Space
>
<
/Space
>
<
/div
>
<
Table
className
=
{
'channel-table'
}
style
=
{{
marginTop
:
15
}}
columns
=
{
columns
}
dataSource
=
{
pageData
}
pagination
=
{{
currentPage
:
activePage
,
pageSize
:
pageSize
,
total
:
channelCount
,
pageSizeOpts
:
[
10
,
20
,
50
,
100
],
showSizeChanger
:
true
,
formatPageText
:
(
page
)
=>
''
,
onPageSizeChange
:
(
size
)
=>
{
handlePageSizeChange
(
size
).
then
();
},
onPageChange
:
handlePageChange
,
}}
loading
=
{
loading
}
onRow
=
{
handleRow
}
rowSelection
=
{
enableBatchDelete
?
{
onChange
:
(
selectedRowKeys
,
selectedRows
)
=>
{
// console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
setSelectedChannels
(
selectedRows
);
},
}
:
null
}
/
>
<
div
style
=
{{
display
:
isMobile
()
?
''
:
'flex'
,
marginTop
:
isMobile
()
?
0
:
-
45
,
zIndex
:
999
,
position
:
'relative'
,
pointerEvents
:
'none'
,
}}
>
<
Space
style
=
{{
pointerEvents
:
'auto'
,
marginTop
:
isMobile
()
?
0
:
45
}}
>
<
Button
<
Button
theme
=
'light'
theme
=
'light'
type
=
'primary'
type
=
'primary'
style
=
{{
marginRight
:
8
}}
style
=
{{
marginRight
:
8
}}
onClick
=
{()
=>
{
onClick
=
{()
=>
{
setEditingChannel
({
setEditingChannel
({
id
:
undefined
,
id
:
undefined
,
...
@@ -848,7 +811,7 @@ const ChannelsTable = () => {
...
@@ -848,7 +811,7 @@ const ChannelsTable = () => {
onConfirm
=
{
testAllChannels
}
onConfirm
=
{
testAllChannels
}
position
=
{
isMobile
()
?
'top'
:
'top'
}
position
=
{
isMobile
()
?
'top'
:
'top'
}
>
>
<
Button
theme
=
'light'
type
=
'warning'
style
=
{{
marginRight
:
8
}}
>
<
Button
theme
=
'light'
type
=
'warning'
style
=
{{
marginRight
:
8
}}
>
测试所有通道
测试所有通道
<
/Button
>
<
/Button
>
<
/Popconfirm
>
<
/Popconfirm
>
...
@@ -857,7 +820,7 @@ const ChannelsTable = () => {
...
@@ -857,7 +820,7 @@ const ChannelsTable = () => {
okType
=
{
'secondary'
}
okType
=
{
'secondary'
}
onConfirm
=
{
updateAllChannelsBalance
}
onConfirm
=
{
updateAllChannelsBalance
}
>
>
<
Button
theme
=
'light'
type
=
'secondary'
style
=
{{
marginRight
:
8
}}
>
<
Button
theme
=
'light'
type
=
'secondary'
style
=
{{
marginRight
:
8
}}
>
更新所有已启用通道余额
更新所有已启用通道余额
<
/Button
>
<
/Button
>
<
/Popconfirm
>
<
/Popconfirm
>
...
@@ -867,7 +830,7 @@ const ChannelsTable = () => {
...
@@ -867,7 +830,7 @@ const ChannelsTable = () => {
okType
=
{
'danger'
}
okType
=
{
'danger'
}
onConfirm
=
{
deleteAllDisabledChannels
}
onConfirm
=
{
deleteAllDisabledChannels
}
>
>
<
Button
theme
=
'light'
type
=
'danger'
style
=
{{
marginRight
:
8
}}
>
<
Button
theme
=
'light'
type
=
'danger'
style
=
{{
marginRight
:
8
}}
>
删除禁用通道
删除禁用通道
<
/Button
>
<
/Button
>
<
/Popconfirm
>
<
/Popconfirm
>
...
@@ -875,17 +838,14 @@ const ChannelsTable = () => {
...
@@ -875,17 +838,14 @@ const ChannelsTable = () => {
<
Button
<
Button
theme
=
'light'
theme
=
'light'
type
=
'primary'
type
=
'primary'
style
=
{{
marginRight
:
8
}}
style
=
{{
marginRight
:
8
}}
onClick
=
{
refresh
}
onClick
=
{
refresh
}
>
>
刷新
刷新
<
/Button
>
<
/Button
>
<
/Space
>
<
/Space
>
{
/*<div style={{width: '100%', pointerEvents: 'none', position: 'absolute'}}>*/
}
{
/*</div>*/
}
<
/div
>
<
/div
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
div
style
=
{{
marginTop
:
20
}}
>
<
Space
>
<
Space
>
<
Typography
.
Text
strong
>
开启批量删除
<
/Typography.Text
>
<
Typography
.
Text
strong
>
开启批量删除
<
/Typography.Text
>
<
Switch
<
Switch
...
@@ -908,7 +868,7 @@ const ChannelsTable = () => {
...
@@ -908,7 +868,7 @@ const ChannelsTable = () => {
disabled
=
{
!
enableBatchDelete
}
disabled
=
{
!
enableBatchDelete
}
theme
=
'light'
theme
=
'light'
type
=
'danger'
type
=
'danger'
style
=
{{
marginRight
:
8
}}
style
=
{{
marginRight
:
8
}}
>
>
删除所选通道
删除所选通道
<
/Button
>
<
/Button
>
...
@@ -920,12 +880,43 @@ const ChannelsTable = () => {
...
@@ -920,12 +880,43 @@ const ChannelsTable = () => {
onConfirm
=
{
fixChannelsAbilities
}
onConfirm
=
{
fixChannelsAbilities
}
position
=
{
'top'
}
position
=
{
'top'
}
>
>
<
Button
theme
=
'light'
type
=
'secondary'
style
=
{{
marginRight
:
8
}}
>
<
Button
theme
=
'light'
type
=
'secondary'
style
=
{{
marginRight
:
8
}}
>
修复数据库一致性
修复数据库一致性
<
/Button
>
<
/Button
>
<
/Popconfirm
>
<
/Popconfirm
>
<
/Space
>
<
/Space
>
<
/div
>
<
/div
>
<
Table
className
=
{
'channel-table'
}
style
=
{{
marginTop
:
15
}}
columns
=
{
columns
}
dataSource
=
{
pageData
}
pagination
=
{{
currentPage
:
activePage
,
pageSize
:
pageSize
,
total
:
channelCount
,
pageSizeOpts
:
[
10
,
20
,
50
,
100
],
showSizeChanger
:
true
,
formatPageText
:
(
page
)
=>
''
,
onPageSizeChange
:
(
size
)
=>
{
handlePageSizeChange
(
size
).
then
();
},
onPageChange
:
handlePageChange
,
}}
loading
=
{
loading
}
onRow
=
{
handleRow
}
rowSelection
=
{
enableBatchDelete
?
{
onChange
:
(
selectedRowKeys
,
selectedRows
)
=>
{
// console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
setSelectedChannels
(
selectedRows
);
},
}
:
null
}
/
>
<
/
>
<
/
>
);
);
};
};
...
...
web/src/components/LogsTable.js
View file @
e22e41c9
...
@@ -767,6 +767,22 @@ const LogsTable = () => {
...
@@ -767,6 +767,22 @@ const LogsTable = () => {
<
Form
.
Section
><
/Form.Section
>
<
Form
.
Section
><
/Form.Section
>
<
/
>
<
/
>
<
/Form
>
<
/Form
>
<
div
style
=
{{
marginTop
:
10
}}
>
<
Select
defaultValue
=
'0'
style
=
{{
width
:
120
}}
onChange
=
{(
value
)
=>
{
setLogType
(
parseInt
(
value
));
loadLogs
(
0
,
pageSize
,
parseInt
(
value
));
}}
>
<
Select
.
Option
value
=
'0'
>
全部
<
/Select.Option
>
<
Select
.
Option
value
=
'1'
>
充值
<
/Select.Option
>
<
Select
.
Option
value
=
'2'
>
消费
<
/Select.Option
>
<
Select
.
Option
value
=
'3'
>
管理
<
/Select.Option
>
<
Select
.
Option
value
=
'4'
>
系统
<
/Select.Option
>
<
/Select
>
<
/div
>
<
Table
<
Table
style
=
{{
marginTop
:
5
}}
style
=
{{
marginTop
:
5
}}
columns
=
{
columns
}
columns
=
{
columns
}
...
@@ -786,20 +802,6 @@ const LogsTable = () => {
...
@@ -786,20 +802,6 @@ const LogsTable = () => {
onPageChange
:
handlePageChange
,
onPageChange
:
handlePageChange
,
}}
}}
/
>
/
>
<
Select
defaultValue
=
'0'
style
=
{{
width
:
120
}}
onChange
=
{(
value
)
=>
{
setLogType
(
parseInt
(
value
));
loadLogs
(
0
,
pageSize
,
parseInt
(
value
));
}}
>
<
Select
.
Option
value
=
'0'
>
全部
<
/Select.Option
>
<
Select
.
Option
value
=
'1'
>
充值
<
/Select.Option
>
<
Select
.
Option
value
=
'2'
>
消费
<
/Select.Option
>
<
Select
.
Option
value
=
'3'
>
管理
<
/Select.Option
>
<
Select
.
Option
value
=
'4'
>
系统
<
/Select.Option
>
<
/Select
>
<
/Layout
>
<
/Layout
>
<
/
>
<
/
>
);
);
...
...
web/src/components/RedemptionsTable.js
View file @
e22e41c9
...
@@ -10,7 +10,7 @@ import {
...
@@ -10,7 +10,7 @@ import {
import
{
ITEMS_PER_PAGE
}
from
'../constants'
;
import
{
ITEMS_PER_PAGE
}
from
'../constants'
;
import
{
renderQuota
}
from
'../helpers/render'
;
import
{
renderQuota
}
from
'../helpers/render'
;
import
{
import
{
Button
,
Button
,
Divider
,
Form
,
Form
,
Modal
,
Modal
,
Popconfirm
,
Popconfirm
,
...
@@ -391,29 +391,8 @@ const RedemptionsTable = () => {
...
@@ -391,29 +391,8 @@ const RedemptionsTable = () => {
onChange
=
{
handleKeywordChange
}
onChange
=
{
handleKeywordChange
}
/
>
/
>
<
/Form
>
<
/Form
>
<
Divider
style
=
{{
margin
:
'5px 0 15px 0'
}}
/
>
<
Table
<
div
>
style
=
{{
marginTop
:
20
}}
columns
=
{
columns
}
dataSource
=
{
pageData
}
pagination
=
{{
currentPage
:
activePage
,
pageSize
:
ITEMS_PER_PAGE
,
total
:
tokenCount
,
// showSizeChanger: true,
// pageSizeOptions: [10, 20, 50, 100],
formatPageText
:
(
page
)
=>
`第
${
page
.
currentStart
}
-
${
page
.
currentEnd
}
条,共
${
redemptions
.
length
}
条`
,
// onPageSizeChange: (size) => {
// setPageSize(size);
// setActivePage(1);
// },
onPageChange
:
handlePageChange
,
}}
loading
=
{
loading
}
rowSelection
=
{
rowSelection
}
onRow
=
{
handleRow
}
><
/Table
>
<
Button
<
Button
theme
=
'light'
theme
=
'light'
type
=
'primary'
type
=
'primary'
...
@@ -444,6 +423,30 @@ const RedemptionsTable = () => {
...
@@ -444,6 +423,30 @@ const RedemptionsTable = () => {
>
>
复制所选兑换码到剪贴板
复制所选兑换码到剪贴板
<
/Button
>
<
/Button
>
<
/div
>
<
Table
style
=
{{
marginTop
:
20
}}
columns
=
{
columns
}
dataSource
=
{
pageData
}
pagination
=
{{
currentPage
:
activePage
,
pageSize
:
ITEMS_PER_PAGE
,
total
:
tokenCount
,
// showSizeChanger: true,
// pageSizeOptions: [10, 20, 50, 100],
formatPageText
:
(
page
)
=>
`第
${
page
.
currentStart
}
-
${
page
.
currentEnd
}
条,共
${
redemptions
.
length
}
条`
,
// onPageSizeChange: (size) => {
// setPageSize(size);
// setActivePage(1);
// },
onPageChange
:
handlePageChange
,
}}
loading
=
{
loading
}
rowSelection
=
{
rowSelection
}
onRow
=
{
handleRow
}
><
/Table
>
<
/
>
<
/
>
);
);
};
};
...
...
web/src/components/TokensTable.js
View file @
e22e41c9
...
@@ -10,7 +10,7 @@ import {
...
@@ -10,7 +10,7 @@ import {
import
{
ITEMS_PER_PAGE
}
from
'../constants'
;
import
{
ITEMS_PER_PAGE
}
from
'../constants'
;
import
{
renderGroup
,
renderQuota
}
from
'../helpers/render'
;
import
{
renderGroup
,
renderQuota
}
from
'../helpers/render'
;
import
{
import
{
Button
,
Button
,
Divider
,
Dropdown
,
Dropdown
,
Form
,
Form
,
Modal
,
Modal
,
...
@@ -596,29 +596,8 @@ const TokensTable = () => {
...
@@ -596,29 +596,8 @@ const TokensTable = () => {
查询
查询
<
/Button
>
<
/Button
>
<
/Form
>
<
/Form
>
<
Divider
style
=
{{
margin
:
'15px 0'
}}
/
>
<
Table
<
div
>
style
=
{{
marginTop
:
20
}}
columns
=
{
columns
}
dataSource
=
{
pageData
}
pagination
=
{{
currentPage
:
activePage
,
pageSize
:
pageSize
,
total
:
tokenCount
,
showSizeChanger
:
true
,
pageSizeOptions
:
[
10
,
20
,
50
,
100
],
formatPageText
:
(
page
)
=>
`第
${
page
.
currentStart
}
-
${
page
.
currentEnd
}
条,共
${
tokens
.
length
}
条`
,
onPageSizeChange
:
(
size
)
=>
{
setPageSize
(
size
);
setActivePage
(
1
);
},
onPageChange
:
handlePageChange
,
}}
loading
=
{
loading
}
rowSelection
=
{
rowSelection
}
onRow
=
{
handleRow
}
><
/Table
>
<
Button
<
Button
theme
=
'light'
theme
=
'light'
type
=
'primary'
type
=
'primary'
...
@@ -650,6 +629,30 @@ const TokensTable = () => {
...
@@ -650,6 +629,30 @@ const TokensTable = () => {
>
>
复制所选令牌到剪贴板
复制所选令牌到剪贴板
<
/Button
>
<
/Button
>
<
/div
>
<
Table
style
=
{{
marginTop
:
20
}}
columns
=
{
columns
}
dataSource
=
{
pageData
}
pagination
=
{{
currentPage
:
activePage
,
pageSize
:
pageSize
,
total
:
tokenCount
,
showSizeChanger
:
true
,
pageSizeOptions
:
[
10
,
20
,
50
,
100
],
formatPageText
:
(
page
)
=>
`第
${
page
.
currentStart
}
-
${
page
.
currentEnd
}
条,共
${
tokens
.
length
}
条`
,
onPageSizeChange
:
(
size
)
=>
{
setPageSize
(
size
);
setActivePage
(
1
);
},
onPageChange
:
handlePageChange
,
}}
loading
=
{
loading
}
rowSelection
=
{
rowSelection
}
onRow
=
{
handleRow
}
><
/Table
>
<
/
>
<
/
>
);
);
};
};
...
...
web/src/components/UsersTable.js
View file @
e22e41c9
...
@@ -476,10 +476,18 @@ const UsersTable = () => {
...
@@ -476,10 +476,18 @@ const UsersTable = () => {
type
=
'primary'
type
=
'primary'
htmlType
=
'submit'
htmlType
=
'submit'
className
=
'btn-margin-right'
className
=
'btn-margin-right'
style
=
{{
marginRight
:
8
}}
>
>
查询
查询
<
/Button
>
<
/Button
>
<
Button
theme
=
'light'
type
=
'primary'
onClick
=
{()
=>
{
setShowAddUser
(
true
);
}}
>
添加用户
<
/Button
>
<
/Space
>
<
/Space
>
<
/div
>
<
/div
>
<
/Form
>
<
/Form
>
...
@@ -496,16 +504,6 @@ const UsersTable = () => {
...
@@ -496,16 +504,6 @@ const UsersTable = () => {
}}
}}
loading
=
{
loading
}
loading
=
{
loading
}
/
>
/
>
<
Button
theme
=
'light'
type
=
'primary'
style
=
{{
marginRight
:
8
}}
onClick
=
{()
=>
{
setShowAddUser
(
true
);
}}
>
添加用户
<
/Button
>
<
/
>
<
/
>
);
);
};
};
...
...
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