From 591177e7a1fdf9c84b9ae5fb9b1537cb17e95905 Mon Sep 17 00:00:00 2001
From: Eamon-meng <17516219072@163.com>
Date: Mon, 1 Dec 2025 19:21:29 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=8F=90=E5=8F=96IP=E8=A1=A8?=
=?UTF-8?q?=E6=A0=BC=E5=AD=97=E6=AE=B5=E5=92=8C=E9=A1=B5=E9=9D=A2=E5=B1=95?=
=?UTF-8?q?=E7=A4=BA=20&=20=E5=89=8D=E7=AB=AF=E8=AE=BE=E7=BD=AE=E7=99=BD?=
=?UTF-8?q?=E5=90=8D=E5=8D=95=E6=B7=BB=E5=8A=A0=E6=95=B0=E9=87=8F=E9=99=90?=
=?UTF-8?q?=E5=88=B6=20&=20=E4=BF=AE=E5=A4=8D=E9=95=BF=E6=95=88=E5=A5=97?=
=?UTF-8?q?=E9=A4=90=E8=B4=AD=E4=B9=B0=E6=95=B0=E9=87=8F=E5=92=8C=E6=8F=90?=
=?UTF-8?q?=E5=8F=96=E6=95=B0=E9=87=8F=E9=BB=98=E8=AE=A4=E5=80=BC=E5=92=8C?=
=?UTF-8?q?=E9=80=92=E5=A2=9E=E5=87=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/app/admin/channels/page.tsx | 56 ++++++---
src/app/admin/whitelist/page.tsx | 11 +-
src/components/composites/extract/index.tsx | 9 +-
.../composites/purchase/long/center.tsx | 117 ++++++++++--------
src/lib/models/models.ts | 16 +++
5 files changed, 130 insertions(+), 79 deletions(-)
diff --git a/src/app/admin/channels/page.tsx b/src/app/admin/channels/page.tsx
index 85681e4..926e788 100644
--- a/src/app/admin/channels/page.tsx
+++ b/src/app/admin/channels/page.tsx
@@ -155,34 +155,52 @@ export default function ChannelsPage(props: ChannelsPageProps) {
}}
columns={[
{
- header: '代理地址', cell: ({row}) => `${row.original.proxy_host}:${row.original.proxy_port}`,
+ header: '代理地址', cell: ({row}) => {
+ const channel = row.original
+ const ip = channel.proxy?.ip
+ const port = channel.port
+ return `${ip}:${port}`
+ },
},
{
- header: '认证方式', cell: ({row}) => {
+ header: '认证方式',
+ cell: ({row}) => {
+ const channel = row.original
+ const hasWhitelist = channel.whitelists && channel.whitelists.trim() !== ''
+ const hasAuth = channel.username && channel.password
+
return (
-
- {row.original.auth_ip && (
- <>
-
IP 白名单
-
{row.original.whitelists.replaceAll(',', ', ')}
- >
- )}
- {row.original.auth_pass && (
- <>
-
账号密码
-
- {row.original.username}
- :
- {row.original.password}
-
- >
+
+ {hasWhitelist ? (
+
+
白名单
+
+ {channel.whitelists.split(',').map((ip, index) => (
+
+ {ip.trim()}
+
+ ))}
+
+
+ ) : hasAuth ? (
+
+
账号密码
+
+ {channel.username}:{channel.password}
+
+
+ ) : (
+
无认证
)}
)
},
},
{
- header: '过期时间', cell: ({row}) => format(row.original.expiration, 'yyyy-MM-dd HH:mm:ss'),
+ header: '过期时间', cell: ({row}) => format(row.original.expired_at, 'yyyy-MM-dd HH:mm:ss'),
},
{
header: '操作', cell: ({row}) =>
-,
diff --git a/src/app/admin/whitelist/page.tsx b/src/app/admin/whitelist/page.tsx
index e79e360..f853f8a 100644
--- a/src/app/admin/whitelist/page.tsx
+++ b/src/app/admin/whitelist/page.tsx
@@ -33,6 +33,8 @@ type SchemaType = z.infer
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) {
{/* 全局操作 */}
-