️ improve: webUI improve

This commit is contained in:
MartialBE 2024-04-05 15:56:42 +08:00
parent 7503b688ed
commit bd74a1d4ac
No known key found for this signature in database
GPG Key ID: F5A7AC860020C896
6 changed files with 26 additions and 13 deletions

View File

@ -1,9 +1,12 @@
import { styled } from '@mui/material/styles';
import { Container } from '@mui/material';
const AdminContainer = styled(Container)({
const AdminContainer = styled(Container)(({ theme }) => ({
paddingLeft: '0px !important',
paddingRight: '0px !important'
});
paddingRight: '0px !important',
[theme.breakpoints.up('md')]: {
maxWidth: '1400px'
}
}));
export default AdminContainer;

View File

@ -31,7 +31,7 @@ const KeywordTableHead = ({ order, orderBy, headLabel, onRequestSort }) => {
headCell.hide && headCell.hide === true ? null : (
<TableCell
key={headCell.id}
align={headCell.align || 'left'}
align={headCell.align || 'right'}
// sortDirection={orderBy === headCell.id ? order : false}
sx={{ width: headCell.width, minWidth: headCell.minWidth }}
>

View File

@ -257,7 +257,7 @@ export default function ChannelTableRow({ item, manageChannel, handleOpenModal,
</TableCell>
<TableCell>
<Stack direction="row" spacing={1}>
<Stack direction="row" justifyContent="center" alignItems="center" spacing={1}>
<Button
id="test-model-button"
aria-controls={openTest ? 'test-model-menu' : undefined}
@ -267,6 +267,7 @@ export default function ChannelTableRow({ item, manageChannel, handleOpenModal,
disableElevation
onClick={handleTestModel}
endIcon={<KeyboardArrowDownIcon />}
size="small"
>
测试
</Button>

View File

@ -182,7 +182,8 @@ const Single = ({ ownedby, prices, reloadData }) => {
field: 'model',
sortable: true,
headerName: '模型名称',
width: 220,
minWidth: 220,
flex: 1,
editable: true,
hideable: false
},
@ -190,7 +191,8 @@ const Single = ({ ownedby, prices, reloadData }) => {
field: 'type',
sortable: true,
headerName: '类型',
width: 220,
flex: 1,
minWidth: 220,
type: 'singleSelect',
valueOptions: priceType,
editable: true,
@ -200,7 +202,8 @@ const Single = ({ ownedby, prices, reloadData }) => {
field: 'channel_type',
sortable: true,
headerName: '供应商',
width: 220,
flex: 1,
minWidth: 220,
type: 'singleSelect',
valueOptions: ownedby,
editable: true,
@ -210,7 +213,8 @@ const Single = ({ ownedby, prices, reloadData }) => {
field: 'input',
sortable: false,
headerName: '输入倍率',
width: 150,
flex: 0.8,
minWidth: 150,
type: 'number',
editable: true,
valueFormatter: (params) => ValueFormatter(params.value),
@ -220,7 +224,8 @@ const Single = ({ ownedby, prices, reloadData }) => {
field: 'output',
sortable: false,
headerName: '输出倍率',
width: 150,
flex: 0.8,
minWidth: 150,
type: 'number',
editable: true,
valueFormatter: (params) => ValueFormatter(params.value),
@ -230,7 +235,9 @@ const Single = ({ ownedby, prices, reloadData }) => {
field: 'actions',
type: 'actions',
headerName: '操作',
width: 100,
flex: 0.5,
minWidth: 100,
// width: 100,
cellClassName: 'actions',
hideable: false,
getActions: ({ id }) => {
@ -320,6 +327,7 @@ const Single = ({ ownedby, prices, reloadData }) => {
>
<DataGrid
autoHeight
autosizeOnMount
rows={rows}
columns={modelRatioColumns}
editMode="row"

View File

@ -78,10 +78,11 @@ export default function RedemptionTableRow({ item, manageRedemption, handleOpenM
<TableCell>{timestamp2string(item.created_time)}</TableCell>
<TableCell>{item.redeemed_time ? timestamp2string(item.redeemed_time) : '尚未兑换'}</TableCell>
<TableCell>
<Stack direction="row" spacing={1}>
<Stack direction="row" justifyContent="center" alignItems="center" spacing={1}>
<Button
variant="contained"
color="primary"
size="small"
onClick={() => {
copy(item.key, '兑换码');
}}

View File

@ -205,7 +205,7 @@ export default function TokensTableRow({ item, manageToken, handleOpenModal, set
<TableCell>{item.expired_time === -1 ? '永不过期' : timestamp2string(item.expired_time)}</TableCell>
<TableCell>
<Stack direction="row" spacing={1}>
<Stack direction="row" justifyContent="center" alignItems="center" spacing={1}>
<ButtonGroup size="small" aria-label="split button">
<Button
color="primary"