mirror of
https://github.com/perfect-panel/ppanel-web.git
synced 2026-02-06 11:40:28 -05:00
🐛 fix: Rename 'hysteria2' to 'hysteria' across protocol definitions and schemas for consistency
This commit is contained in:
parent
92665293ec
commit
5816dd5198
@ -36,9 +36,13 @@ export type ProtocolName =
|
||||
| 'vmess'
|
||||
| 'vless'
|
||||
| 'trojan'
|
||||
| 'hysteria2'
|
||||
| 'hysteria'
|
||||
| 'tuic'
|
||||
| 'anytls';
|
||||
| 'anytls'
|
||||
| 'naive'
|
||||
| 'http'
|
||||
| 'socks'
|
||||
| 'mieru';
|
||||
|
||||
const buildSchema = (t: ReturnType<typeof useTranslations>) =>
|
||||
z.object({
|
||||
|
||||
@ -3,7 +3,7 @@ export const protocols = [
|
||||
'vmess',
|
||||
'vless',
|
||||
'trojan',
|
||||
'hysteria2',
|
||||
'hysteria',
|
||||
'tuic',
|
||||
'anytls',
|
||||
'socks',
|
||||
@ -64,7 +64,7 @@ export const SECURITY = {
|
||||
vmess: ['none', 'tls'] as const,
|
||||
vless: ['none', 'tls', 'reality'] as const,
|
||||
trojan: ['tls'] as const,
|
||||
hysteria2: ['tls'] as const,
|
||||
hysteria: ['tls'] as const,
|
||||
tuic: ['tls'] as const,
|
||||
anytls: ['tls'] as const,
|
||||
naive: ['none', 'tls'] as const,
|
||||
|
||||
@ -90,9 +90,9 @@ export function getProtocolDefaultConfig(proto: ProtocolType) {
|
||||
cert_dns_env: null,
|
||||
ratio: 1,
|
||||
} as any;
|
||||
case 'hysteria2':
|
||||
case 'hysteria':
|
||||
return {
|
||||
type: 'hysteria2',
|
||||
type: 'hysteria',
|
||||
enable: false,
|
||||
port: null,
|
||||
hop_ports: null,
|
||||
|
||||
@ -603,7 +603,7 @@ export const PROTOCOL_FIELDS: Record<string, FieldConfig[]> = {
|
||||
condition: (p) => p.security === 'tls' && p.cert_mode === 'dns',
|
||||
},
|
||||
],
|
||||
hysteria2: [
|
||||
hysteria: [
|
||||
{
|
||||
name: 'ratio',
|
||||
type: 'number',
|
||||
|
||||
@ -104,16 +104,16 @@ const trojan = z.object({
|
||||
cert_dns_env: nullableString,
|
||||
});
|
||||
|
||||
const hysteria2 = z.object({
|
||||
const hysteria = z.object({
|
||||
ratio: nullableRatio,
|
||||
type: z.literal('hysteria2'),
|
||||
type: z.literal('hysteria'),
|
||||
enable: nullableBool,
|
||||
hop_ports: nullableString,
|
||||
hop_interval: z.number().nullish(),
|
||||
obfs_password: nullableString,
|
||||
obfs: z.enum(['none', 'salamander'] as const).nullish(),
|
||||
port: nullablePort,
|
||||
security: z.enum(SECURITY.hysteria2).nullish(),
|
||||
security: z.enum(SECURITY.hysteria).nullish(),
|
||||
sni: nullableString,
|
||||
allow_insecure: nullableBool,
|
||||
fingerprint: nullableString,
|
||||
@ -207,7 +207,7 @@ export const protocolApiScheme = z.discriminatedUnion('type', [
|
||||
vmess,
|
||||
vless,
|
||||
trojan,
|
||||
hysteria2,
|
||||
hysteria,
|
||||
tuic,
|
||||
anytls,
|
||||
socks,
|
||||
|
||||
@ -53,23 +53,6 @@ const dnsConfigSchema = z.object({
|
||||
const outboundConfigSchema = z.object({
|
||||
name: z.string(),
|
||||
protocol: z.string(),
|
||||
// z.enum([
|
||||
// 'http',
|
||||
// 'https',
|
||||
// 'socks5',
|
||||
// 'shadowsocks',
|
||||
// 'vmess',
|
||||
// 'vless',
|
||||
// 'trojan',
|
||||
// 'hysteria2',
|
||||
// 'tuic',
|
||||
// 'naive',
|
||||
// 'brook',
|
||||
// 'snell',
|
||||
// 'wireguard',
|
||||
// 'direct',
|
||||
// 'reject',
|
||||
// ]),
|
||||
address: z.string(),
|
||||
port: z.number(),
|
||||
password: z.string().optional(),
|
||||
|
||||
2
apps/admin/services/admin/typings.d.ts
vendored
2
apps/admin/services/admin/typings.d.ts
vendored
@ -1272,7 +1272,7 @@ declare namespace API {
|
||||
has_migrate: boolean;
|
||||
};
|
||||
|
||||
type Hysteria2 = {
|
||||
type Hysteria = {
|
||||
port: number;
|
||||
hop_ports: string;
|
||||
hop_interval: number;
|
||||
|
||||
2
apps/admin/services/common/typings.d.ts
vendored
2
apps/admin/services/common/typings.d.ts
vendored
@ -324,7 +324,7 @@ declare namespace API {
|
||||
state: string;
|
||||
};
|
||||
|
||||
type Hysteria2 = {
|
||||
type Hysteria = {
|
||||
port: number;
|
||||
hop_ports: string;
|
||||
hop_interval: number;
|
||||
|
||||
2
apps/user/services/common/typings.d.ts
vendored
2
apps/user/services/common/typings.d.ts
vendored
@ -324,7 +324,7 @@ declare namespace API {
|
||||
state: string;
|
||||
};
|
||||
|
||||
type Hysteria2 = {
|
||||
type Hysteria = {
|
||||
port: number;
|
||||
hop_ports: string;
|
||||
hop_interval: number;
|
||||
|
||||
2
apps/user/services/user/typings.d.ts
vendored
2
apps/user/services/user/typings.d.ts
vendored
@ -343,7 +343,7 @@ declare namespace API {
|
||||
list: Ticket[];
|
||||
};
|
||||
|
||||
type Hysteria2 = {
|
||||
type Hysteria = {
|
||||
port: number;
|
||||
hop_ports: string;
|
||||
hop_interval: number;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user