Compare commits

19 Commits

Author SHA1 Message Date
shanshanzhong147 52b62694c3 merge: 合并 main 分支到 dev,保留动态 SSH 配置
CI / build (20.15.1) (push) Has been cancelled
2025-10-06 00:12:56 -07:00
shanshanzhong147 36419f9bf2 feat: 根据分支动态选择SSH参数 2025-10-06 00:10:54 -07:00
sepakeloudest 5576135726 fix: admin提交样式
CI / build (20.15.1) (push) Failing after 3s
2025-10-05 08:36:26 -07:00
sepakeloudest 02da429358 fix: 提交样式
CI / build (20.15.1) (push) Failing after 4s
2025-10-05 08:23:07 -07:00
shanshanzhong147 71d768bd9e 更新用户面板界面 [user-only]
CI / build (20.15.1) (push) Successful in 21m27s
2025-09-28 20:31:17 -07:00
shanshanzhong147 3b7c8bbcb2 更新管理面板界面 [admin-only]
CI / build (20.15.1) (push) Has been cancelled
2025-09-28 20:15:38 -07:00
shanshanzhong147 ccfd5be59f tg
CI / build (20.15.1) (push) Has been cancelled
2025-09-28 19:48:57 -07:00
shanshanzhong147 96aa507f77 cicd
CI / build (20.15.1) (push) Failing after 25m32s
2025-09-28 18:06:33 -07:00
shanshanzhong147 95f614a51e x
CI / build (20.15.1) (push) Failing after 28m55s
2025-09-27 10:52:48 -07:00
shanshanzhong147 4745f230b2 init
CI / build (20.15.1) (push) Failing after 17m48s
2025-09-25 09:35:56 -07:00
shanshanzhong147 bad2843bfb init 2025-09-25 09:34:46 -07:00
shanshanzhong147 cc2f715e77 init 2025-09-25 09:32:47 -07:00
shanshanzhong147 6df5f6a8db init 2025-09-25 09:30:17 -07:00
shanshanzhong147 6524911c31 init 2025-09-25 09:29:54 -07:00
sepakeloudest 330a8c128b fix: 样式修改
Publish Release Assets / Publish Release Assets (push) Has been cancelled
2025-09-25 06:16:07 -07:00
sepakeloudest e020a53020 fix: 国际化 2025-09-25 02:41:08 -07:00
sepakeloudest 8aa9b5694a fix: 增加默认状态 2025-09-25 02:32:17 -07:00
sepakeloudest 804af6b1fc fix: 修改下载路径 2025-09-24 22:45:23 -07:00
sepakeloudest f3d2590a44 fix: 修改下载路径 2025-09-24 20:29:28 -07:00
10 changed files with 228 additions and 163 deletions
+40 -42
View File
@@ -13,17 +13,17 @@ on:
- cicd - cicd
env: env:
DOMAIN_URL: git.kxsw.us #*修改为你12 DOMAIN_URL: git.kxsw.us
REPO: ${{ vars.REPO }} REPO: ${{ vars.REPO }}
TELEGRAM_BOT_TOKEN: 8114337882:AAHkEx03HSu7RxN4IHBJJEnsK9aPPzNLIk0 TELEGRAM_BOT_TOKEN: 8114337882:AAHkEx03HSu7RxN4IHBJJEnsK9aPPzNLIk0
TELEGRAM_CHAT_ID: "-4940243803" TELEGRAM_CHAT_ID: "-4940243803"
DOCKER_REGISTRY: registry.kxsw.us DOCKER_REGISTRY: registry.kxsw.us
DOCKER_BUILDKIT: 1 DOCKER_BUILDKIT: 1
# Host SSH # Host SSH - 根据分支动态选择
SSH_HOST: ${{ vars.SSH_HOST }} SSH_HOST: ${{ github.ref_name == 'main' && vars.PRO_SSH_HOST || (github.ref_name == 'dev' && vars.DEV_SSH_HOST || vars.PRO_SSH_HOST) }}
SSH_PORT: ${{ vars.SSH_PORT }} SSH_PORT: ${{ github.ref_name == 'main' && vars.PRO_SSH_PORT || (github.ref_name == 'dev' && vars.DEV_SSH_PORT || vars.PRO_SSH_PORT) }}
SSH_USER: ${{ vars.SSH_USER }} SSH_USER: ${{ github.ref_name == 'main' && vars.PRO_SSH_USER || (github.ref_name == 'dev' && vars.DEV_SSH_USER || vars.PRO_SSH_USER) }}
SSH_PASSWORD: ${{ vars.SSH_PASSWORD }} SSH_PASSWORD: ${{ github.ref_name == 'main' && vars.PRO_SSH_PASSWORD || (github.ref_name == 'dev' && vars.DEV_SSH_PASSWORD || vars.PRO_SSH_PASSWORD) }}
jobs: jobs:
build: build:
@@ -213,9 +213,9 @@ jobs:
continue-on-error: true continue-on-error: true
with: with:
path: .turbo path: .turbo
key: turbo-${{ runner.os }}-${{ hashFiles('turbo.json') }}-${{ hashFiles('apps/**/package.json') }}-${{ hashFiles('packages/**/package.json') }}-${{ hashFiles('bun.lock') }} key: turbo-${{ runner.os }}-${{ hashFiles('turbo.json') }}-${{ hashFiles('apps//package.json') }}-${{ hashFiles('packages//package.json') }}-${{ hashFiles('bun.lock') }}
restore-keys: | restore-keys: |
turbo-${{ runner.os }}-${{ hashFiles('turbo.json') }}-${{ hashFiles('apps/**/package.json') }}-${{ hashFiles('packages/**/package.json') }}- turbo-${{ runner.os }}-${{ hashFiles('turbo.json') }}-${{ hashFiles('apps//package.json') }}-${{ hashFiles('packages//package.json') }}-
turbo-${{ runner.os }}-${{ hashFiles('turbo.json') }}- turbo-${{ runner.os }}-${{ hashFiles('turbo.json') }}-
turbo-${{ runner.os }}- turbo-${{ runner.os }}-
@@ -313,9 +313,9 @@ jobs:
path: | path: |
apps/admin/.next/cache apps/admin/.next/cache
apps/user/.next/cache apps/user/.next/cache
key: nextcache-${{ runner.os }}-${{ hashFiles('apps/**/package.json') }}-${{ hashFiles('packages/**/package.json') }}-${{ hashFiles('turbo.json') }}-${{ hashFiles('bun.lock') }} key: nextcache-${{ runner.os }}-${{ hashFiles('apps//package.json') }}-${{ hashFiles('packages//package.json') }}-${{ hashFiles('turbo.json') }}-${{ hashFiles('bun.lock') }}
restore-keys: | restore-keys: |
nextcache-${{ runner.os }}-${{ hashFiles('apps/**/package.json') }}-${{ hashFiles('packages/**/package.json') }}- nextcache-${{ runner.os }}-${{ hashFiles('apps//package.json') }}-${{ hashFiles('packages//package.json') }}-
nextcache-${{ runner.os }}- nextcache-${{ runner.os }}-
- name: Cache build outputs - name: Cache build outputs
@@ -328,9 +328,9 @@ jobs:
apps/user/.next apps/user/.next
apps/admin/dist apps/admin/dist
apps/user/dist apps/user/dist
key: build-${{ runner.os }}-${{ hashFiles('apps/**/*.ts', 'apps/**/*.tsx', 'apps/**/*.js', 'apps/**/*.jsx') }}-${{ hashFiles('packages/**/*.ts', 'packages/**/*.tsx') }}-${{ hashFiles('bun.lock') }} key: build-${{ runner.os }}-${{ hashFiles('apps//*.ts', 'apps//*.tsx', 'apps//*.js', 'apps//*.jsx') }}-${{ hashFiles('packages//*.ts', 'packages//*.tsx') }}-${{ hashFiles('bun.lock') }}
restore-keys: | restore-keys: |
build-${{ runner.os }}-${{ hashFiles('apps/**/*.ts', 'apps/**/*.tsx', 'apps/**/*.js', 'apps/**/*.jsx') }}- build-${{ runner.os }}-${{ hashFiles('apps//*.ts', 'apps//*.tsx', 'apps//*.js', 'apps//*.jsx') }}-
build-${{ runner.os }}- build-${{ runner.os }}-
- name: Cache ESLint - name: Cache ESLint
@@ -342,7 +342,7 @@ jobs:
.eslintcache .eslintcache
apps/admin/.eslintcache apps/admin/.eslintcache
apps/user/.eslintcache apps/user/.eslintcache
key: eslint-${{ runner.os }}-${{ hashFiles('.eslintrc*', 'apps/**/.eslintrc*', 'packages/**/.eslintrc*') }}-${{ hashFiles('bun.lock') }} key: eslint-${{ runner.os }}-${{ hashFiles('.eslintrc*', 'apps//.eslintrc*', 'packages//.eslintrc*') }}-${{ hashFiles('bun.lock') }}
restore-keys: | restore-keys: |
eslint-${{ runner.os }}- eslint-${{ runner.os }}-
@@ -355,8 +355,8 @@ jobs:
.tsbuildinfo .tsbuildinfo
apps/admin/.tsbuildinfo apps/admin/.tsbuildinfo
apps/user/.tsbuildinfo apps/user/.tsbuildinfo
packages/**/.tsbuildinfo packages//.tsbuildinfo
key: typescript-${{ runner.os }}-${{ hashFiles('tsconfig*.json', 'apps/**/tsconfig*.json', 'packages/**/tsconfig*.json') }}-${{ hashFiles('bun.lock') }} key: typescript-${{ runner.os }}-${{ hashFiles('tsconfig*.json', 'apps//tsconfig*.json', 'packages//tsconfig*.json') }}-${{ hashFiles('bun.lock') }}
restore-keys: | restore-keys: |
typescript-${{ runner.os }}- typescript-${{ runner.os }}-
@@ -724,42 +724,40 @@ jobs:
# 步骤5: TG通知 (成功) # 步骤5: TG通知 (成功)
- name: 📱 发送成功通知到Telegram - name: 📱 发送成功通知到Telegram
if: success() if: success()
uses: chapvic/telegram-notify@master uses: appleboy/telegram-action@master
with: with:
bot_token: ${{ env.TELEGRAM_BOT_TOKEN }} token: ${{ env.TELEGRAM_BOT_TOKEN }}
chat_id: ${{ env.TELEGRAM_CHAT_ID }} to: ${{ env.TELEGRAM_CHAT_ID }}
message: | message: |
**部署成功!** ✅ 部署成功!
📦 **项目**: ${{ github.repository }} 📦 项目: ${{ github.repository }}
🌿 **分支**: ${{ github.ref_name }} 🌿 分支: ${{ github.ref_name }}
🔖 **版本**: ${{ env.VERSION }} 🔖 版本: ${{ env.VERSION }}
🎯 **构建目标**: ${{ env.BUILD_TARGET }} 🎯 构建目标: ${{ env.BUILD_TARGET }}
🔗 **API地址**: ${{ env.NEXT_PUBLIC_API_URL }} 🔗 API地址: ${{ env.NEXT_PUBLIC_API_URL }}
📝 **提交**: ${{ github.sha }} 📝 提交: ${{ github.sha }}
👤 **提交者**: ${{ github.actor }} 👤 提交者: ${{ github.actor }}
🕐 **时间**: ${{ github.event.head_commit.timestamp }} 🕐 时间: ${{ github.event.head_commit.timestamp }}
🚀 **服务已成功部署到生产环境** 🚀 服务已成功部署到生产环境
parse_mode: Markdown
# 步骤5: TG通知 (失败) # 步骤5: TG通知 (失败)
- name: 📱 发送失败通知到Telegram - name: 📱 发送失败通知到Telegram
if: failure() if: failure()
uses: chapvic/telegram-notify@master uses: appleboy/telegram-action@master
with: with:
bot_token: ${{ env.TELEGRAM_BOT_TOKEN }} token: ${{ env.TELEGRAM_BOT_TOKEN }}
chat_id: ${{ env.TELEGRAM_CHAT_ID }} to: ${{ env.TELEGRAM_CHAT_ID }}
message: | message: |
**部署失败!** ❌ 部署失败!
📦 **项目**: ${{ github.repository }} 📦 项目: ${{ github.repository }}
🌿 **分支**: ${{ github.ref_name }} 🌿 分支: ${{ github.ref_name }}
🔖 **版本**: ${{ env.VERSION }} 🔖 版本: ${{ env.VERSION }}
🎯 **构建目标**: ${{ env.BUILD_TARGET }} 🎯 构建目标: ${{ env.BUILD_TARGET }}
📝 **提交**: ${{ github.sha }} 📝 提交: ${{ github.sha }}
👤 **提交者**: ${{ github.actor }} 👤 提交者: ${{ github.actor }}
🕐 **时间**: ${{ github.event.head_commit.timestamp }} 🕐 时间: ${{ github.event.head_commit.timestamp }}
⚠️ **请检查构建日志获取详细信息** ⚠️ 请检查构建日志获取详细信息
parse_mode: Markdown
@@ -134,7 +134,9 @@ export function UserDetail({ id }: { id: number }) {
<HoverCardTrigger asChild> <HoverCardTrigger asChild>
<Button variant='link' className='p-0' asChild> <Button variant='link' className='p-0' asChild>
<Link href={`/dashboard/user/${id}`}> <Link href={`/dashboard/user/${id}`}>
{data?.auth_methods[0]?.auth_identifier || t('loading')} {data?.auth_methods[0]?.auth_identifier
? `${data?.auth_methods[0]?.auth_identifier} (${data?.remark})`
: t('loading')}
</Link> </Link>
</Button> </Button>
</HoverCardTrigger> </HoverCardTrigger>
@@ -28,9 +28,11 @@ import {
import { Popover, PopoverContent, PopoverTrigger } from '@workspace/airo-ui/components/popover'; import { Popover, PopoverContent, PopoverTrigger } from '@workspace/airo-ui/components/popover';
import { Tabs, TabsList, TabsTrigger } from '@workspace/airo-ui/components/tabs'; import { Tabs, TabsList, TabsTrigger } from '@workspace/airo-ui/components/tabs';
import { differenceInDays } from '@workspace/airo-ui/utils'; import { differenceInDays } from '@workspace/airo-ui/utils';
import Link from 'next/link';
import { QRCodeCanvas } from 'qrcode.react'; import { QRCodeCanvas } from 'qrcode.react';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { CopyToClipboard } from 'react-copy-to-clipboard'; import { CopyToClipboard } from 'react-copy-to-clipboard';
interface SubscribeCardProps { interface SubscribeCardProps {
userSubscribeData: API.UserSubscribe; userSubscribeData: API.UserSubscribe;
protocol: string[]; protocol: string[];
@@ -53,7 +55,7 @@ const SubscribeCard = (props: SubscribeCardProps) => {
if (list.length > 0) { if (list.length > 0) {
setUserSubscribeProtocolCurrent(0); setUserSubscribeProtocolCurrent(0);
} }
}, [props.userSubscribeData.token, protocol]); }, [props.userSubscribeData?.token, protocol]);
return ( return (
<div className='space-y-2 sm:space-y-4'> <div className='space-y-2 sm:space-y-4'>
@@ -69,11 +71,15 @@ const SubscribeCard = (props: SubscribeCardProps) => {
{t('totalTraffic')} {t('totalTraffic')}
</p> </p>
<p className='text-xs font-medium text-[#0F2C53] sm:text-base'> <p className='text-xs font-medium text-[#0F2C53] sm:text-base'>
{userSubscribeData?.status === 1 ? (
<Display <Display
type='traffic' type='traffic'
value={userSubscribeData.traffic} value={userSubscribeData.traffic}
unlimited={!userSubscribeData.traffic} unlimited={!userSubscribeData.traffic}
/> />
) : (
'0.00GB'
)}
</p> </p>
</div> </div>
<div> <div>
@@ -81,9 +87,15 @@ const SubscribeCard = (props: SubscribeCardProps) => {
{t('nextResetDays')} {t('nextResetDays')}
</p> </p>
<p className='text-xs font-medium text-[#0F2C53] sm:text-base'> <p className='text-xs font-medium text-[#0F2C53] sm:text-base'>
{userSubscribeData?.status === 1 ? (
<>
{userSubscribeData.reset_time {userSubscribeData.reset_time
? differenceInDays(new Date(userSubscribeData.reset_time), new Date()) ? differenceInDays(new Date(userSubscribeData.reset_time), new Date())
: t('noReset')} : t('noReset')}
</>
) : (
'N/A'
)}
</p> </p>
</div> </div>
<div> <div>
@@ -91,17 +103,30 @@ const SubscribeCard = (props: SubscribeCardProps) => {
{t('expirationDays')} {t('expirationDays')}
</p> </p>
<p className='text-xs font-medium text-[#0F2C53] sm:text-base'> <p className='text-xs font-medium text-[#0F2C53] sm:text-base'>
{userSubscribeData?.status === 1 ? (
<>
{userSubscribeData.expire_time {userSubscribeData.expire_time
? differenceInDays(new Date(userSubscribeData.expire_time), new Date()) || ? differenceInDays(new Date(userSubscribeData.expire_time), new Date()) ||
t('unknown') t('unknown')
: t('noLimit')} : t('noLimit')}
</>
) : (
'N/A'
)}
</p> </p>
</div> </div>
</div> </div>
</div> </div>
{/* 订阅链接 */} {/* 订阅链接 */}
<div className='rounded-[26px] bg-[#EAEAEA] p-2 sm:p-4'> <div className='relative rounded-[26px] bg-[#EAEAEA] p-2 sm:p-4'>
{userSubscribeData?.status !== 1 && (
<div className='absolute inset-0 z-40 flex h-full w-full items-center justify-center rounded-[26px] border-4 border-[#D9D9D9] bg-white/50 backdrop-blur-[1px]'>
<AiroButton variant={'primary'} asChild>
<Link href={'/subscribe'}>{t('buySubscriptionNow')}</Link>
</AiroButton>
</div>
)}
<div className='mb-3 flex flex-wrap justify-between gap-4'> <div className='mb-3 flex flex-wrap justify-between gap-4'>
{props.protocol.length > 1 && ( {props.protocol.length > 1 && (
<Tabs <Tabs
@@ -126,21 +151,21 @@ const SubscribeCard = (props: SubscribeCardProps) => {
<div className={'mb-3 flex items-center justify-center gap-3'}> <div className={'mb-3 flex items-center justify-center gap-3'}>
<div <div
className={ className={
'flex flex-1 items-center gap-1 rounded-full bg-[#BABABA] pl-1 sm:gap-2 sm:rounded-[16px] sm:pl-2' 'flex flex-1 items-center gap-1 rounded-full bg-[#BABABA] pl-1 sm:gap-2 sm:pl-2'
} }
> >
<Select <Select
value={userSubscribeProtocolCurrent} value={userSubscribeProtocolCurrent}
onValueChange={setUserSubscribeProtocolCurrent} onValueChange={setUserSubscribeProtocolCurrent}
> >
<SelectTrigger className='h-auto w-auto flex-shrink-0 rounded-[16px] border-none bg-[#D9D9D9] px-2.5 py-0.5 text-[13px] font-medium text-[#0F2C53] shadow-none hover:bg-[#848484] focus:ring-0 sm:h-[35px] sm:rounded-[8px] sm:px-2 sm:py-1.5 [&>svg]:hidden'> <SelectTrigger className='h-auto w-auto flex-shrink-0 rounded-[16px] border-none bg-[#D9D9D9] px-2.5 py-0.5 text-[13px] font-medium text-[#0F2C53] shadow-none hover:bg-[#848484] focus:ring-0 sm:h-[35px] sm:px-2 sm:py-1.5 [&>svg]:hidden'>
<SelectValue> <SelectValue>
<div className='flex flex-col items-center justify-between text-[10px] sm:text-xs'> <div className='flex flex-col items-center justify-between text-[10px] sm:text-xs'>
<div> <div>
{t('subscriptionUrl')} {t('subscriptionUrl')}
{userSubscribeProtocolCurrent + 1} {userSubscribeProtocolCurrent + 1}
</div> </div>
<div className='-mt-0.5 h-0 w-0 scale-50 border-l-[3px] border-r-[3px] border-t-[3px] border-l-transparent border-r-transparent border-t-[#0F2C53] sm:scale-100'></div> <div className='h-0 w-0 scale-50 border-l-[3px] border-r-[3px] border-t-[3px] border-l-transparent border-r-transparent border-t-[#0F2C53] sm:scale-100'></div>
</div> </div>
</SelectValue> </SelectValue>
</SelectTrigger> </SelectTrigger>
@@ -158,7 +183,7 @@ const SubscribeCard = (props: SubscribeCardProps) => {
</SelectContent> </SelectContent>
</Select> </Select>
<div className='flex-1 rounded-full bg-white px-3 py-2 text-[10px] leading-tight text-[#225BA9] shadow-[inset_0px_0px_7.6px_0px_rgba(0,0,0,0.25)] sm:rounded-[16px]'> <div className='flex-1 rounded-full bg-white px-3 py-2 text-[10px] leading-tight text-[#225BA9] shadow-[inset_0px_0px_7.6px_0px_rgba(0,0,0,0.25)]'>
<div className={'flex items-center gap-4 py-1'}> <div className={'flex items-center gap-4 py-1'}>
<div className={'line-clamp-2 flex-1 break-all'}> <div className={'line-clamp-2 flex-1 break-all'}>
{userSubscribeProtocol[userSubscribeProtocolCurrent]} {userSubscribeProtocol[userSubscribeProtocolCurrent]}
@@ -203,7 +228,7 @@ const SubscribeCard = (props: SubscribeCardProps) => {
<div className='flex justify-between gap-2'> <div className='flex justify-between gap-2'>
<AlertDialog> <AlertDialog>
<AlertDialogTrigger asChild> <AlertDialogTrigger asChild>
<AiroButton variant='danger' className={'px-2 text-xs'}> <AiroButton variant='primaryBlue' className={'px-2 text-xs'}>
{t('resetSubscription')} {t('resetSubscription')}
</AiroButton> </AiroButton>
</AlertDialogTrigger> </AlertDialogTrigger>
@@ -231,7 +256,7 @@ const SubscribeCard = (props: SubscribeCardProps) => {
<Renewal <Renewal
className='px-2 text-xs' className='px-2 text-xs'
id={userSubscribeData.id} id={userSubscribeData.id}
subscribe={userSubscribeData.subscribe} subscribe={userSubscribeData.subscribe || {}}
/> />
</div> </div>
</div> </div>
@@ -27,7 +27,6 @@ import { Empty } from '@/components/empty';
import SvgIcon from '@/components/SvgIcon'; import SvgIcon from '@/components/SvgIcon';
import { queryAnnouncement } from '@/services/user/announcement'; import { queryAnnouncement } from '@/services/user/announcement';
import { queryOrderList } from '@/services/user/order'; import { queryOrderList } from '@/services/user/order';
import { default as Airo_Empty } from '@workspace/airo-ui/custom-components/empty';
import { formatDate } from '@workspace/airo-ui/utils'; import { formatDate } from '@workspace/airo-ui/utils';
const platforms: (keyof API.ApplicationPlatform)[] = [ const platforms: (keyof API.ApplicationPlatform)[] = [
@@ -42,11 +41,13 @@ const platforms: (keyof API.ApplicationPlatform)[] = [
export default function Content() { export default function Content() {
const t = useTranslations('dashboard'); const t = useTranslations('dashboard');
const { data: userSubscribe = [], refetch } = useQuery({ const { data: userSubscribe = {}, refetch } = useQuery({
queryKey: ['queryUserSubscribe'], queryKey: ['queryUserSubscribe'],
queryFn: async () => { queryFn: async () => {
const { data } = await queryUserSubscribe(); const { data } = await queryUserSubscribe();
return data.data?.list || []; const activeList = data.data?.list?.filter((v) => v.status === 1);
return activeList[0] ?? {};
}, },
}); });
@@ -119,11 +120,11 @@ export default function Content() {
{/* 快捷下载 Card */} {/* 快捷下载 Card */}
<Card className='rounded-[20px] border border-[#D9D9D9] p-6 shadow-[0px_0px_52.6px_1px_rgba(15,44,83,0.05)] 2xl:order-2 2xl:col-span-1'> <Card className='rounded-[20px] border border-[#D9D9D9] p-6 shadow-[0px_0px_52.6px_1px_rgba(15,44,83,0.05)] 2xl:order-2 2xl:col-span-1'>
<div className='flex items-center justify-between'> <div className='flex items-center justify-between'>
<h3 className='text-base font-medium text-[#666666] sm:text-xl'></h3> <h3 className='text-base font-medium text-[#666666] sm:text-xl'>
</div> {t('quickDownloads')}
<div className={'text-xs font-normal leading-[1.5] text-[#666]'}> </h3>
</div> </div>
<div className={'text-xs font-normal leading-[1.5] text-[#666]'}>{t('selectOS')}</div>
<div <div
className={ className={
@@ -141,11 +142,24 @@ export default function Content() {
icon: 'Group 77', icon: 'Group 77',
href: 'https://apps.apple.com/us/app/shadowrocket/id932747118?l=zh-Hans-CN', href: 'https://apps.apple.com/us/app/shadowrocket/id932747118?l=zh-Hans-CN',
}, },
{ label: 'Win', icon: 'Group 75', href: '' }, {
{ label: 'Android', icon: 'Group 75', href: '' }, label: 'Win',
icon: 'Group 75',
href: 'https://down.airoport.xin/Hiddify-Windows-Setup-x64.msix',
},
{
label: 'Android',
icon: 'Group 75',
href: 'https://down.airoport.xin/Hiddify-Android-universal.apk',
},
].map((v) => { ].map((v) => {
return ( return (
<a href={v.href} target={'_blank'} className={'cursor-pointer text-center'}> <a
key={v.label}
href={v.href}
target={'_blank'}
className={'cursor-pointer text-center'}
>
<div className={''}> <div className={''}>
<SvgIcon name={v.icon}></SvgIcon> <SvgIcon name={v.icon}></SvgIcon>
</div> </div>
@@ -159,7 +173,7 @@ export default function Content() {
'mt-2.5 flex h-[37px] items-center justify-between rounded-full bg-[#EAEAEA] pl-4 text-[#666]' 'mt-2.5 flex h-[37px] items-center justify-between rounded-full bg-[#EAEAEA] pl-4 text-[#666]'
} }
> >
<span className={'text-sm font-medium'}>Apple ID</span> <span className={'text-sm font-medium'}>{t('freeAppleID')}</span>
<AiroButton <AiroButton
className={'m-1'} className={'m-1'}
variant={'primary'} variant={'primary'}
@@ -170,7 +184,7 @@ export default function Content() {
}); });
}} }}
> >
{t('get')}
</AiroButton> </AiroButton>
</div> </div>
</Card> </Card>
@@ -189,20 +203,13 @@ export default function Content() {
{t('beginnerTutorial')} {t('beginnerTutorial')}
</Link> </Link>
</div> </div>
<div className={'text-xs font-light leading-[1.5] text-[#666]'}>
</div>
</div> </div>
{userSubscribe?.[0] && data?.protocol ? (
<SubScribeCard <SubScribeCard
userSubscribeData={userSubscribe?.[0]} userSubscribeData={userSubscribe}
protocol={data.protocol} protocol={data?.protocol || []}
refetch={refetch} refetch={refetch}
/> />
) : (
<Empty />
)}
</Card> </Card>
{/* 账户概况 Card */} {/* 账户概况 Card */}
@@ -218,7 +225,7 @@ export default function Content() {
<div className='mb-3 sm:mb-3.5'> <div className='mb-3 sm:mb-3.5'>
<span className='text-2xl font-medium text-[#091B33]'> <span className='text-2xl font-medium text-[#091B33]'>
{userSubscribe?.length > 0 && userSubscribe[0]?.status === 1 && orderData {userSubscribe?.status === 1 && orderData
? orderData?.quantity === 1 ? orderData?.quantity === 1
? t('annualMonthPlanUser') ? t('annualMonthPlanUser')
: t('annualYearPlanUser') : t('annualYearPlanUser')
@@ -247,77 +254,96 @@ export default function Content() {
<h3 className='flex items-center justify-between text-[#666666]'> <h3 className='flex items-center justify-between text-[#666666]'>
<div className={'flex items-center justify-between'}> <div className={'flex items-center justify-between'}>
<span className={'text-base font-medium sm:text-xl'}>{t('planStatus')}</span> <span className={'text-base font-medium sm:text-xl'}>{t('planStatus')}</span>
{userSubscribe?.length > 0 && userSubscribe?.[0]?.status === 1 ? ( {userSubscribe?.status === 1 ? (
<span className={'ml-2.5 rounded-full bg-[#A8D4ED] px-2 text-[8px] text-white'}> <span className={'ml-2.5 rounded-full bg-[#A8D4ED] px-2 text-[8px] text-white'}>
{t('inEffect')} {t('inEffect')}
</span> </span>
) : null} ) : (
<span className={'ml-2.5 rounded-full bg-[#666666] px-2 text-[8px] text-white'}>
{t('notEffect')}
</span>
)}
</div> </div>
<ResetTraffic <ResetTraffic
className={ className={
'border-0 bg-transparent p-0 text-sm font-normal text-[#225BA9] shadow-none outline-0 hover:bg-transparent' 'border-0 bg-transparent p-0 text-sm font-normal text-[#225BA9] shadow-none outline-0 hover:bg-transparent'
} }
id={userSubscribe?.[0]?.id || 0} id={userSubscribe?.id || 0}
replacement={userSubscribe?.[0]?.subscribe.replacement} replacement={userSubscribe?.subscribe?.replacement}
/> />
</h3> </h3>
</div> </div>
{userSubscribe?.length ? ( <div>
<> <div className='mt-1 text-xs font-light text-[#666666] sm:text-sm'>
<div className='mt-1 text-xs text-[#666666] sm:text-sm'>
{t('planExpirationTime')} {t('planExpirationTime')}
{formatDate(userSubscribe?.[0]?.expire_time, false)} {formatDate(userSubscribe?.expire_time, false) || t('None')}
</div> </div>
<div className='mb-3 sm:mb-5'> <div className='mb-3 mt-1 sm:mb-5'>
<span className='text-2xl font-medium text-[#091B33]'> <span className='text-2xl font-medium text-[#091B33]'>
{userSubscribe?.[0]?.subscribe.name} {userSubscribe?.subscribe?.name ? (
userSubscribe?.subscribe?.name
) : (
<span className={'text-[#848484]'}>{t('noPlanAvailable')}</span>
)}
</span> </span>
</div> </div>
<div className='mb-4 flex items-center justify-between'> <div className='mb-4 flex items-center justify-between'>
<div className='flex items-center gap-2'> <div className='flex items-center gap-2'>
<span className='text-xs sm:text-sm'>{t('availableDevices')}</span> <span className='text-xs sm:text-sm'>{t('availableDevices')}</span>
<div className='flex gap-2'> <div className='flex gap-2'>
{Array.from({ length: userSubscribe?.[0]?.subscribe.device_limit }).map( {Array.from({ length: userSubscribe?.subscribe?.device_limit || 6 }).map(
(_, index) => { (_, index) => {
return ( return (
<div <div
key={index} key={index}
className={`h-4 w-4 rounded-full ${index < (userSubscribe?.[0]?.subscribe.device_limit || 0) > 1 ? 'bg-[#225BA9]' : 'bg-[#D9D9D9]'}`} className={`h-2.5 w-2.5 rounded-full sm:h-4 sm:w-4 ${index < (userSubscribe?.subscribe?.device_limit || 0) > 1 ? 'bg-[#225BA9]' : 'bg-[#D9D9D9]'}`}
></div> ></div>
); );
}, },
)} )}
</div> </div>
</div> </div>
<span className='text-xs sm:text-sm'> <span className='text-xs font-light sm:text-sm'>
{t('online')} {t('online')}
{data?.online_device} / {userSubscribe?.[0]?.subscribe.device_limit} {data?.online_device || 0}/{userSubscribe?.subscribe?.device_limit || 0}
</span> </span>
</div> </div>
<div> <div>
<div className='mb-1 flex items-center justify-between'> <div className='mb-1 flex items-center justify-between font-light'>
<span className='text-xs sm:text-sm'> <span className='text-xs sm:text-sm'>
{t('usedTrafficTotalTraffic')} {t('usedTrafficTotalTraffic')}
{userSubscribe?.subscribe?.device_limit ? (
<>
<Display <Display
type='traffic' type='traffic'
value={userSubscribe?.[0]?.upload + userSubscribe?.[0]?.download} value={userSubscribe?.upload + userSubscribe?.download}
unlimited={!userSubscribe?.[0]?.traffic} unlimited={!userSubscribe?.traffic}
/> />
/{' '} /
<Display <Display
type='traffic' type='traffic'
value={userSubscribe?.[0]?.traffic} value={userSubscribe?.traffic || 0}
unlimited={!userSubscribe?.[0]?.traffic} unlimited={!userSubscribe?.traffic}
/> />
</>
) : (
'0GB/0GB'
)}
</span> </span>
<span className='text-xs sm:text-sm'> <span className='text-xs sm:text-sm'>
{t('remaining')} {t('remaining')}
{userSubscribe?.status === 1 ? (
<>
{100 - {100 -
Math.round( Math.round(
(((userSubscribe?.[0]?.upload || 0) + (userSubscribe?.[0]?.download || 0)) / (((userSubscribe?.upload || 0) + (userSubscribe?.download || 0)) /
(userSubscribe?.[0]?.traffic || 1)) * (userSubscribe?.traffic || 1)) *
100, 100,
)} )}
</>
) : (
0
)}
% %
</span> </span>
</div> </div>
@@ -325,15 +351,12 @@ export default function Content() {
<div <div
className={'h-full rounded-[20px] bg-[#225BA9]'} className={'h-full rounded-[20px] bg-[#225BA9]'}
style={{ style={{
width: `${Math.round((((userSubscribe?.[0]?.upload || 0) + (userSubscribe?.[0]?.download || 0)) / (userSubscribe?.[0]?.traffic || 1)) * 100)}%`, width: `${Math.round((((userSubscribe?.upload || 0) + (userSubscribe?.download || 0)) / (userSubscribe?.traffic || 1)) * 100)}%`,
}} }}
></div> ></div>
</div> </div>
</div> </div>
</> </div>
) : (
<Airo_Empty className={'py-0'} description={t('noPlanAvailable')} />
)}
</Card> </Card>
{/* 网站公告 Card */} {/* 网站公告 Card */}
@@ -168,7 +168,7 @@ export function TutorialButton({ items }: { items: Item[] }) {
)} )}
</div> </div>
</div> </div>
<div> <div className={'flex'}>
{item.download ? ( {item.download ? (
<button <button
className={cn( className={cn(
@@ -85,7 +85,7 @@ export default function Page() {
<Card className='border-none shadow-none sm:border sm:shadow'> <Card className='border-none shadow-none sm:border sm:shadow'>
<CardContent className='grid gap-2 p-6 text-sm'> <CardContent className='grid gap-2 p-6 text-sm'>
<div className='relative'> <div className='relative'>
<div className={'absolute flex gap-3'}> <div className={'flex gap-3 sm:absolute'}>
<div <div
className={ className={
'flex items-center justify-between rounded-md border-2 border-[#225BA9] p-0.5' 'flex items-center justify-between rounded-md border-2 border-[#225BA9] p-0.5'
+8
View File
@@ -1,4 +1,5 @@
{ {
"None": "None",
"accountBalance": "Account Balance", "accountBalance": "Account Balance",
"accountOverview": "Account Overview", "accountOverview": "Account Overview",
"address1": "Address 1", "address1": "Address 1",
@@ -7,11 +8,13 @@
"annualYearPlanUser": "Annual Plan User", "annualYearPlanUser": "Annual Plan User",
"availableDevices": "Available Devices", "availableDevices": "Available Devices",
"beginnerTutorial": "Beginner Tutorial", "beginnerTutorial": "Beginner Tutorial",
"buySubscriptionNow": "Buy Subscription Now",
"cancel": "Cancel", "cancel": "Cancel",
"confirm": "Confirm", "confirm": "Confirm",
"confirmResetSubscription": "Are you sure you want to reset the subscription address?", "confirmResetSubscription": "Are you sure you want to reset the subscription address?",
"copy": "Copy", "copy": "Copy",
"copyFailure": "Copy failed, please copy manually", "copyFailure": "Copy failed, please copy manually",
"copySubscribeLink": "Copy the subscription link or click the QR code button to scan",
"copySubscriptionLinkOrScanQrCode": "Copy subscription link or click the QR code button to scan", "copySubscriptionLinkOrScanQrCode": "Copy subscription link or click the QR code button to scan",
"copySuccess": "Copy successful", "copySuccess": "Copy successful",
"deducted": "Canceled", "deducted": "Canceled",
@@ -19,6 +22,8 @@
"expirationDays": "Expiration Days", "expirationDays": "Expiration Days",
"expired": "Expired", "expired": "Expired",
"finished": "Traffic exhausted", "finished": "Traffic exhausted",
"freeAppleID": "Free US Apple ID",
"get": "Get",
"import": "Import", "import": "Import",
"inEffect": "In Effect", "inEffect": "In Effect",
"latestAnnouncement": "Latest Announcement", "latestAnnouncement": "Latest Announcement",
@@ -32,6 +37,7 @@
"noPlanAvailable": "No Plan Available", "noPlanAvailable": "No Plan Available",
"noReset": "No Reset", "noReset": "No Reset",
"noYPlan": "No Plan Active", "noYPlan": "No Plan Active",
"notEffect": "Not in effect",
"online": "Online: ", "online": "Online: ",
"pageOf": "Page {pageIndex} of {pageCount}", "pageOf": "Page {pageIndex} of {pageCount}",
"pinnedAnnouncement": "[Pinned]", "pinnedAnnouncement": "[Pinned]",
@@ -40,12 +46,14 @@
"prompt": "Prompt", "prompt": "Prompt",
"purchaseSubscription": "Purchase Subscription", "purchaseSubscription": "Purchase Subscription",
"qrCode": "QR Code", "qrCode": "QR Code",
"quickDownloads": "Quick Downloads",
"remaining": "Remaining: ", "remaining": "Remaining: ",
"resetSubscription": "Reset Subscription Address", "resetSubscription": "Reset Subscription Address",
"resetSuccess": "Reset successful", "resetSuccess": "Reset successful",
"rowsPerPage": "Rows per page", "rowsPerPage": "Rows per page",
"scanCodeToSubscribe": "Scan code to subscribe", "scanCodeToSubscribe": "Scan code to subscribe",
"scanToSubscribe": "Scan to Subscribe", "scanToSubscribe": "Scan to Subscribe",
"selectOS": "Select the corresponding operating system to download the client",
"siteAnnouncements": "Site Announcements", "siteAnnouncements": "Site Announcements",
"subscriptionUrl": "Subscription URL", "subscriptionUrl": "Subscription URL",
"totalTraffic": "Total Traffic", "totalTraffic": "Total Traffic",
+8
View File
@@ -1,4 +1,5 @@
{ {
"None": "暂无",
"accountBalance": "账户余额", "accountBalance": "账户余额",
"accountOverview": "账户概况", "accountOverview": "账户概况",
"address1": "地址1", "address1": "地址1",
@@ -7,11 +8,13 @@
"annualYearPlanUser": "年度套餐用户", "annualYearPlanUser": "年度套餐用户",
"availableDevices": "可用设备", "availableDevices": "可用设备",
"beginnerTutorial": "新手教程", "beginnerTutorial": "新手教程",
"buySubscriptionNow": "立即购买订阅",
"cancel": "取消", "cancel": "取消",
"confirm": "确认", "confirm": "确认",
"confirmResetSubscription": "是否确认重置订阅地址?", "confirmResetSubscription": "是否确认重置订阅地址?",
"copy": "复制", "copy": "复制",
"copyFailure": "复制失败,请手动复制", "copyFailure": "复制失败,请手动复制",
"copySubscribeLink": "复制订阅链接或点击二维码按钮扫码",
"copySubscriptionLinkOrScanQrCode": "复制订阅链接或点击二维码按钮扫码", "copySubscriptionLinkOrScanQrCode": "复制订阅链接或点击二维码按钮扫码",
"copySuccess": "复制成功", "copySuccess": "复制成功",
"deducted": "已取消", "deducted": "已取消",
@@ -19,6 +22,8 @@
"expirationDays": "到期时间/天", "expirationDays": "到期时间/天",
"expired": "已过期", "expired": "已过期",
"finished": "流量已用尽", "finished": "流量已用尽",
"freeAppleID": "免费美区Apple ID",
"get": "获取",
"import": "导入", "import": "导入",
"inEffect": "生效中", "inEffect": "生效中",
"latestAnnouncement": "最新公告", "latestAnnouncement": "最新公告",
@@ -32,6 +37,7 @@
"noPlanAvailable": "暂无套餐", "noPlanAvailable": "暂无套餐",
"noReset": "不重置", "noReset": "不重置",
"noYPlan": "尚未有套餐生效", "noYPlan": "尚未有套餐生效",
"notEffect": "未生效",
"online": "在线:", "online": "在线:",
"pageOf": "第 {pageIndex} 页,共 {pageCount} 页", "pageOf": "第 {pageIndex} 页,共 {pageCount} 页",
"pinnedAnnouncement": "【置顶公告】", "pinnedAnnouncement": "【置顶公告】",
@@ -40,12 +46,14 @@
"prompt": "提示", "prompt": "提示",
"purchaseSubscription": "购买订阅", "purchaseSubscription": "购买订阅",
"qrCode": "二维码", "qrCode": "二维码",
"quickDownloads": "快捷下载",
"remaining": "剩余:", "remaining": "剩余:",
"resetSubscription": "重置订阅地址", "resetSubscription": "重置订阅地址",
"resetSuccess": "重置成功", "resetSuccess": "重置成功",
"rowsPerPage": "每页显示", "rowsPerPage": "每页显示",
"scanCodeToSubscribe": "扫描码订阅", "scanCodeToSubscribe": "扫描码订阅",
"scanToSubscribe": "扫描订阅", "scanToSubscribe": "扫描订阅",
"selectOS": "选择对应操作系统下载客户端",
"siteAnnouncements": "网站公告", "siteAnnouncements": "网站公告",
"subscriptionUrl": "订阅地址", "subscriptionUrl": "订阅地址",
"totalTraffic": "总流量", "totalTraffic": "总流量",
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "ppanel-web", "name": "ppanel-web",
"version": "1.3.0", "version": "1.3.1",
"private": true, "private": true,
"homepage": "https://github.com/perfect-panel/ppanel-web", "homepage": "https://github.com/perfect-panel/ppanel-web",
"bugs": { "bugs": {
@@ -13,7 +13,8 @@ const buttonVariants = cva(
primary: 'bg-[#225BA9] text-primary-foreground shadow hover:bg-[#0F2C53] ', primary: 'bg-[#225BA9] text-primary-foreground shadow hover:bg-[#0F2C53] ',
danger: 'bg-[#FF4248] text-primary-foreground shadow hover:bg-[#E22C2E]', danger: 'bg-[#FF4248] text-primary-foreground shadow hover:bg-[#E22C2E]',
dangerLink: 'text-[#E22C2E] ', dangerLink: 'text-[#E22C2E] ',
primaryBlue: 'bg-[#A8D4ED] text-primary-foreground hover:bg-[#225BA9]', primaryBlue:
'bg-[#B5C9E2] text-[#225BA9] hover:bg-[#225BA9] hover:text-primary-foreground ',
destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90', destructive: 'bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90',
outline: outline:
'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground', 'border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground',