mirror of
https://github.com/perfect-panel/ppanel-web.git
synced 2026-04-27 13:39:56 -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>;
|
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 = {
|
type Server = {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
@ -665,6 +676,11 @@ declare namespace API {
|
|||||||
updated_at: number;
|
updated_at: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type TLSConfig = {
|
||||||
|
server_name?: string;
|
||||||
|
allow_insecure?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
type TosConfig = {
|
type TosConfig = {
|
||||||
tos_content: string;
|
tos_content: string;
|
||||||
};
|
};
|
||||||
@ -873,7 +889,7 @@ declare namespace API {
|
|||||||
network: string;
|
network: string;
|
||||||
transport: Record<string, any>;
|
transport: Record<string, any>;
|
||||||
security: string;
|
security: string;
|
||||||
security_config: Record<string, any>;
|
security_config: SecurityConfig;
|
||||||
xtls: string;
|
xtls: string;
|
||||||
enable_relay: boolean;
|
enable_relay: boolean;
|
||||||
relay_host: string;
|
relay_host: string;
|
||||||
@ -884,7 +900,7 @@ declare namespace API {
|
|||||||
host: string;
|
host: string;
|
||||||
port: number;
|
port: number;
|
||||||
enable_tls: boolean;
|
enable_tls: boolean;
|
||||||
tls_config: Record<string, any>;
|
tls_config: TLSConfig;
|
||||||
network: string;
|
network: string;
|
||||||
transport: Record<string, any>;
|
transport: Record<string, any>;
|
||||||
enable_relay: boolean;
|
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;
|
user: number;
|
||||||
node: number;
|
node: number;
|
||||||
country: number;
|
country: number;
|
||||||
|
protocol: string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
type GetSubscriptionResponse = {
|
type GetSubscriptionResponse = {
|
||||||
@ -216,6 +217,17 @@ declare namespace API {
|
|||||||
data?: Record<string, any>;
|
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 = {
|
type SendCodeRequest = {
|
||||||
email: string;
|
email: string;
|
||||||
type: number;
|
type: number;
|
||||||
@ -328,6 +340,11 @@ declare namespace API {
|
|||||||
updated_at: number;
|
updated_at: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type TLSConfig = {
|
||||||
|
server_name?: string;
|
||||||
|
allow_insecure?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
type TosConfig = {
|
type TosConfig = {
|
||||||
tos_content: string;
|
tos_content: string;
|
||||||
};
|
};
|
||||||
@ -436,7 +453,7 @@ declare namespace API {
|
|||||||
network: string;
|
network: string;
|
||||||
transport: Record<string, any>;
|
transport: Record<string, any>;
|
||||||
security: string;
|
security: string;
|
||||||
security_config: Record<string, any>;
|
security_config: SecurityConfig;
|
||||||
xtls: string;
|
xtls: string;
|
||||||
enable_relay: boolean;
|
enable_relay: boolean;
|
||||||
relay_host: string;
|
relay_host: string;
|
||||||
@ -447,7 +464,7 @@ declare namespace API {
|
|||||||
host: string;
|
host: string;
|
||||||
port: number;
|
port: number;
|
||||||
enable_tls: boolean;
|
enable_tls: boolean;
|
||||||
tls_config: Record<string, any>;
|
tls_config: TLSConfig;
|
||||||
network: string;
|
network: string;
|
||||||
transport: Record<string, any>;
|
transport: Record<string, any>;
|
||||||
enable_relay: boolean;
|
enable_relay: boolean;
|
||||||
|
|||||||
@ -31,6 +31,7 @@ import { QRCodeCanvas } from 'qrcode.react';
|
|||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
|
|
||||||
import useGlobalStore from '@/config/use-global';
|
import useGlobalStore from '@/config/use-global';
|
||||||
|
import { getStat } from '@/services/common/common';
|
||||||
import Renewal from '../order/renewal';
|
import Renewal from '../order/renewal';
|
||||||
import ResetTraffic from '../order/reset-traffic';
|
import ResetTraffic from '../order/reset-traffic';
|
||||||
import Subscribe from '../subscribe/page';
|
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 (
|
return (
|
||||||
<div className='flex min-h-[calc(100vh-64px-58px-32px-114px)] w-full flex-col gap-4 overflow-hidden'>
|
<div className='flex min-h-[calc(100vh-64px-58px-32px-114px)] w-full flex-col gap-4 overflow-hidden'>
|
||||||
<Announcement />
|
<Announcement />
|
||||||
@ -91,13 +103,14 @@ export default function Page() {
|
|||||||
))}
|
))}
|
||||||
</TabsList>
|
</TabsList>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
{data?.protocol && data?.protocol.length > 1 && (
|
||||||
<Tabs
|
<Tabs
|
||||||
value={protocol}
|
value={protocol}
|
||||||
onValueChange={setProtocol}
|
onValueChange={setProtocol}
|
||||||
className='w-full max-w-full md:w-auto'
|
className='w-full max-w-full md:w-auto'
|
||||||
>
|
>
|
||||||
<TabsList className='flex *:flex-auto'>
|
<TabsList className='flex *:flex-auto'>
|
||||||
{['all', 'ss', 'vmess', 'vless', 'trojan'].map((item) => (
|
{['all', ...(data?.protocol || [])].map((item) => (
|
||||||
<TabsTrigger
|
<TabsTrigger
|
||||||
value={item === 'all' ? '' : item}
|
value={item === 'all' ? '' : item}
|
||||||
key={item}
|
key={item}
|
||||||
@ -108,6 +121,7 @@ export default function Page() {
|
|||||||
))}
|
))}
|
||||||
</TabsList>
|
</TabsList>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
{userSubscribe.map((item) => (
|
{userSubscribe.map((item) => (
|
||||||
<Card key={item.id}>
|
<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;
|
user: number;
|
||||||
node: number;
|
node: number;
|
||||||
country: number;
|
country: number;
|
||||||
|
protocol: string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
type GetSubscriptionResponse = {
|
type GetSubscriptionResponse = {
|
||||||
@ -216,6 +217,17 @@ declare namespace API {
|
|||||||
data?: Record<string, any>;
|
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 = {
|
type SendCodeRequest = {
|
||||||
email: string;
|
email: string;
|
||||||
type: number;
|
type: number;
|
||||||
@ -328,6 +340,11 @@ declare namespace API {
|
|||||||
updated_at: number;
|
updated_at: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type TLSConfig = {
|
||||||
|
server_name?: string;
|
||||||
|
allow_insecure?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
type TosConfig = {
|
type TosConfig = {
|
||||||
tos_content: string;
|
tos_content: string;
|
||||||
};
|
};
|
||||||
@ -436,7 +453,7 @@ declare namespace API {
|
|||||||
network: string;
|
network: string;
|
||||||
transport: Record<string, any>;
|
transport: Record<string, any>;
|
||||||
security: string;
|
security: string;
|
||||||
security_config: Record<string, any>;
|
security_config: SecurityConfig;
|
||||||
xtls: string;
|
xtls: string;
|
||||||
enable_relay: boolean;
|
enable_relay: boolean;
|
||||||
relay_host: string;
|
relay_host: string;
|
||||||
@ -447,7 +464,7 @@ declare namespace API {
|
|||||||
host: string;
|
host: string;
|
||||||
port: number;
|
port: number;
|
||||||
enable_tls: boolean;
|
enable_tls: boolean;
|
||||||
tls_config: Record<string, any>;
|
tls_config: TLSConfig;
|
||||||
network: string;
|
network: string;
|
||||||
transport: Record<string, any>;
|
transport: Record<string, any>;
|
||||||
enable_relay: boolean;
|
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>;
|
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 = {
|
type Server = {
|
||||||
id: number;
|
id: number;
|
||||||
name: string;
|
name: string;
|
||||||
@ -468,6 +479,11 @@ declare namespace API {
|
|||||||
updated_at: number;
|
updated_at: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type TLSConfig = {
|
||||||
|
server_name?: string;
|
||||||
|
allow_insecure?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
type TosConfig = {
|
type TosConfig = {
|
||||||
tos_content: string;
|
tos_content: string;
|
||||||
};
|
};
|
||||||
@ -577,7 +593,7 @@ declare namespace API {
|
|||||||
network: string;
|
network: string;
|
||||||
transport: Record<string, any>;
|
transport: Record<string, any>;
|
||||||
security: string;
|
security: string;
|
||||||
security_config: Record<string, any>;
|
security_config: SecurityConfig;
|
||||||
xtls: string;
|
xtls: string;
|
||||||
enable_relay: boolean;
|
enable_relay: boolean;
|
||||||
relay_host: string;
|
relay_host: string;
|
||||||
@ -588,7 +604,7 @@ declare namespace API {
|
|||||||
host: string;
|
host: string;
|
||||||
port: number;
|
port: number;
|
||||||
enable_tls: boolean;
|
enable_tls: boolean;
|
||||||
tls_config: Record<string, any>;
|
tls_config: TLSConfig;
|
||||||
network: string;
|
network: string;
|
||||||
transport: Record<string, any>;
|
transport: Record<string, any>;
|
||||||
enable_relay: boolean;
|
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