From 255bd8219c83ae99e8976492cae1e3784c516983 Mon Sep 17 00:00:00 2001 From: "web@ppanel" Date: Tue, 26 Nov 2024 14:58:23 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix(api):=20Server=20and=20order?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release-docker.yml | 2 +- apps/admin/.env.template | 4 ++-- apps/admin/app/(auth)/page.tsx | 8 +++++++- apps/admin/app/dashboard/server/node-form.tsx | 2 +- .../app/dashboard/subscribe/subscribe-form.tsx | 4 ++-- apps/admin/components/sidebar-left.tsx | 1 + apps/admin/openapi2ts.config.ts | 4 ++-- apps/admin/services/admin/typings.d.ts | 14 +++++++++----- apps/user/.env.template | 4 ++-- apps/user/app/(main)/(user)/payment/page.tsx | 2 +- .../user/app/(main)/(user)/subscribe/billing.tsx | 8 ++++---- apps/user/app/(main)/(user)/subscribe/page.tsx | 2 +- apps/user/app/auth/page.tsx | 2 +- apps/user/components/header.tsx | 4 +++- apps/user/openapi2ts.config.ts | 4 ++-- apps/user/services/user/typings.d.ts | 16 +++++++++------- packages/ui/src/combobox.tsx | 2 +- 17 files changed, 49 insertions(+), 34 deletions(-) diff --git a/.github/workflows/release-docker.yml b/.github/workflows/release-docker.yml index a58314d..c5c39af 100644 --- a/.github/workflows/release-docker.yml +++ b/.github/workflows/release-docker.yml @@ -23,7 +23,7 @@ jobs: uses: actions/checkout@v3 - name: Set up QEMU uses: docker/setup-qemu-action@v3 - + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 diff --git a/apps/admin/.env.template b/apps/admin/.env.template index b52d245..c138462 100644 --- a/apps/admin/.env.template +++ b/apps/admin/.env.template @@ -6,8 +6,8 @@ NEXT_PUBLIC_SITE_URL=https://admin.ppanel.dev NEXT_PUBLIC_API_URL=https://api.ppanel.dev # Default Login User -NEXT_PUBLIC_DEFAULT_USER_EMAIL=support@ppanel.dev -NEXT_PUBLIC_DEFAULT_USER_PASSWORD=support@ppanel.dev +NEXT_PUBLIC_DEFAULT_USER_EMAIL=admin@ppanel.dev +NEXT_PUBLIC_DEFAULT_USER_PASSWORD=admin-password # Please put in the .env file, otherwise the i18n command will not work # OpenAI API key and proxy URL required for i18n command (optional) diff --git a/apps/admin/app/(auth)/page.tsx b/apps/admin/app/(auth)/page.tsx index 532ac15..2917549 100644 --- a/apps/admin/app/(auth)/page.tsx +++ b/apps/admin/app/(auth)/page.tsx @@ -21,7 +21,13 @@ export default function Page() {
- logo + logo {site.site_name} diff --git a/apps/admin/app/dashboard/server/node-form.tsx b/apps/admin/app/dashboard/server/node-form.tsx index 1b3ccef..052dddc 100644 --- a/apps/admin/app/dashboard/server/node-form.tsx +++ b/apps/admin/app/dashboard/server/node-form.tsx @@ -37,7 +37,7 @@ const shadowsocksSchema = z.object({ const vmessSchema = z.object({ host: z.string(), port: z.number(), - enable_tls: z.boolean().nullable(), + enable_tls: z.boolean().nullish(), tls_config: z.any().nullable(), network: z.string(), transport: z.any().nullable(), diff --git a/apps/admin/app/dashboard/subscribe/subscribe-form.tsx b/apps/admin/app/dashboard/subscribe/subscribe-form.tsx index 2e16776..9566465 100644 --- a/apps/admin/app/dashboard/subscribe/subscribe-form.tsx +++ b/apps/admin/app/dashboard/subscribe/subscribe-form.tsx @@ -184,9 +184,9 @@ export default function SubscribeForm>({ { - form.setValue(field.name, value); + form.setValue(field.name, JSON.stringify(value)); }} placeholder={{ description: 'description', diff --git a/apps/admin/components/sidebar-left.tsx b/apps/admin/components/sidebar-left.tsx index fde7965..cb65689 100644 --- a/apps/admin/components/sidebar-left.tsx +++ b/apps/admin/components/sidebar-left.tsx @@ -37,6 +37,7 @@ export function SidebarLeft({ ...props }: React.ComponentProps) width={48} height={48} className='size-full' + unoptimized />
diff --git a/apps/admin/openapi2ts.config.ts b/apps/admin/openapi2ts.config.ts index 0175418..84c6a3c 100644 --- a/apps/admin/openapi2ts.config.ts +++ b/apps/admin/openapi2ts.config.ts @@ -1,13 +1,13 @@ const config = [ { requestLibPath: "import request from '@/utils/request';", - schemaPath: 'https://swagger.ppanel.dev/common.json', + schemaPath: 'https://docs.ppanel.dev/swagger/common.json', serversPath: './services', projectName: 'common', }, { requestLibPath: "import request from '@/utils/request';", - schemaPath: 'https://swagger.ppanel.dev/admin.json', + schemaPath: 'https://docs.ppanel.dev/swagger/admin.json', serversPath: './services', projectName: 'admin', }, diff --git a/apps/admin/services/admin/typings.d.ts b/apps/admin/services/admin/typings.d.ts index df17607..caa3fc0 100644 --- a/apps/admin/services/admin/typings.d.ts +++ b/apps/admin/services/admin/typings.d.ts @@ -118,11 +118,13 @@ declare namespace API { type CreateOrderRequest = { user_id: number; type: number; + quantity?: number; price: number; amount: number; - fee_amount: number; + discount?: number; coupon?: string; - reduction?: number; + coupon_discount?: number; + fee_amount: number; method?: string; trade_no?: string; status?: number; @@ -529,12 +531,14 @@ declare namespace API { user_id: number; order_no: string; type: number; + quantity: number; price: number; amount: number; - fee_amount: number; + discount: number; coupon: string; - reduction: number; + coupon_discount: number; method: string; + fee_amount: number; trade_no: string; status: number; subscribe_id: number; @@ -661,7 +665,7 @@ declare namespace API { transport: Record; enable_relay: boolean; relay_host: string; - relay_rort: number; + relay_port: number; }; type UpdateAnnouncementEnableRequest = { diff --git a/apps/user/.env.template b/apps/user/.env.template index e7613a0..bfe619d 100644 --- a/apps/user/.env.template +++ b/apps/user/.env.template @@ -17,8 +17,8 @@ NEXT_PUBLIC_FACEBOOK_LINK=https://github.com/perfect-panel/ppanel-user-web NEXT_PUBLIC_GITHUB_LINK=https://github.com/perfect-panel/ppanel-user-web # Default Login User -NEXT_PUBLIC_DEFAULT_USER_EMAIL=support@ppanel.dev -NEXT_PUBLIC_DEFAULT_USER_PASSWORD=support@ppanel.dev +NEXT_PUBLIC_DEFAULT_USER_EMAIL=admin@ppanel.dev +NEXT_PUBLIC_DEFAULT_USER_PASSWORD=admin-password # Please put in the .env file, otherwise the i18n command will not work # OpenAI API key and proxy URL required for i18n command (optional) diff --git a/apps/user/app/(main)/(user)/payment/page.tsx b/apps/user/app/(main)/(user)/payment/page.tsx index 1a74d87..e2b6d74 100644 --- a/apps/user/app/(main)/(user)/payment/page.tsx +++ b/apps/user/app/(main)/(user)/payment/page.tsx @@ -141,7 +141,7 @@ export default function Page() { {t('productDiscount')} - +
  • {t('couponDiscount')} - +
  • diff --git a/apps/user/app/(main)/(user)/subscribe/page.tsx b/apps/user/app/(main)/(user)/subscribe/page.tsx index 143de4f..319069a 100644 --- a/apps/user/app/(main)/(user)/subscribe/page.tsx +++ b/apps/user/app/(main)/(user)/subscribe/page.tsx @@ -40,7 +40,7 @@ export default function Page() { return ( <> - {groups?.length && ( + {groups && groups.length > 0 && ( <>

    {t('category')}

    diff --git a/apps/user/app/auth/page.tsx b/apps/user/app/auth/page.tsx index a187dc3..3da9c31 100644 --- a/apps/user/app/auth/page.tsx +++ b/apps/user/app/auth/page.tsx @@ -22,7 +22,7 @@ export default function Page() {
    - logo + logo {site.site_name} diff --git a/apps/user/components/header.tsx b/apps/user/components/header.tsx index 3ba3009..f6e8744 100644 --- a/apps/user/components/header.tsx +++ b/apps/user/components/header.tsx @@ -14,7 +14,9 @@ export default function Header() { const { site } = common; const Logo = ( - {site.site_logo && logo} + {site.site_logo && ( + logo + )} {site.site_name} ); diff --git a/apps/user/openapi2ts.config.ts b/apps/user/openapi2ts.config.ts index 8b3fb78..b34bf7f 100644 --- a/apps/user/openapi2ts.config.ts +++ b/apps/user/openapi2ts.config.ts @@ -1,13 +1,13 @@ const config = [ { requestLibPath: "import request from '@/utils/request';", - schemaPath: 'https://swagger.ppanel.dev/common.json', + schemaPath: 'https://docs.ppanel.dev/swagger/common.json', serversPath: './services', projectName: 'common', }, { requestLibPath: "import request from '@/utils/request';", - schemaPath: 'https://swagger.ppanel.dev/user.json', + schemaPath: 'https://docs.ppanel.dev/swagger/user.json', serversPath: './services', projectName: 'user', }, diff --git a/apps/user/services/user/typings.d.ts b/apps/user/services/user/typings.d.ts index 59f43ec..2119086 100644 --- a/apps/user/services/user/typings.d.ts +++ b/apps/user/services/user/typings.d.ts @@ -93,17 +93,18 @@ declare namespace API { id: number; orderNo: string; type: number; - subscribe_id: number; - subscribe: SubscribeInfo; quantity: number; price: number; amount: number; - fee_amount: number; + discount: number; coupon: string; - reduction: number; - trade_no: string; + coupon_discount: number; method: string; + fee_amount: number; + trade_no: string; status: number; + subscribe_id: number; + subscribe: SubscribeInfo; created_at: number; }; @@ -122,9 +123,10 @@ declare namespace API { type PreOrderResponse = { price: number; amount: number; + discount: number; + coupon: string; + coupon_discount: number; fee_amount: number; - coupon: number; - reduction: number; }; type PreRenewalOrderResponse = { diff --git a/packages/ui/src/combobox.tsx b/packages/ui/src/combobox.tsx index 5cedc7d..91b3298 100644 --- a/packages/ui/src/combobox.tsx +++ b/packages/ui/src/combobox.tsx @@ -92,7 +92,7 @@ export function Combobox({ - +