mirror of
https://github.com/perfect-panel/ppanel-web.git
synced 2026-02-06 03:30:25 -05:00
🐛 fix(api): Server and order
This commit is contained in:
parent
229d36bfec
commit
255bd8219c
@ -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)
|
||||
|
||||
@ -21,7 +21,13 @@ export default function Page() {
|
||||
<div className='flex lg:w-1/2 lg:flex-auto'>
|
||||
<div className='flex w-full flex-col items-center justify-center px-5 py-4 md:px-14 lg:py-14'>
|
||||
<Link className='mb-0 flex flex-col items-center lg:mb-12' href='/'>
|
||||
<Image src={site.site_logo || '/favicon.svg'} height={48} width={48} alt='logo' />
|
||||
<Image
|
||||
src={site.site_logo || '/favicon.svg'}
|
||||
height={48}
|
||||
width={48}
|
||||
alt='logo'
|
||||
unoptimized
|
||||
/>
|
||||
<span className='text-2xl font-semibold'>{site.site_name}</span>
|
||||
</Link>
|
||||
<LoginIcon className='mx-auto hidden w-[275px] md:w-1/2 lg:block xl:w-[500px]' />
|
||||
|
||||
@ -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(),
|
||||
|
||||
@ -184,9 +184,9 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
||||
<FormControl>
|
||||
<JSONEditor
|
||||
title={t('form.description')}
|
||||
value={field.value}
|
||||
value={field.value && JSON.parse(field.value)}
|
||||
onChange={(value) => {
|
||||
form.setValue(field.name, value);
|
||||
form.setValue(field.name, JSON.stringify(value));
|
||||
}}
|
||||
placeholder={{
|
||||
description: 'description',
|
||||
|
||||
@ -37,6 +37,7 @@ export function SidebarLeft({ ...props }: React.ComponentProps<typeof Sidebar>)
|
||||
width={48}
|
||||
height={48}
|
||||
className='size-full'
|
||||
unoptimized
|
||||
/>
|
||||
</div>
|
||||
<div className='grid flex-1 text-left text-sm leading-tight'>
|
||||
|
||||
@ -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',
|
||||
},
|
||||
|
||||
14
apps/admin/services/admin/typings.d.ts
vendored
14
apps/admin/services/admin/typings.d.ts
vendored
@ -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<string, any>;
|
||||
enable_relay: boolean;
|
||||
relay_host: string;
|
||||
relay_rort: number;
|
||||
relay_port: number;
|
||||
};
|
||||
|
||||
type UpdateAnnouncementEnableRequest = {
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -141,7 +141,7 @@ export default function Page() {
|
||||
<SubscribeBilling
|
||||
order={{
|
||||
...data,
|
||||
coupon: data?.reduction,
|
||||
coupon_discount: data?.coupon_discount,
|
||||
quantity: data?.quantity,
|
||||
unit_price: data?.subscribe?.unit_price,
|
||||
type: data?.type,
|
||||
|
||||
@ -10,8 +10,8 @@ interface SubscribeBillingProps {
|
||||
subscribe_id?: number;
|
||||
quantity?: number;
|
||||
price?: number;
|
||||
reduction?: number;
|
||||
coupon?: number;
|
||||
discount?: number;
|
||||
coupon_discount?: number;
|
||||
fee_amount?: number;
|
||||
amount?: number;
|
||||
unit_price?: number;
|
||||
@ -42,13 +42,13 @@ export function SubscribeBilling({ order }: SubscribeBillingProps) {
|
||||
<li>
|
||||
<span className='text-muted-foreground'>{t('productDiscount')}</span>
|
||||
<span>
|
||||
<Display type='currency' value={order?.reduction} />
|
||||
<Display type='currency' value={order?.discount} />
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
<span className='text-muted-foreground'>{t('couponDiscount')}</span>
|
||||
<span>
|
||||
<Display type='currency' value={order?.coupon} />
|
||||
<Display type='currency' value={order?.coupon_discount} />
|
||||
</span>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
@ -40,7 +40,7 @@ export default function Page() {
|
||||
return (
|
||||
<>
|
||||
<Tabs value={group} onValueChange={setGroup} className='space-y-4'>
|
||||
{groups?.length && (
|
||||
{groups && groups.length > 0 && (
|
||||
<>
|
||||
<h1 className='text-muted-foreground w-full'>{t('category')}</h1>
|
||||
<TabsList>
|
||||
|
||||
@ -22,7 +22,7 @@ export default function Page() {
|
||||
<div className='flex bg-cover bg-center lg:w-1/2 lg:flex-auto'>
|
||||
<div className='lg:py-15 md:px-15 flex w-full flex-col items-center justify-center px-5 py-7'>
|
||||
<Link className='mb-0 flex flex-col items-center lg:mb-12' href='/'>
|
||||
<Image src={site.site_logo} height={48} width={48} alt='logo' />
|
||||
<Image src={site.site_logo} height={48} width={48} alt='logo' unoptimized />
|
||||
<span className='text-2xl font-semibold'>{site.site_name}</span>
|
||||
</Link>
|
||||
<LoginIcon className='mx-auto hidden w-[275px] md:w-1/2 lg:block xl:w-[500px]' />
|
||||
|
||||
@ -14,7 +14,9 @@ export default function Header() {
|
||||
const { site } = common;
|
||||
const Logo = (
|
||||
<Link href='/' className='flex items-center gap-2 text-lg font-bold'>
|
||||
{site.site_logo && <Image src={site.site_logo} width={48} height={48} alt='logo' />}
|
||||
{site.site_logo && (
|
||||
<Image src={site.site_logo} width={48} height={48} alt='logo' unoptimized />
|
||||
)}
|
||||
<span>{site.site_name}</span>
|
||||
</Link>
|
||||
);
|
||||
|
||||
@ -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',
|
||||
},
|
||||
|
||||
16
apps/user/services/user/typings.d.ts
vendored
16
apps/user/services/user/typings.d.ts
vendored
@ -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 = {
|
||||
|
||||
@ -92,7 +92,7 @@ export function Combobox<T, M extends boolean = false>({
|
||||
<Command>
|
||||
<CommandInput placeholder='Search...' className='h-9' />
|
||||
<CommandEmpty>
|
||||
<BoxIcon />
|
||||
<BoxIcon className='inline-block text-slate-500' />
|
||||
</CommandEmpty>
|
||||
<CommandGroup>
|
||||
<CommandList>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user