mirror of
https://github.com/perfect-panel/ppanel-web.git
synced 2026-02-16 05:11:10 -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
|
NEXT_PUBLIC_API_URL=https://api.ppanel.dev
|
||||||
|
|
||||||
# Default Login User
|
# Default Login User
|
||||||
NEXT_PUBLIC_DEFAULT_USER_EMAIL=support@ppanel.dev
|
NEXT_PUBLIC_DEFAULT_USER_EMAIL=admin@ppanel.dev
|
||||||
NEXT_PUBLIC_DEFAULT_USER_PASSWORD=support@ppanel.dev
|
NEXT_PUBLIC_DEFAULT_USER_PASSWORD=admin-password
|
||||||
|
|
||||||
# Please put in the .env file, otherwise the i18n command will not work
|
# Please put in the .env file, otherwise the i18n command will not work
|
||||||
# OpenAI API key and proxy URL required for i18n command (optional)
|
# 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 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'>
|
<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='/'>
|
<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>
|
<span className='text-2xl font-semibold'>{site.site_name}</span>
|
||||||
</Link>
|
</Link>
|
||||||
<LoginIcon className='mx-auto hidden w-[275px] md:w-1/2 lg:block xl:w-[500px]' />
|
<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({
|
const vmessSchema = z.object({
|
||||||
host: z.string(),
|
host: z.string(),
|
||||||
port: z.number(),
|
port: z.number(),
|
||||||
enable_tls: z.boolean().nullable(),
|
enable_tls: z.boolean().nullish(),
|
||||||
tls_config: z.any().nullable(),
|
tls_config: z.any().nullable(),
|
||||||
network: z.string(),
|
network: z.string(),
|
||||||
transport: z.any().nullable(),
|
transport: z.any().nullable(),
|
||||||
|
|||||||
@ -184,9 +184,9 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<JSONEditor
|
<JSONEditor
|
||||||
title={t('form.description')}
|
title={t('form.description')}
|
||||||
value={field.value}
|
value={field.value && JSON.parse(field.value)}
|
||||||
onChange={(value) => {
|
onChange={(value) => {
|
||||||
form.setValue(field.name, value);
|
form.setValue(field.name, JSON.stringify(value));
|
||||||
}}
|
}}
|
||||||
placeholder={{
|
placeholder={{
|
||||||
description: 'description',
|
description: 'description',
|
||||||
|
|||||||
@ -37,6 +37,7 @@ export function SidebarLeft({ ...props }: React.ComponentProps<typeof Sidebar>)
|
|||||||
width={48}
|
width={48}
|
||||||
height={48}
|
height={48}
|
||||||
className='size-full'
|
className='size-full'
|
||||||
|
unoptimized
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className='grid flex-1 text-left text-sm leading-tight'>
|
<div className='grid flex-1 text-left text-sm leading-tight'>
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
const config = [
|
const config = [
|
||||||
{
|
{
|
||||||
requestLibPath: "import request from '@/utils/request';",
|
requestLibPath: "import request from '@/utils/request';",
|
||||||
schemaPath: 'https://swagger.ppanel.dev/common.json',
|
schemaPath: 'https://docs.ppanel.dev/swagger/common.json',
|
||||||
serversPath: './services',
|
serversPath: './services',
|
||||||
projectName: 'common',
|
projectName: 'common',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
requestLibPath: "import request from '@/utils/request';",
|
requestLibPath: "import request from '@/utils/request';",
|
||||||
schemaPath: 'https://swagger.ppanel.dev/admin.json',
|
schemaPath: 'https://docs.ppanel.dev/swagger/admin.json',
|
||||||
serversPath: './services',
|
serversPath: './services',
|
||||||
projectName: 'admin',
|
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 = {
|
type CreateOrderRequest = {
|
||||||
user_id: number;
|
user_id: number;
|
||||||
type: number;
|
type: number;
|
||||||
|
quantity?: number;
|
||||||
price: number;
|
price: number;
|
||||||
amount: number;
|
amount: number;
|
||||||
fee_amount: number;
|
discount?: number;
|
||||||
coupon?: string;
|
coupon?: string;
|
||||||
reduction?: number;
|
coupon_discount?: number;
|
||||||
|
fee_amount: number;
|
||||||
method?: string;
|
method?: string;
|
||||||
trade_no?: string;
|
trade_no?: string;
|
||||||
status?: number;
|
status?: number;
|
||||||
@ -529,12 +531,14 @@ declare namespace API {
|
|||||||
user_id: number;
|
user_id: number;
|
||||||
order_no: string;
|
order_no: string;
|
||||||
type: number;
|
type: number;
|
||||||
|
quantity: number;
|
||||||
price: number;
|
price: number;
|
||||||
amount: number;
|
amount: number;
|
||||||
fee_amount: number;
|
discount: number;
|
||||||
coupon: string;
|
coupon: string;
|
||||||
reduction: number;
|
coupon_discount: number;
|
||||||
method: string;
|
method: string;
|
||||||
|
fee_amount: number;
|
||||||
trade_no: string;
|
trade_no: string;
|
||||||
status: number;
|
status: number;
|
||||||
subscribe_id: number;
|
subscribe_id: number;
|
||||||
@ -661,7 +665,7 @@ declare namespace API {
|
|||||||
transport: Record<string, any>;
|
transport: Record<string, any>;
|
||||||
enable_relay: boolean;
|
enable_relay: boolean;
|
||||||
relay_host: string;
|
relay_host: string;
|
||||||
relay_rort: number;
|
relay_port: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
type UpdateAnnouncementEnableRequest = {
|
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
|
NEXT_PUBLIC_GITHUB_LINK=https://github.com/perfect-panel/ppanel-user-web
|
||||||
|
|
||||||
# Default Login User
|
# Default Login User
|
||||||
NEXT_PUBLIC_DEFAULT_USER_EMAIL=support@ppanel.dev
|
NEXT_PUBLIC_DEFAULT_USER_EMAIL=admin@ppanel.dev
|
||||||
NEXT_PUBLIC_DEFAULT_USER_PASSWORD=support@ppanel.dev
|
NEXT_PUBLIC_DEFAULT_USER_PASSWORD=admin-password
|
||||||
|
|
||||||
# Please put in the .env file, otherwise the i18n command will not work
|
# Please put in the .env file, otherwise the i18n command will not work
|
||||||
# OpenAI API key and proxy URL required for i18n command (optional)
|
# OpenAI API key and proxy URL required for i18n command (optional)
|
||||||
|
|||||||
@ -141,7 +141,7 @@ export default function Page() {
|
|||||||
<SubscribeBilling
|
<SubscribeBilling
|
||||||
order={{
|
order={{
|
||||||
...data,
|
...data,
|
||||||
coupon: data?.reduction,
|
coupon_discount: data?.coupon_discount,
|
||||||
quantity: data?.quantity,
|
quantity: data?.quantity,
|
||||||
unit_price: data?.subscribe?.unit_price,
|
unit_price: data?.subscribe?.unit_price,
|
||||||
type: data?.type,
|
type: data?.type,
|
||||||
|
|||||||
@ -10,8 +10,8 @@ interface SubscribeBillingProps {
|
|||||||
subscribe_id?: number;
|
subscribe_id?: number;
|
||||||
quantity?: number;
|
quantity?: number;
|
||||||
price?: number;
|
price?: number;
|
||||||
reduction?: number;
|
discount?: number;
|
||||||
coupon?: number;
|
coupon_discount?: number;
|
||||||
fee_amount?: number;
|
fee_amount?: number;
|
||||||
amount?: number;
|
amount?: number;
|
||||||
unit_price?: number;
|
unit_price?: number;
|
||||||
@ -42,13 +42,13 @@ export function SubscribeBilling({ order }: SubscribeBillingProps) {
|
|||||||
<li>
|
<li>
|
||||||
<span className='text-muted-foreground'>{t('productDiscount')}</span>
|
<span className='text-muted-foreground'>{t('productDiscount')}</span>
|
||||||
<span>
|
<span>
|
||||||
<Display type='currency' value={order?.reduction} />
|
<Display type='currency' value={order?.discount} />
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<span className='text-muted-foreground'>{t('couponDiscount')}</span>
|
<span className='text-muted-foreground'>{t('couponDiscount')}</span>
|
||||||
<span>
|
<span>
|
||||||
<Display type='currency' value={order?.coupon} />
|
<Display type='currency' value={order?.coupon_discount} />
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
@ -40,7 +40,7 @@ export default function Page() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Tabs value={group} onValueChange={setGroup} className='space-y-4'>
|
<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>
|
<h1 className='text-muted-foreground w-full'>{t('category')}</h1>
|
||||||
<TabsList>
|
<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='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'>
|
<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='/'>
|
<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>
|
<span className='text-2xl font-semibold'>{site.site_name}</span>
|
||||||
</Link>
|
</Link>
|
||||||
<LoginIcon className='mx-auto hidden w-[275px] md:w-1/2 lg:block xl:w-[500px]' />
|
<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 { site } = common;
|
||||||
const Logo = (
|
const Logo = (
|
||||||
<Link href='/' className='flex items-center gap-2 text-lg font-bold'>
|
<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>
|
<span>{site.site_name}</span>
|
||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
const config = [
|
const config = [
|
||||||
{
|
{
|
||||||
requestLibPath: "import request from '@/utils/request';",
|
requestLibPath: "import request from '@/utils/request';",
|
||||||
schemaPath: 'https://swagger.ppanel.dev/common.json',
|
schemaPath: 'https://docs.ppanel.dev/swagger/common.json',
|
||||||
serversPath: './services',
|
serversPath: './services',
|
||||||
projectName: 'common',
|
projectName: 'common',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
requestLibPath: "import request from '@/utils/request';",
|
requestLibPath: "import request from '@/utils/request';",
|
||||||
schemaPath: 'https://swagger.ppanel.dev/user.json',
|
schemaPath: 'https://docs.ppanel.dev/swagger/user.json',
|
||||||
serversPath: './services',
|
serversPath: './services',
|
||||||
projectName: 'user',
|
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;
|
id: number;
|
||||||
orderNo: string;
|
orderNo: string;
|
||||||
type: number;
|
type: number;
|
||||||
subscribe_id: number;
|
|
||||||
subscribe: SubscribeInfo;
|
|
||||||
quantity: number;
|
quantity: number;
|
||||||
price: number;
|
price: number;
|
||||||
amount: number;
|
amount: number;
|
||||||
fee_amount: number;
|
discount: number;
|
||||||
coupon: string;
|
coupon: string;
|
||||||
reduction: number;
|
coupon_discount: number;
|
||||||
trade_no: string;
|
|
||||||
method: string;
|
method: string;
|
||||||
|
fee_amount: number;
|
||||||
|
trade_no: string;
|
||||||
status: number;
|
status: number;
|
||||||
|
subscribe_id: number;
|
||||||
|
subscribe: SubscribeInfo;
|
||||||
created_at: number;
|
created_at: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -122,9 +123,10 @@ declare namespace API {
|
|||||||
type PreOrderResponse = {
|
type PreOrderResponse = {
|
||||||
price: number;
|
price: number;
|
||||||
amount: number;
|
amount: number;
|
||||||
|
discount: number;
|
||||||
|
coupon: string;
|
||||||
|
coupon_discount: number;
|
||||||
fee_amount: number;
|
fee_amount: number;
|
||||||
coupon: number;
|
|
||||||
reduction: number;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
type PreRenewalOrderResponse = {
|
type PreRenewalOrderResponse = {
|
||||||
|
|||||||
@ -92,7 +92,7 @@ export function Combobox<T, M extends boolean = false>({
|
|||||||
<Command>
|
<Command>
|
||||||
<CommandInput placeholder='Search...' className='h-9' />
|
<CommandInput placeholder='Search...' className='h-9' />
|
||||||
<CommandEmpty>
|
<CommandEmpty>
|
||||||
<BoxIcon />
|
<BoxIcon className='inline-block text-slate-500' />
|
||||||
</CommandEmpty>
|
</CommandEmpty>
|
||||||
<CommandGroup>
|
<CommandGroup>
|
||||||
<CommandList>
|
<CommandList>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user