修复提取IP表格字段和页面展示 & 前端设置白名单添加数量限制 & 修复长效套餐购买数量和提取数量默认值和递增减
This commit is contained in:
@@ -33,6 +33,8 @@ type SchemaType = z.infer<typeof schema>
|
||||
|
||||
export type WhitelistPageProps = {}
|
||||
|
||||
const MAX_WHITELIST_COUNT = 5
|
||||
|
||||
export default function WhitelistPage(props: WhitelistPageProps) {
|
||||
const [wait, setWait] = useState(false)
|
||||
|
||||
@@ -53,6 +55,8 @@ export default function WhitelistPage(props: WhitelistPageProps) {
|
||||
setWait(true)
|
||||
try {
|
||||
const resp = await listWhitelist({page, size})
|
||||
console.log(resp, '白名单resp')
|
||||
|
||||
if (!resp.success) {
|
||||
throw new Error(resp.message)
|
||||
}
|
||||
@@ -227,9 +231,10 @@ export default function WhitelistPage(props: WhitelistPageProps) {
|
||||
|
||||
{/* 全局操作 */}
|
||||
<section>
|
||||
<Button onClick={() => openDialog('add')} disabled={wait}>
|
||||
<Button onClick={() => openDialog('add')} disabled={wait || data.total >= MAX_WHITELIST_COUNT}>
|
||||
<Plus/>
|
||||
添加白名单
|
||||
{data.total >= MAX_WHITELIST_COUNT && '(已达上限)'}
|
||||
</Button>
|
||||
{/* <Button
|
||||
theme="fail"
|
||||
@@ -254,7 +259,7 @@ export default function WhitelistPage(props: WhitelistPageProps) {
|
||||
}}
|
||||
columns={[
|
||||
{
|
||||
header: `IP 地址`, accessorKey: 'host',
|
||||
header: `IP 地址`, accessorKey: 'ip',
|
||||
},
|
||||
{
|
||||
header: `备注`, accessorKey: 'remark',
|
||||
@@ -264,7 +269,7 @@ export default function WhitelistPage(props: WhitelistPageProps) {
|
||||
},
|
||||
{
|
||||
id: 'actions', header: `操作`, cell: ({row}) => (
|
||||
<div className="flex justify-end gap-2">
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
className="h-9 w-9"
|
||||
theme="outline"
|
||||
|
||||
Reference in New Issue
Block a user