添加白名单上限提示

This commit is contained in:
2025-12-20 16:07:38 +08:00
parent ea3469eb1c
commit c979765a77
2 changed files with 8 additions and 3 deletions

View File

@@ -1,7 +1,5 @@
## TODO ## TODO
提取记录,长效动态统计
购买页固定套餐 购买页固定套餐
### 禁止直接依赖 form ### 禁止直接依赖 form
@@ -10,6 +8,8 @@
### 次要 ### 次要
业务定制页面每月需求用量,可选项需要确认是否合理
页头高度降低 页头高度降低
帮助中心文档优化 帮助中心文档优化

View File

@@ -24,6 +24,7 @@ import Page from '@/components/page'
import DataTable from '@/components/data-table' import DataTable from '@/components/data-table'
import {format, parseISO} from 'date-fns' import {format, parseISO} from 'date-fns'
import {getClientIp} from '@/actions/ip' import {getClientIp} from '@/actions/ip'
import {Alert, AlertTitle} from '@/components/ui/alert'
const schema = z.object({ const schema = z.object({
host: z.string().min(1, {message: 'IP地址不能为空'}), host: z.string().min(1, {message: 'IP地址不能为空'}),
remark: z.string().optional(), remark: z.string().optional(),
@@ -241,10 +242,14 @@ export default function WhitelistPage(props: WhitelistPageProps) {
<Button onClick={() => openDialog('add')} disabled={wait || data.total >= MAX_WHITELIST_COUNT}> <Button onClick={() => openDialog('add')} disabled={wait || data.total >= MAX_WHITELIST_COUNT}>
<Plus/> <Plus/>
{data.total >= MAX_WHITELIST_COUNT && '(已达上限)'}
</Button> </Button>
</section> </section>
{/* 全局提示 */}
<Alert>
<AlertTitle> {data.total}/{MAX_WHITELIST_COUNT}</AlertTitle>
</Alert>
{/* 数据表 */} {/* 数据表 */}
<DataTable <DataTable
status={status} status={status}