mirror of
https://github.com/perfect-panel/ppanel-web.git
synced 2026-04-19 10:09:55 -04:00
✨ feat(config): Protocol type
This commit is contained in:
parent
0327b73708
commit
a3b45b455d
20
apps/admin/services/admin/typings.d.ts
vendored
20
apps/admin/services/admin/typings.d.ts
vendored
@ -558,6 +558,17 @@ declare namespace API {
|
||||
data?: Record<string, any>;
|
||||
};
|
||||
|
||||
type SecurityConfig = {
|
||||
server_address?: string;
|
||||
server_name?: string;
|
||||
server_port?: number;
|
||||
fingerprint?: string;
|
||||
private_key?: string;
|
||||
public_key?: string;
|
||||
short_id?: string;
|
||||
allow_insecure?: boolean;
|
||||
};
|
||||
|
||||
type Server = {
|
||||
id: number;
|
||||
name: string;
|
||||
@ -665,6 +676,11 @@ declare namespace API {
|
||||
updated_at: number;
|
||||
};
|
||||
|
||||
type TLSConfig = {
|
||||
server_name?: string;
|
||||
allow_insecure?: boolean;
|
||||
};
|
||||
|
||||
type TosConfig = {
|
||||
tos_content: string;
|
||||
};
|
||||
@ -873,7 +889,7 @@ declare namespace API {
|
||||
network: string;
|
||||
transport: Record<string, any>;
|
||||
security: string;
|
||||
security_config: Record<string, any>;
|
||||
security_config: SecurityConfig;
|
||||
xtls: string;
|
||||
enable_relay: boolean;
|
||||
relay_host: string;
|
||||
@ -884,7 +900,7 @@ declare namespace API {
|
||||
host: string;
|
||||
port: number;
|
||||
enable_tls: boolean;
|
||||
tls_config: Record<string, any>;
|
||||
tls_config: TLSConfig;
|
||||
network: string;
|
||||
transport: Record<string, any>;
|
||||
enable_relay: boolean;
|
||||
|
||||
21
apps/admin/services/common/typings.d.ts
vendored
21
apps/admin/services/common/typings.d.ts
vendored
@ -104,6 +104,7 @@ declare namespace API {
|
||||
user: number;
|
||||
node: number;
|
||||
country: number;
|
||||
protocol: string[];
|
||||
};
|
||||
|
||||
type GetSubscriptionResponse = {
|
||||
@ -216,6 +217,17 @@ declare namespace API {
|
||||
data?: Record<string, any>;
|
||||
};
|
||||
|
||||
type SecurityConfig = {
|
||||
server_address?: string;
|
||||
server_name?: string;
|
||||
server_port?: number;
|
||||
fingerprint?: string;
|
||||
private_key?: string;
|
||||
public_key?: string;
|
||||
short_id?: string;
|
||||
allow_insecure?: boolean;
|
||||
};
|
||||
|
||||
type SendCodeRequest = {
|
||||
email: string;
|
||||
type: number;
|
||||
@ -328,6 +340,11 @@ declare namespace API {
|
||||
updated_at: number;
|
||||
};
|
||||
|
||||
type TLSConfig = {
|
||||
server_name?: string;
|
||||
allow_insecure?: boolean;
|
||||
};
|
||||
|
||||
type TosConfig = {
|
||||
tos_content: string;
|
||||
};
|
||||
@ -436,7 +453,7 @@ declare namespace API {
|
||||
network: string;
|
||||
transport: Record<string, any>;
|
||||
security: string;
|
||||
security_config: Record<string, any>;
|
||||
security_config: SecurityConfig;
|
||||
xtls: string;
|
||||
enable_relay: boolean;
|
||||
relay_host: string;
|
||||
@ -447,7 +464,7 @@ declare namespace API {
|
||||
host: string;
|
||||
port: number;
|
||||
enable_tls: boolean;
|
||||
tls_config: Record<string, any>;
|
||||
tls_config: TLSConfig;
|
||||
network: string;
|
||||
transport: Record<string, any>;
|
||||
enable_relay: boolean;
|
||||
|
||||
@ -31,6 +31,7 @@ import { QRCodeCanvas } from 'qrcode.react';
|
||||
import { useState } from 'react';
|
||||
|
||||
import useGlobalStore from '@/config/use-global';
|
||||
import { getStat } from '@/services/common/common';
|
||||
import Renewal from '../order/renewal';
|
||||
import ResetTraffic from '../order/reset-traffic';
|
||||
import Subscribe from '../subscribe/page';
|
||||
@ -67,6 +68,17 @@ export default function Page() {
|
||||
}
|
||||
};
|
||||
|
||||
const { data } = useQuery({
|
||||
queryKey: ['getStat'],
|
||||
queryFn: async () => {
|
||||
const { data } = await getStat({
|
||||
skipErrorHandler: true,
|
||||
});
|
||||
return data.data;
|
||||
},
|
||||
refetchOnWindowFocus: false,
|
||||
});
|
||||
|
||||
return (
|
||||
<div className='flex min-h-[calc(100vh-64px-58px-32px-114px)] w-full flex-col gap-4 overflow-hidden'>
|
||||
<Announcement />
|
||||
@ -91,23 +103,25 @@ export default function Page() {
|
||||
))}
|
||||
</TabsList>
|
||||
</Tabs>
|
||||
<Tabs
|
||||
value={protocol}
|
||||
onValueChange={setProtocol}
|
||||
className='w-full max-w-full md:w-auto'
|
||||
>
|
||||
<TabsList className='flex *:flex-auto'>
|
||||
{['all', 'ss', 'vmess', 'vless', 'trojan'].map((item) => (
|
||||
<TabsTrigger
|
||||
value={item === 'all' ? '' : item}
|
||||
key={item}
|
||||
className='px-1 uppercase lg:px-3'
|
||||
>
|
||||
{item}
|
||||
</TabsTrigger>
|
||||
))}
|
||||
</TabsList>
|
||||
</Tabs>
|
||||
{data?.protocol && data?.protocol.length > 1 && (
|
||||
<Tabs
|
||||
value={protocol}
|
||||
onValueChange={setProtocol}
|
||||
className='w-full max-w-full md:w-auto'
|
||||
>
|
||||
<TabsList className='flex *:flex-auto'>
|
||||
{['all', ...(data?.protocol || [])].map((item) => (
|
||||
<TabsTrigger
|
||||
value={item === 'all' ? '' : item}
|
||||
key={item}
|
||||
className='px-1 uppercase lg:px-3'
|
||||
>
|
||||
{item}
|
||||
</TabsTrigger>
|
||||
))}
|
||||
</TabsList>
|
||||
</Tabs>
|
||||
)}
|
||||
</div>
|
||||
{userSubscribe.map((item) => (
|
||||
<Card key={item.id}>
|
||||
|
||||
21
apps/user/services/common/typings.d.ts
vendored
21
apps/user/services/common/typings.d.ts
vendored
@ -104,6 +104,7 @@ declare namespace API {
|
||||
user: number;
|
||||
node: number;
|
||||
country: number;
|
||||
protocol: string[];
|
||||
};
|
||||
|
||||
type GetSubscriptionResponse = {
|
||||
@ -216,6 +217,17 @@ declare namespace API {
|
||||
data?: Record<string, any>;
|
||||
};
|
||||
|
||||
type SecurityConfig = {
|
||||
server_address?: string;
|
||||
server_name?: string;
|
||||
server_port?: number;
|
||||
fingerprint?: string;
|
||||
private_key?: string;
|
||||
public_key?: string;
|
||||
short_id?: string;
|
||||
allow_insecure?: boolean;
|
||||
};
|
||||
|
||||
type SendCodeRequest = {
|
||||
email: string;
|
||||
type: number;
|
||||
@ -328,6 +340,11 @@ declare namespace API {
|
||||
updated_at: number;
|
||||
};
|
||||
|
||||
type TLSConfig = {
|
||||
server_name?: string;
|
||||
allow_insecure?: boolean;
|
||||
};
|
||||
|
||||
type TosConfig = {
|
||||
tos_content: string;
|
||||
};
|
||||
@ -436,7 +453,7 @@ declare namespace API {
|
||||
network: string;
|
||||
transport: Record<string, any>;
|
||||
security: string;
|
||||
security_config: Record<string, any>;
|
||||
security_config: SecurityConfig;
|
||||
xtls: string;
|
||||
enable_relay: boolean;
|
||||
relay_host: string;
|
||||
@ -447,7 +464,7 @@ declare namespace API {
|
||||
host: string;
|
||||
port: number;
|
||||
enable_tls: boolean;
|
||||
tls_config: Record<string, any>;
|
||||
tls_config: TLSConfig;
|
||||
network: string;
|
||||
transport: Record<string, any>;
|
||||
enable_relay: boolean;
|
||||
|
||||
20
apps/user/services/user/typings.d.ts
vendored
20
apps/user/services/user/typings.d.ts
vendored
@ -359,6 +359,17 @@ declare namespace API {
|
||||
data?: Record<string, any>;
|
||||
};
|
||||
|
||||
type SecurityConfig = {
|
||||
server_address?: string;
|
||||
server_name?: string;
|
||||
server_port?: number;
|
||||
fingerprint?: string;
|
||||
private_key?: string;
|
||||
public_key?: string;
|
||||
short_id?: string;
|
||||
allow_insecure?: boolean;
|
||||
};
|
||||
|
||||
type Server = {
|
||||
id: number;
|
||||
name: string;
|
||||
@ -468,6 +479,11 @@ declare namespace API {
|
||||
updated_at: number;
|
||||
};
|
||||
|
||||
type TLSConfig = {
|
||||
server_name?: string;
|
||||
allow_insecure?: boolean;
|
||||
};
|
||||
|
||||
type TosConfig = {
|
||||
tos_content: string;
|
||||
};
|
||||
@ -577,7 +593,7 @@ declare namespace API {
|
||||
network: string;
|
||||
transport: Record<string, any>;
|
||||
security: string;
|
||||
security_config: Record<string, any>;
|
||||
security_config: SecurityConfig;
|
||||
xtls: string;
|
||||
enable_relay: boolean;
|
||||
relay_host: string;
|
||||
@ -588,7 +604,7 @@ declare namespace API {
|
||||
host: string;
|
||||
port: number;
|
||||
enable_tls: boolean;
|
||||
tls_config: Record<string, any>;
|
||||
tls_config: TLSConfig;
|
||||
network: string;
|
||||
transport: Record<string, any>;
|
||||
enable_relay: boolean;
|
||||
|
||||
10581
pnpm-lock.yaml
generated
10581
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user