完善页尾链接功能与样式 & 修复表单提交触发问题

This commit is contained in:
2025-12-18 12:25:52 +08:00
parent dc331b63a5
commit 040ddd674b
6 changed files with 22 additions and 45 deletions

View File

@@ -90,7 +90,7 @@ export default function BillsPage(props: BillsPageProps) {
<div>
</div>
<Form form={form} onSubmit={onSubmit} className="flex items-end gap-4 flex-wrap">
<Form form={form} handler={form.handleSubmit(onSubmit)} className="flex items-end gap-4 flex-wrap">
<FormField name="type" label={<span className="text-sm"></span>}>
{({id, field}) => (
<Select value={field.value} onValueChange={field.onChange}>

View File

@@ -13,7 +13,6 @@ import logoAvatar from '@/assets/logo-avatar.svg'
import logoText from '@/assets/logo-text.svg'
import {useLayoutStore} from '@/components/stores/layout'
import {useProfileStore} from '@/components/stores/profile'
import {User} from '@/lib/models'
export function Shell(props: {
children: ReactNode
@@ -170,19 +169,20 @@ export function Navbar() {
)}>
<TooltipProvider>
<NavItem href="/admin" icon={<UserRound size={20}/>} label="账户总览" expand={navbar}/>
<NavTitle label="个人信息"/>
<NavItem href="/admin/profile" icon={<UserRoundPen size={20}/>} label="个人中心" expand={navbar}/>
<NavTitle label="快速开始"/>
<NavItem href="/admin/identify" icon={<IdCard size={20}/>} label="实名认证" expand={navbar}/>
<NavItem href="/admin/whitelist" icon={<LockKeyhole size={20}/>} label="白名单" expand={navbar}/>
<NavItem href="/admin/bills" icon={<Wallet size={20}/>} label="我的账单" expand={navbar}/>
<NavTitle label="套餐管理"/>
<NavItem href="/admin/purchase" icon={<ShoppingCart size={20}/>} label="购买套餐" expand={navbar}/>
<NavItem href="/admin/resources" icon={<Package size={20}/>} label="套餐管理" expand={navbar}/>
<NavTitle label="IP 管理"/>
<NavItem href="/admin/extract" icon={<HardDriveUpload size={20}/>} label="提取 IP" expand={navbar}/>
<NavTitle label="个人中心"/>
<NavItem href="/admin/profile" icon={<UserRoundPen size={20}/>} label="基本信息" expand={navbar}/>
<NavItem href="/admin/bills" icon={<Wallet size={20}/>} label="我的账单" expand={navbar}/>
<NavTitle label="资源管理"/>
<NavItem href="/admin/resources" icon={<Package size={20}/>} label="我的套餐" expand={navbar}/>
<NavItem href="/admin/channels" icon={<Eye size={20}/>} label="IP 管理" expand={navbar}/>
<NavItem href="/admin" icon={<Archive size={20}/>} label="提取记录" expand={navbar}/>
<NavItem href="/admin" icon={<ArchiveRestore size={20}/>} label="使用记录" expand={navbar}/>
{/* <NavTitle label="数据统计"/>
<NavItem href="/admin" icon={<ArchiveRestore size={20}/>} label="使用记录" expand={navbar}/> */}
</TooltipProvider>
</section>
</nav>

View File

@@ -148,19 +148,6 @@ export default function WhitelistPage(props: WhitelistPageProps) {
setSelection(new Set(selection))
}
const toggleSelectAll = () => {
if (selection.size === data.list.length) {
setSelection(new Set())
}
else {
const newSelection = new Set<number>()
data.list.forEach((item) => {
newSelection.add(item.id)
})
setSelection(newSelection)
}
}
// ======================
// 表单
// ======================
@@ -316,7 +303,7 @@ export default function WhitelistPage(props: WhitelistPageProps) {
<Form<SchemaType>
className="flex flex-col gap-4 py-4"
form={form}
onSubmit={onSubmit}>
handler={form.handleSubmit(onSubmit)}>
<FormField name="host" label="IP地址">
{({id, field}) => (
<div className="flex gap-2">