From 6e623530969fa23f0cc879d0942bc1cdc1d686b7 Mon Sep 17 00:00:00 2001 From: speakeloudest Date: Thu, 24 Jul 2025 17:18:32 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E8=B5=9E=E5=8A=A9?= =?UTF-8?q?=E5=95=86=E6=A8=A1=E5=9D=97=EF=BC=8C=E5=88=A0=E9=99=A4=E6=96=B0?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/admin/app/dashboard/page.tsx | 2 - apps/admin/app/dashboard/payment/page.tsx | 4 - apps/admin/app/dashboard/tool/page.tsx | 27 ------ apps/admin/components/billing.tsx | 86 ------------------- .../app/(main)/(user)/dashboard/content.tsx | 4 +- 5 files changed, 2 insertions(+), 121 deletions(-) delete mode 100644 apps/admin/components/billing.tsx diff --git a/apps/admin/app/dashboard/page.tsx b/apps/admin/app/dashboard/page.tsx index e91e3d6..6598879 100644 --- a/apps/admin/app/dashboard/page.tsx +++ b/apps/admin/app/dashboard/page.tsx @@ -1,11 +1,9 @@ -import Billing from '@/components/billing'; import Statistics from '@/components/dashboard/statistics'; export default function Dashboard() { return (
-
); } diff --git a/apps/admin/app/dashboard/payment/page.tsx b/apps/admin/app/dashboard/payment/page.tsx index a9c00d3..8a28a10 100644 --- a/apps/admin/app/dashboard/payment/page.tsx +++ b/apps/admin/app/dashboard/payment/page.tsx @@ -1,13 +1,9 @@ -import Billing from '@/components/billing'; import PaymentTable from './payment-table'; export default async function Page() { return ( <> -
- -
); } diff --git a/apps/admin/app/dashboard/tool/page.tsx b/apps/admin/app/dashboard/tool/page.tsx index 04dd83f..d02407c 100644 --- a/apps/admin/app/dashboard/tool/page.tsx +++ b/apps/admin/app/dashboard/tool/page.tsx @@ -210,30 +210,8 @@ export default function Page() { V{packageJson.version} - {hasNewVersion && ( - - {t('newVersionAvailable')} - - )} - {hasNewVersion && ( - - )} {/* 服务端版本 */} @@ -251,11 +229,6 @@ export default function Page() { {t('developmentVersion')} )} - {hasServerNewVersion && ( - - {t('newVersionAvailable')} - - )}
diff --git a/apps/admin/components/billing.tsx b/apps/admin/components/billing.tsx deleted file mode 100644 index 7de357a..0000000 --- a/apps/admin/components/billing.tsx +++ /dev/null @@ -1,86 +0,0 @@ -import { Avatar, AvatarFallback, AvatarImage } from '@workspace/ui/components/avatar'; -import { Card, CardDescription, CardHeader, CardTitle } from '@workspace/ui/components/card'; -import { getTranslations } from 'next-intl/server'; -import Link from 'next/link'; - -interface BillingProps { - type: 'dashboard' | 'payment'; -} - -interface ItemType { - logo: string; - title: string; - description: string; - expiryDate: string; - href: string; -} - -async function getBillingURL() { - try { - const response = await fetch( - 'https://api.github.com/repos/perfect-panel/ppanel-assets/commits', - ); - const json = await response.json(); - const version = json[0]?.sha; - const url = new URL('https://cdn.jsdelivr.net/gh/perfect-panel/ppanel-assets'); - url.pathname += `@${version}/billing/index.json`; - return url.toString(); - } catch (error) { - return 'https://cdn.jsdelivr.net/gh/perfect-panel/ppanel-assets/billing/index.json'; - } -} - -export default async function Billing({ type }: BillingProps) { - const t = await getTranslations('common.billing'); - let list: ItemType[] = []; - - try { - const url = await getBillingURL(); - const response = await fetch(url, { - headers: { - Accept: 'application/json', - }, - }); - const data = await response.json(); - const now = Date.now(); - - list = Array.isArray(data[type]) - ? data[type].filter((item: { expiryDate: string }) => { - const expiryDate = Date.parse(item.expiryDate); - return !isNaN(expiryDate) && expiryDate > now; - }) - : []; - } catch (error) { - console.log(error); - return null; - } - - if (!list?.length) return null; - - return ( - <> -

- {t('title')} - {t('description')} -

-
- {list.map((item, index) => ( - - - - - - {item.title} - -
- {item.title} - {item.description} -
-
-
- - ))} -
- - ); -} diff --git a/apps/user/app/(main)/(user)/dashboard/content.tsx b/apps/user/app/(main)/(user)/dashboard/content.tsx index fdb17b6..ffa2e21 100644 --- a/apps/user/app/(main)/(user)/dashboard/content.tsx +++ b/apps/user/app/(main)/(user)/dashboard/content.tsx @@ -121,7 +121,7 @@ export default function Content() {
- setPlatform(value as keyof API.ApplicationPlatform)} className='w-full max-w-full md:w-auto' @@ -145,7 +145,7 @@ export default function Content() { ))} - + */} {data?.protocol && data?.protocol.length > 1 && (