Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 5025fd1103 | |||
| 88aa9656b2 | |||
| e60e369bbe | |||
| c3d0ef8317 | |||
| 8bd25d651b | |||
| ca892dd359 | |||
| 521a7a97fb | |||
| a46657d5ef |
+33
-15
@@ -1,38 +1,56 @@
|
|||||||
<a name="readme-top"></a>
|
<a name="readme-top"></a>
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [1.5.4](https://github.com/perfect-panel/ppanel-web/compare/v1.5.3...v1.5.4) (2025-10-26)
|
||||||
|
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
* Update generateRealityKeyPair to use async key generation ([e60e369](https://github.com/perfect-panel/ppanel-web/commit/e60e369))
|
||||||
|
* Update the wallet localization file and add new fields such as automatic reset and recharge ([88aa965](https://github.com/perfect-panel/ppanel-web/commit/88aa965))
|
||||||
|
|
||||||
|
## [1.5.3](https://github.com/perfect-panel/ppanel-web/compare/v1.5.2...v1.5.3) (2025-10-21)
|
||||||
|
|
||||||
|
|
||||||
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
|
* Fix bugs ([a46657d](https://github.com/perfect-panel/ppanel-web/commit/a46657d))
|
||||||
|
* Fix dependencies ([8bd25d6](https://github.com/perfect-panel/ppanel-web/commit/8bd25d6))
|
||||||
|
* Remove unnecessary migration function code and add device configuration options ([521a7a9](https://github.com/perfect-panel/ppanel-web/commit/521a7a9))
|
||||||
|
* Update bun.lockb to reflect dependency changes ([ca892dd](https://github.com/perfect-panel/ppanel-web/commit/ca892dd))
|
||||||
|
|
||||||
|
<a name="readme-top"></a>
|
||||||
|
|
||||||
|
# Changelog
|
||||||
|
|
||||||
## [1.5.2](https://github.com/perfect-panel/ppanel-web/compare/v1.5.1...v1.5.2) (2025-09-29)
|
## [1.5.2](https://github.com/perfect-panel/ppanel-web/compare/v1.5.1...v1.5.2) (2025-09-29)
|
||||||
|
|
||||||
|
|
||||||
### 🐛 Bug Fixes
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
* Add step attribute to datetime-local inputs for precise time selection in forms ([32fd181](https://github.com/perfect-panel/ppanel-web/commit/32fd181))
|
- Add step attribute to datetime-local inputs for precise time selection in forms ([32fd181](https://github.com/perfect-panel/ppanel-web/commit/32fd181))
|
||||||
* Rename 'hysteria2' to 'hysteria' across protocol definitions and schemas for consistency ([5816dd5](https://github.com/perfect-panel/ppanel-web/commit/5816dd5))
|
- Rename 'hysteria2' to 'hysteria' across protocol definitions and schemas for consistency ([5816dd5](https://github.com/perfect-panel/ppanel-web/commit/5816dd5))
|
||||||
* Update protocol options in ServerConfig for accuracy and consistency ([9266529](https://github.com/perfect-panel/ppanel-web/commit/9266529))
|
- Update protocol options in ServerConfig for accuracy and consistency ([9266529](https://github.com/perfect-panel/ppanel-web/commit/9266529))
|
||||||
|
|
||||||
## [1.5.1](https://github.com/perfect-panel/ppanel-web/compare/v1.5.0...v1.5.1) (2025-09-28)
|
## [1.5.1](https://github.com/perfect-panel/ppanel-web/compare/v1.5.0...v1.5.1) (2025-09-28)
|
||||||
|
|
||||||
|
|
||||||
### 🐛 Bug Fixes
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
* Simplify protocol enable checks by removing unnecessary false comparisons ([4828700](https://github.com/perfect-panel/ppanel-web/commit/4828700))
|
- Simplify protocol enable checks by removing unnecessary false comparisons ([4828700](https://github.com/perfect-panel/ppanel-web/commit/4828700))
|
||||||
|
|
||||||
# [1.5.0](https://github.com/perfect-panel/ppanel-web/compare/v1.4.8...v1.5.0) (2025-09-28)
|
# [1.5.0](https://github.com/perfect-panel/ppanel-web/compare/v1.4.8...v1.5.0) (2025-09-28)
|
||||||
|
|
||||||
|
|
||||||
### ✨ Features
|
### ✨ Features
|
||||||
|
|
||||||
* Update server configuration translations for multiple languages ([fc43de1](https://github.com/perfect-panel/ppanel-web/commit/fc43de1))
|
- Update server configuration translations for multiple languages ([fc43de1](https://github.com/perfect-panel/ppanel-web/commit/fc43de1))
|
||||||
|
|
||||||
|
|
||||||
### 🐛 Bug Fixes
|
### 🐛 Bug Fixes
|
||||||
|
|
||||||
* Add DynamicMultiplier component for managing node multipliers and update ServersPage layout ([bb6671c](https://github.com/perfect-panel/ppanel-web/commit/bb6671c))
|
- Add DynamicMultiplier component for managing node multipliers and update ServersPage layout ([bb6671c](https://github.com/perfect-panel/ppanel-web/commit/bb6671c))
|
||||||
* Remove unnecessary blank lines in multiple index files for cleaner code structure ([6a823b8](https://github.com/perfect-panel/ppanel-web/commit/6a823b8))
|
- Remove unnecessary blank lines in multiple index files for cleaner code structure ([6a823b8](https://github.com/perfect-panel/ppanel-web/commit/6a823b8))
|
||||||
* Remove unused ratio variable from server traffic log and server form for cleaner code ([55034dc](https://github.com/perfect-panel/ppanel-web/commit/55034dc))
|
- Remove unused ratio variable from server traffic log and server form for cleaner code ([55034dc](https://github.com/perfect-panel/ppanel-web/commit/55034dc))
|
||||||
* Update Badge variants and restructure traffic ratio display in ServersPage ([3d778e5](https://github.com/perfect-panel/ppanel-web/commit/3d778e5))
|
- Update Badge variants and restructure traffic ratio display in ServersPage ([3d778e5](https://github.com/perfect-panel/ppanel-web/commit/3d778e5))
|
||||||
* Update minimum ratio value to 0 in protocol fields and adjust related schemas; enhance unit conversion in ServerConfig ([3b6ef17](https://github.com/perfect-panel/ppanel-web/commit/3b6ef17))
|
- Update minimum ratio value to 0 in protocol fields and adjust related schemas; enhance unit conversion in ServerConfig ([3b6ef17](https://github.com/perfect-panel/ppanel-web/commit/3b6ef17))
|
||||||
* Update protocol fields to use 'obfs' instead of 'security' and adjust related configurations ([4abdd36](https://github.com/perfect-panel/ppanel-web/commit/4abdd36))
|
- Update protocol fields to use 'obfs' instead of 'security' and adjust related configurations ([4abdd36](https://github.com/perfect-panel/ppanel-web/commit/4abdd36))
|
||||||
|
|
||||||
<a name="readme-top"></a>
|
<a name="readme-top"></a>
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
import { x25519 } from '@noble/curves/ed25519';
|
import * as x25519 from '@noble/ed25519';
|
||||||
import { toB64Url } from './util';
|
import { toB64Url } from './util';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate a Reality key pair
|
* Generate a Reality key pair
|
||||||
* @returns An object containing the private and public keys in base64url format
|
* @returns An object containing the private and public keys in base64url format
|
||||||
*/
|
*/
|
||||||
export function generateRealityKeyPair() {
|
export async function generateRealityKeyPair() {
|
||||||
const { secretKey, publicKey } = x25519.keygen();
|
const { secretKey, publicKey } = await x25519.keygenAsync();
|
||||||
return { privateKey: toB64Url(secretKey), publicKey: toB64Url(publicKey) };
|
return { privateKey: toB64Url(secretKey), publicKey: toB64Url(publicKey) };
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,14 +5,11 @@ import {
|
|||||||
createServer,
|
createServer,
|
||||||
deleteServer,
|
deleteServer,
|
||||||
filterServerList,
|
filterServerList,
|
||||||
hasMigrateSeverNode,
|
|
||||||
migrateServerNode,
|
|
||||||
resetSortWithServer,
|
resetSortWithServer,
|
||||||
updateServer,
|
updateServer,
|
||||||
} from '@/services/admin/server';
|
} from '@/services/admin/server';
|
||||||
import { useNode } from '@/store/node';
|
import { useNode } from '@/store/node';
|
||||||
import { useServer } from '@/store/server';
|
import { useServer } from '@/store/server';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
|
||||||
import { Badge } from '@workspace/ui/components/badge';
|
import { Badge } from '@workspace/ui/components/badge';
|
||||||
import { Button } from '@workspace/ui/components/button';
|
import { Button } from '@workspace/ui/components/button';
|
||||||
import { ConfirmButton } from '@workspace/ui/custom-components/confirm-button';
|
import { ConfirmButton } from '@workspace/ui/custom-components/confirm-button';
|
||||||
@@ -66,33 +63,6 @@ export default function ServersPage() {
|
|||||||
const [migrating, setMigrating] = useState(false);
|
const [migrating, setMigrating] = useState(false);
|
||||||
const ref = useRef<ProTableActions>(null);
|
const ref = useRef<ProTableActions>(null);
|
||||||
|
|
||||||
const { data: hasMigrate, refetch: refetchHasMigrate } = useQuery({
|
|
||||||
queryKey: ['hasMigrateSeverNode'],
|
|
||||||
queryFn: async () => {
|
|
||||||
const { data } = await hasMigrateSeverNode();
|
|
||||||
return data.data?.has_migrate;
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const handleMigrate = async () => {
|
|
||||||
setMigrating(true);
|
|
||||||
try {
|
|
||||||
const { data } = await migrateServerNode();
|
|
||||||
const fail = data.data?.fail || 0;
|
|
||||||
if (fail > 0) {
|
|
||||||
toast.error(data.data?.message);
|
|
||||||
} else {
|
|
||||||
toast.success(t('migrated'));
|
|
||||||
}
|
|
||||||
refetchHasMigrate();
|
|
||||||
ref.current?.refresh();
|
|
||||||
} catch (error) {
|
|
||||||
toast.error(t('migrateFailed'));
|
|
||||||
} finally {
|
|
||||||
setMigrating(false);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='space-y-4'>
|
<div className='space-y-4'>
|
||||||
<div className='grid grid-cols-1 gap-4 md:grid-cols-2'>
|
<div className='grid grid-cols-1 gap-4 md:grid-cols-2'>
|
||||||
@@ -105,11 +75,6 @@ export default function ServersPage() {
|
|||||||
title: t('pageTitle'),
|
title: t('pageTitle'),
|
||||||
toolbar: (
|
toolbar: (
|
||||||
<div className='flex gap-2'>
|
<div className='flex gap-2'>
|
||||||
{hasMigrate && (
|
|
||||||
<Button variant='outline' onClick={handleMigrate} disabled={migrating}>
|
|
||||||
{migrating ? t('migrating') : t('migrate')}
|
|
||||||
</Button>
|
|
||||||
)}
|
|
||||||
<ServerForm
|
<ServerForm
|
||||||
trigger={t('create')}
|
trigger={t('create')}
|
||||||
title={t('drawerCreateTitle')}
|
title={t('drawerCreateTitle')}
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ import { useEffect, useState } from 'react';
|
|||||||
import { useForm } from 'react-hook-form';
|
import { useForm } from 'react-hook-form';
|
||||||
import { toast } from 'sonner';
|
import { toast } from 'sonner';
|
||||||
import { z } from 'zod';
|
import { z } from 'zod';
|
||||||
|
import { SS_CIPHERS } from './form-schema';
|
||||||
|
|
||||||
const dnsConfigSchema = z.object({
|
const dnsConfigSchema = z.object({
|
||||||
proto: z.string(), // z.enum(['tcp', 'udp', 'tls', 'https', 'quic']),
|
proto: z.string(), // z.enum(['tcp', 'udp', 'tls', 'https', 'quic']),
|
||||||
@@ -55,6 +56,7 @@ const outboundConfigSchema = z.object({
|
|||||||
protocol: z.string(),
|
protocol: z.string(),
|
||||||
address: z.string(),
|
address: z.string(),
|
||||||
port: z.number(),
|
port: z.number(),
|
||||||
|
cipher: z.string().optional(),
|
||||||
password: z.string().optional(),
|
password: z.string().optional(),
|
||||||
rules: z.array(z.string()).optional(),
|
rules: z.array(z.string()).optional(),
|
||||||
});
|
});
|
||||||
@@ -92,7 +94,7 @@ export default function ServerConfig() {
|
|||||||
node_pull_interval: undefined,
|
node_pull_interval: undefined,
|
||||||
node_push_interval: undefined,
|
node_push_interval: undefined,
|
||||||
traffic_report_threshold: undefined,
|
traffic_report_threshold: undefined,
|
||||||
ip_strategy: undefined,
|
ip_strategy: 'prefer_ipv4',
|
||||||
dns: [],
|
dns: [],
|
||||||
block: [],
|
block: [],
|
||||||
outbound: [],
|
outbound: [],
|
||||||
@@ -106,7 +108,8 @@ export default function ServerConfig() {
|
|||||||
node_pull_interval: cfgResp.node_pull_interval as number | undefined,
|
node_pull_interval: cfgResp.node_pull_interval as number | undefined,
|
||||||
node_push_interval: cfgResp.node_push_interval as number | undefined,
|
node_push_interval: cfgResp.node_push_interval as number | undefined,
|
||||||
traffic_report_threshold: cfgResp.traffic_report_threshold as number | undefined,
|
traffic_report_threshold: cfgResp.traffic_report_threshold as number | undefined,
|
||||||
ip_strategy: cfgResp.ip_strategy as 'prefer_ipv4' | 'prefer_ipv6' | undefined,
|
ip_strategy:
|
||||||
|
(cfgResp.ip_strategy as 'prefer_ipv4' | 'prefer_ipv6' | undefined) || 'prefer_ipv4',
|
||||||
dns: cfgResp.dns || [],
|
dns: cfgResp.dns || [],
|
||||||
block: cfgResp.block || [],
|
block: cfgResp.block || [],
|
||||||
outbound: cfgResp.outbound || [],
|
outbound: cfgResp.outbound || [],
|
||||||
@@ -364,7 +367,8 @@ export default function ServerConfig() {
|
|||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name='outbound'
|
name='outbound'
|
||||||
render={({ field }) => (
|
render={({ field }) => {
|
||||||
|
return (
|
||||||
<FormItem>
|
<FormItem>
|
||||||
<FormControl>
|
<FormControl>
|
||||||
<ArrayInput
|
<ArrayInput
|
||||||
@@ -400,10 +404,22 @@ export default function ServerConfig() {
|
|||||||
{ label: 'Reject', value: 'reject' },
|
{ label: 'Reject', value: 'reject' },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: 'cipher',
|
||||||
|
type: 'select',
|
||||||
|
options: SS_CIPHERS.map((cipher) => ({
|
||||||
|
label: cipher,
|
||||||
|
value: cipher,
|
||||||
|
})),
|
||||||
|
visible: (item: Record<string, any>) =>
|
||||||
|
item.protocol === 'shadowsocks',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: 'address',
|
name: 'address',
|
||||||
type: 'text',
|
type: 'text',
|
||||||
placeholder: t('server_config.fields.outbound_address_placeholder'),
|
placeholder: t(
|
||||||
|
'server_config.fields.outbound_address_placeholder',
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'port',
|
name: 'port',
|
||||||
@@ -434,6 +450,7 @@ export default function ServerConfig() {
|
|||||||
protocol: item.protocol,
|
protocol: item.protocol,
|
||||||
address: item.address,
|
address: item.address,
|
||||||
port: item.port,
|
port: item.port,
|
||||||
|
cipher: item.cipher,
|
||||||
password: item.password,
|
password: item.password,
|
||||||
rules:
|
rules:
|
||||||
typeof item.rules === 'string'
|
typeof item.rules === 'string'
|
||||||
@@ -446,7 +463,8 @@ export default function ServerConfig() {
|
|||||||
</FormControl>
|
</FormControl>
|
||||||
<FormMessage />
|
<FormMessage />
|
||||||
</FormItem>
|
</FormItem>
|
||||||
)}
|
);
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</TabsContent>
|
</TabsContent>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
'use client';
|
'use client';
|
||||||
|
|
||||||
import useGlobalStore, { GlobalStore } from '@/config/use-global';
|
import useGlobalStore, { GlobalStore } from '@/config/use-global';
|
||||||
|
import { useStatsStore } from '@/store/stats';
|
||||||
import { Logout } from '@/utils/common';
|
import { Logout } from '@/utils/common';
|
||||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||||
import { ReactQueryStreamedHydration } from '@tanstack/react-query-next-experimental';
|
import { ReactQueryStreamedHydration } from '@tanstack/react-query-next-experimental';
|
||||||
@@ -42,6 +43,12 @@ export default function Providers({
|
|||||||
setCommon(common);
|
setCommon(common);
|
||||||
}, [setCommon, common]);
|
}, [setCommon, common]);
|
||||||
|
|
||||||
|
const { stats } = useStatsStore();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
stats();
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<NextThemesProvider attribute='class' defaultTheme='system' enableSystem>
|
<NextThemesProvider attribute='class' defaultTheme='system' enableSystem>
|
||||||
<QueryClientProvider client={queryClient}>
|
<QueryClientProvider client={queryClient}>
|
||||||
|
|||||||
@@ -45,6 +45,12 @@ export const useGlobalStore = create<GlobalStore>((set, get) => ({
|
|||||||
ip_register_limit: 0,
|
ip_register_limit: 0,
|
||||||
ip_register_limit_duration: 0,
|
ip_register_limit_duration: 0,
|
||||||
},
|
},
|
||||||
|
device: {
|
||||||
|
enable: false,
|
||||||
|
show_ads: false,
|
||||||
|
enable_security: false,
|
||||||
|
only_real_device: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
invite: {
|
invite: {
|
||||||
forced_invite: false,
|
forced_invite: false,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@lottiefiles/dotlottie-react": "^0.15.1",
|
"@lottiefiles/dotlottie-react": "^0.15.1",
|
||||||
"@noble/curves": "^2.0.0",
|
"@noble/ed25519": "^3.0.0",
|
||||||
"@tanstack/react-query": "^5.85.5",
|
"@tanstack/react-query": "^5.85.5",
|
||||||
"@tanstack/react-query-next-experimental": "^5.85.5",
|
"@tanstack/react-query-next-experimental": "^5.85.5",
|
||||||
"@workspace/ui": "workspace:*",
|
"@workspace/ui": "workspace:*",
|
||||||
|
|||||||
@@ -76,6 +76,17 @@ export async function updateNodeConfig(body: API.NodeConfig, options?: { [key: s
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** PreView Node Multiplier GET /v1/admin/system/node_multiplier/preview */
|
||||||
|
export async function preViewNodeMultiplier(options?: { [key: string]: any }) {
|
||||||
|
return request<API.Response & { data?: API.PreViewNodeMultiplierResponse }>(
|
||||||
|
'/v1/admin/system/node_multiplier/preview',
|
||||||
|
{
|
||||||
|
method: 'GET',
|
||||||
|
...(options || {}),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/** get Privacy Policy Config GET /v1/admin/system/privacy */
|
/** get Privacy Policy Config GET /v1/admin/system/privacy */
|
||||||
export async function getPrivacyPolicyConfig(options?: { [key: string]: any }) {
|
export async function getPrivacyPolicyConfig(options?: { [key: string]: any }) {
|
||||||
return request<API.Response & { data?: API.PrivacyPolicyConfig }>('/v1/admin/system/privacy', {
|
return request<API.Response & { data?: API.PrivacyPolicyConfig }>('/v1/admin/system/privacy', {
|
||||||
|
|||||||
+14
-1
@@ -108,6 +108,7 @@ declare namespace API {
|
|||||||
type AuthConfig = {
|
type AuthConfig = {
|
||||||
mobile: MobileAuthenticateConfig;
|
mobile: MobileAuthenticateConfig;
|
||||||
email: EmailAuthticateConfig;
|
email: EmailAuthticateConfig;
|
||||||
|
device: DeviceAuthticateConfig;
|
||||||
register: PubilcRegisterConfig;
|
register: PubilcRegisterConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -456,6 +457,13 @@ declare namespace API {
|
|||||||
user_subscribe_id: number;
|
user_subscribe_id: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type DeviceAuthticateConfig = {
|
||||||
|
enable: boolean;
|
||||||
|
show_ads: boolean;
|
||||||
|
enable_security: boolean;
|
||||||
|
only_real_device: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
type Document = {
|
type Document = {
|
||||||
id: number;
|
id: number;
|
||||||
title: string;
|
title: string;
|
||||||
@@ -1272,7 +1280,7 @@ declare namespace API {
|
|||||||
has_migrate: boolean;
|
has_migrate: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
type Hysteria = {
|
type Hysteria2 = {
|
||||||
port: number;
|
port: number;
|
||||||
hop_ports: string;
|
hop_ports: string;
|
||||||
hop_interval: number;
|
hop_interval: number;
|
||||||
@@ -1495,6 +1503,11 @@ declare namespace API {
|
|||||||
orderNo: string;
|
orderNo: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type PreViewNodeMultiplierResponse = {
|
||||||
|
current_time: string;
|
||||||
|
ratio: number;
|
||||||
|
};
|
||||||
|
|
||||||
type PreviewSubscribeTemplateParams = {
|
type PreviewSubscribeTemplateParams = {
|
||||||
id: number;
|
id: number;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -47,6 +47,18 @@ export async function userLogin(body: API.UserLoginRequest, options?: { [key: st
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Device Login POST /v1/auth/login/device */
|
||||||
|
export async function deviceLogin(body: API.DeviceLoginRequest, options?: { [key: string]: any }) {
|
||||||
|
return request<API.Response & { data?: API.LoginResponse }>('/v1/auth/login/device', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
data: body,
|
||||||
|
...(options || {}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** User Telephone login POST /v1/auth/login/telephone */
|
/** User Telephone login POST /v1/auth/login/telephone */
|
||||||
export async function telephoneLogin(
|
export async function telephoneLogin(
|
||||||
body: API.TelephoneLoginRequest,
|
body: API.TelephoneLoginRequest,
|
||||||
|
|||||||
+21
-1
@@ -114,6 +114,7 @@ declare namespace API {
|
|||||||
type AuthConfig = {
|
type AuthConfig = {
|
||||||
mobile: MobileAuthenticateConfig;
|
mobile: MobileAuthenticateConfig;
|
||||||
email: EmailAuthticateConfig;
|
email: EmailAuthticateConfig;
|
||||||
|
device: DeviceAuthticateConfig;
|
||||||
register: PubilcRegisterConfig;
|
register: PubilcRegisterConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -211,6 +212,19 @@ declare namespace API {
|
|||||||
currency_symbol: string;
|
currency_symbol: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type DeviceAuthticateConfig = {
|
||||||
|
enable: boolean;
|
||||||
|
show_ads: boolean;
|
||||||
|
enable_security: boolean;
|
||||||
|
only_real_device: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
type DeviceLoginRequest = {
|
||||||
|
identifier: string;
|
||||||
|
user_agent: string;
|
||||||
|
cf_token?: string;
|
||||||
|
};
|
||||||
|
|
||||||
type Document = {
|
type Document = {
|
||||||
id: number;
|
id: number;
|
||||||
title: string;
|
title: string;
|
||||||
@@ -324,7 +338,7 @@ declare namespace API {
|
|||||||
state: string;
|
state: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type Hysteria = {
|
type Hysteria2 = {
|
||||||
port: number;
|
port: number;
|
||||||
hop_ports: string;
|
hop_ports: string;
|
||||||
hop_interval: number;
|
hop_interval: number;
|
||||||
@@ -706,6 +720,7 @@ declare namespace API {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type ResetPasswordRequest = {
|
type ResetPasswordRequest = {
|
||||||
|
identifier: string;
|
||||||
email: string;
|
email: string;
|
||||||
password: string;
|
password: string;
|
||||||
code?: string;
|
code?: string;
|
||||||
@@ -898,6 +913,7 @@ declare namespace API {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type TelephoneLoginRequest = {
|
type TelephoneLoginRequest = {
|
||||||
|
identifier: string;
|
||||||
telephone: string;
|
telephone: string;
|
||||||
telephone_code: string;
|
telephone_code: string;
|
||||||
telephone_area_code: string;
|
telephone_area_code: string;
|
||||||
@@ -906,6 +922,7 @@ declare namespace API {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type TelephoneRegisterRequest = {
|
type TelephoneRegisterRequest = {
|
||||||
|
identifier: string;
|
||||||
telephone: string;
|
telephone: string;
|
||||||
telephone_area_code: string;
|
telephone_area_code: string;
|
||||||
password: string;
|
password: string;
|
||||||
@@ -915,6 +932,7 @@ declare namespace API {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type TelephoneResetPasswordRequest = {
|
type TelephoneResetPasswordRequest = {
|
||||||
|
identifier: string;
|
||||||
telephone: string;
|
telephone: string;
|
||||||
telephone_area_code: string;
|
telephone_area_code: string;
|
||||||
password: string;
|
password: string;
|
||||||
@@ -1035,12 +1053,14 @@ declare namespace API {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type UserLoginRequest = {
|
type UserLoginRequest = {
|
||||||
|
identifier: string;
|
||||||
email: string;
|
email: string;
|
||||||
password: string;
|
password: string;
|
||||||
cf_token?: string;
|
cf_token?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type UserRegisterRequest = {
|
type UserRegisterRequest = {
|
||||||
|
identifier: string;
|
||||||
email: string;
|
email: string;
|
||||||
password: string;
|
password: string;
|
||||||
invite?: string;
|
invite?: string;
|
||||||
|
|||||||
@@ -0,0 +1,74 @@
|
|||||||
|
import { create } from 'zustand';
|
||||||
|
|
||||||
|
// Fixed remote stats endpoint and required header
|
||||||
|
export const REQUIRED_HEADER_NAME = 'stats';
|
||||||
|
export const REQUIRED_HEADER_VALUE = 'ppanel.dev';
|
||||||
|
const STATS_URL = 'https://stats.ppanel.dev';
|
||||||
|
const STATS_LOADED_KEY = 'ppanel:stats:loaded';
|
||||||
|
|
||||||
|
interface StatsState {
|
||||||
|
loading: boolean;
|
||||||
|
loaded: boolean;
|
||||||
|
stats: () => Promise<void>;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function hashHostname(hostname: string): Promise<string> {
|
||||||
|
try {
|
||||||
|
const encoder = new TextEncoder();
|
||||||
|
const data = encoder.encode(hostname);
|
||||||
|
const hashBuffer = await crypto.subtle.digest('SHA-256', data);
|
||||||
|
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
||||||
|
return hashArray.map((b) => b.toString(16).padStart(2, '0')).join('');
|
||||||
|
} catch (e) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useStatsStore = create<StatsState>((set) => ({
|
||||||
|
loading: false,
|
||||||
|
loaded:
|
||||||
|
typeof window !== 'undefined' ? Boolean(window.localStorage.getItem(STATS_LOADED_KEY)) : false,
|
||||||
|
|
||||||
|
stats: async () => {
|
||||||
|
// if already recorded, skip
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
try {
|
||||||
|
if (window.localStorage.getItem(STATS_LOADED_KEY)) return;
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
|
||||||
|
set({ loading: true });
|
||||||
|
try {
|
||||||
|
const hostname =
|
||||||
|
typeof window !== 'undefined' && window.location ? window.location.hostname : '';
|
||||||
|
const domain = hostname ? await hashHostname(hostname) : '';
|
||||||
|
|
||||||
|
await fetch(STATS_URL, {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
[REQUIRED_HEADER_NAME]: REQUIRED_HEADER_VALUE,
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
domain,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
set({ loaded: true });
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
try {
|
||||||
|
window.localStorage.setItem(STATS_LOADED_KEY, '1');
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
// treat as completed to avoid repeated attempts
|
||||||
|
set({ loaded: false });
|
||||||
|
if (typeof window !== 'undefined') {
|
||||||
|
try {
|
||||||
|
window.localStorage.setItem(STATS_LOADED_KEY, '0');
|
||||||
|
} catch {}
|
||||||
|
}
|
||||||
|
} finally {
|
||||||
|
set({ loading: false });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}));
|
||||||
@@ -20,6 +20,7 @@ export default function PhoneAuthForm() {
|
|||||||
const [type, setType] = useState<'login' | 'register' | 'reset'>('login');
|
const [type, setType] = useState<'login' | 'register' | 'reset'>('login');
|
||||||
const [loading, startTransition] = useTransition();
|
const [loading, startTransition] = useTransition();
|
||||||
const [initialValues, setInitialValues] = useState<API.TelephoneLoginRequest>({
|
const [initialValues, setInitialValues] = useState<API.TelephoneLoginRequest>({
|
||||||
|
identifier: '',
|
||||||
telephone: '',
|
telephone: '',
|
||||||
telephone_area_code: '1',
|
telephone_area_code: '1',
|
||||||
password: '',
|
password: '',
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ export default function Certification({ platform, children }: CertificationProps
|
|||||||
oAuthLoginGetToken({
|
oAuthLoginGetToken({
|
||||||
method: platform,
|
method: platform,
|
||||||
callback: searchParams,
|
callback: searchParams,
|
||||||
|
// @ts-ignore
|
||||||
|
invite: localStorage.getItem('invite') || '',
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const token = res?.data?.data?.token;
|
const token = res?.data?.data?.token;
|
||||||
|
|||||||
@@ -48,6 +48,12 @@ export const useGlobalStore = create<GlobalStore>((set, get) => ({
|
|||||||
ip_register_limit: 0,
|
ip_register_limit: 0,
|
||||||
ip_register_limit_duration: 0,
|
ip_register_limit_duration: 0,
|
||||||
},
|
},
|
||||||
|
device: {
|
||||||
|
enable: false,
|
||||||
|
show_ads: false,
|
||||||
|
enable_security: false,
|
||||||
|
only_real_device: false,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
invite: {
|
invite: {
|
||||||
forced_invite: false,
|
forced_invite: false,
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "Koupit",
|
"3": "Koupit",
|
||||||
"4": "Vrácení peněz",
|
"4": "Vrácení peněz",
|
||||||
"5": "Odměna",
|
"5": "Odměna",
|
||||||
"6": "Provize"
|
"6": "Provize",
|
||||||
|
"231": "Automatické resetování",
|
||||||
|
"232": "Předběžný reset",
|
||||||
|
"233": "Placený reset",
|
||||||
|
"321": "Dobití",
|
||||||
|
"322": "Výběr",
|
||||||
|
"323": "Platba",
|
||||||
|
"324": "Vrácení peněz",
|
||||||
|
"325": "Odměna",
|
||||||
|
"326": "Úprava administrátora",
|
||||||
|
"331": "Nákup",
|
||||||
|
"332": "Obnovení",
|
||||||
|
"333": "Vrácení peněz",
|
||||||
|
"334": "Výběr",
|
||||||
|
"335": "Úprava administrátora",
|
||||||
|
"341": "Navýšení",
|
||||||
|
"342": "Snížení"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "Kaufen",
|
"3": "Kaufen",
|
||||||
"4": "Rückerstattung",
|
"4": "Rückerstattung",
|
||||||
"5": "Belohnung",
|
"5": "Belohnung",
|
||||||
"6": "Provision"
|
"6": "Provision",
|
||||||
|
"231": "Automatisches Zurücksetzen",
|
||||||
|
"232": "Vorzeitiges Zurücksetzen",
|
||||||
|
"233": "Kostenpflichtiges Zurücksetzen",
|
||||||
|
"321": "Aufladen",
|
||||||
|
"322": "Abheben",
|
||||||
|
"323": "Zahlung",
|
||||||
|
"324": "Rückerstattung",
|
||||||
|
"325": "Belohnung",
|
||||||
|
"326": "Admin-Anpassung",
|
||||||
|
"331": "Kauf",
|
||||||
|
"332": "Verlängerung",
|
||||||
|
"333": "Rückerstattung",
|
||||||
|
"334": "Abheben",
|
||||||
|
"335": "Admin-Anpassung",
|
||||||
|
"341": "Erhöhung",
|
||||||
|
"342": "Reduzierung"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "Purchase",
|
"3": "Purchase",
|
||||||
"4": "Refund",
|
"4": "Refund",
|
||||||
"5": "Reward",
|
"5": "Reward",
|
||||||
"6": "Commission"
|
"6": "Commission",
|
||||||
|
"231": "Auto Reset",
|
||||||
|
"232": "Advance Reset",
|
||||||
|
"233": "Paid Reset",
|
||||||
|
"321": "Recharge",
|
||||||
|
"322": "Withdraw",
|
||||||
|
"323": "Payment",
|
||||||
|
"324": "Refund",
|
||||||
|
"325": "Reward",
|
||||||
|
"326": "Admin Adjust",
|
||||||
|
"331": "Purchase",
|
||||||
|
"332": "Renewal",
|
||||||
|
"333": "Refund",
|
||||||
|
"334": "Withdraw",
|
||||||
|
"335": "Admin Adjust",
|
||||||
|
"341": "Increase",
|
||||||
|
"342": "Reduce"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "compra",
|
"3": "compra",
|
||||||
"4": "reembolso",
|
"4": "reembolso",
|
||||||
"5": "recompensa",
|
"5": "recompensa",
|
||||||
"6": "comisión"
|
"6": "comisión",
|
||||||
|
"231": "restablecimiento automático",
|
||||||
|
"232": "restablecimiento anticipado",
|
||||||
|
"233": "restablecimiento de pago",
|
||||||
|
"321": "recarga",
|
||||||
|
"322": "retiro",
|
||||||
|
"323": "pago",
|
||||||
|
"324": "reembolso",
|
||||||
|
"325": "recompensa",
|
||||||
|
"326": "ajuste de administrador",
|
||||||
|
"331": "compra",
|
||||||
|
"332": "renovación",
|
||||||
|
"333": "reembolso",
|
||||||
|
"334": "retiro",
|
||||||
|
"335": "ajuste de administrador",
|
||||||
|
"341": "incremento",
|
||||||
|
"342": "reducción"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "Compra",
|
"3": "Compra",
|
||||||
"4": "Reembolso",
|
"4": "Reembolso",
|
||||||
"5": "Recompensa",
|
"5": "Recompensa",
|
||||||
"6": "Comisión"
|
"6": "Comisión",
|
||||||
|
"231": "Restablecimiento automático",
|
||||||
|
"232": "Restablecimiento anticipado",
|
||||||
|
"233": "Restablecimiento de pago",
|
||||||
|
"321": "Recarga",
|
||||||
|
"322": "Retiro",
|
||||||
|
"323": "Pago",
|
||||||
|
"324": "Reembolso",
|
||||||
|
"325": "Recompensa",
|
||||||
|
"326": "Ajuste de administrador",
|
||||||
|
"331": "Compra",
|
||||||
|
"332": "Renovación",
|
||||||
|
"333": "Reembolso",
|
||||||
|
"334": "Retiro",
|
||||||
|
"335": "Ajuste de administrador",
|
||||||
|
"341": "Incremento",
|
||||||
|
"342": "Reducción"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "خرید",
|
"3": "خرید",
|
||||||
"4": "بازپرداخت",
|
"4": "بازپرداخت",
|
||||||
"5": "پاداش",
|
"5": "پاداش",
|
||||||
"6": "کمیسیون"
|
"6": "کمیسیون",
|
||||||
|
"231": "بازنشانی خودکار",
|
||||||
|
"232": "بازنشانی پیشاپیش",
|
||||||
|
"233": "بازنشانی پولی",
|
||||||
|
"321": "شارژ",
|
||||||
|
"322": "برداشت",
|
||||||
|
"323": "پرداخت",
|
||||||
|
"324": "بازپرداخت",
|
||||||
|
"325": "پاداش",
|
||||||
|
"326": "تنظیم مدیر",
|
||||||
|
"331": "خرید",
|
||||||
|
"332": "تمدید",
|
||||||
|
"333": "بازپرداخت",
|
||||||
|
"334": "برداشت",
|
||||||
|
"335": "تنظیم مدیر",
|
||||||
|
"341": "افزایش",
|
||||||
|
"342": "کاهش"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "Osto",
|
"3": "Osto",
|
||||||
"4": "Hyvitys",
|
"4": "Hyvitys",
|
||||||
"5": "Palkinto",
|
"5": "Palkinto",
|
||||||
"6": "Komissio"
|
"6": "Komissio",
|
||||||
|
"231": "Automaattinen nollaus",
|
||||||
|
"232": "Ennakkonollaus",
|
||||||
|
"233": "Maksullinen nollaus",
|
||||||
|
"321": "Lataus",
|
||||||
|
"322": "Nosto",
|
||||||
|
"323": "Maksu",
|
||||||
|
"324": "Hyvitys",
|
||||||
|
"325": "Palkinto",
|
||||||
|
"326": "Ylläpitäjän säätö",
|
||||||
|
"331": "Osto",
|
||||||
|
"332": "Uusiminen",
|
||||||
|
"333": "Hyvitys",
|
||||||
|
"334": "Nosto",
|
||||||
|
"335": "Ylläpitäjän säätö",
|
||||||
|
"341": "Lisäys",
|
||||||
|
"342": "Vähennys"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "Achat",
|
"3": "Achat",
|
||||||
"4": "Remboursement",
|
"4": "Remboursement",
|
||||||
"5": "Récompense",
|
"5": "Récompense",
|
||||||
"6": "Commission"
|
"6": "Commission",
|
||||||
|
"231": "Réinitialisation automatique",
|
||||||
|
"232": "Réinitialisation anticipée",
|
||||||
|
"233": "Réinitialisation payante",
|
||||||
|
"321": "Recharge",
|
||||||
|
"322": "Retrait",
|
||||||
|
"323": "Paiement",
|
||||||
|
"324": "Remboursement",
|
||||||
|
"325": "Récompense",
|
||||||
|
"326": "Ajustement administrateur",
|
||||||
|
"331": "Achat",
|
||||||
|
"332": "Renouvellement",
|
||||||
|
"333": "Remboursement",
|
||||||
|
"334": "Retrait",
|
||||||
|
"335": "Ajustement administrateur",
|
||||||
|
"341": "Augmentation",
|
||||||
|
"342": "Réduction"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "खरीद",
|
"3": "खरीद",
|
||||||
"4": "वापसी",
|
"4": "वापसी",
|
||||||
"5": "इनाम",
|
"5": "इनाम",
|
||||||
"6": "कमीशन"
|
"6": "कमीशन",
|
||||||
|
"231": "स्वचालित रीसेट",
|
||||||
|
"232": "अग्रिम रीसेट",
|
||||||
|
"233": "सशुल्क रीसेट",
|
||||||
|
"321": "रिचार्ज",
|
||||||
|
"322": "निकासी",
|
||||||
|
"323": "भुगतान",
|
||||||
|
"324": "वापसी",
|
||||||
|
"325": "इनाम",
|
||||||
|
"326": "व्यवस्थापक समायोजन",
|
||||||
|
"331": "खरीद",
|
||||||
|
"332": "नवीनीकरण",
|
||||||
|
"333": "वापसी",
|
||||||
|
"334": "निकासी",
|
||||||
|
"335": "व्यवस्थापक समायोजन",
|
||||||
|
"341": "वृद्धि",
|
||||||
|
"342": "कमी"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "Vásárlás",
|
"3": "Vásárlás",
|
||||||
"4": "Visszatérítés",
|
"4": "Visszatérítés",
|
||||||
"5": "Jutalom",
|
"5": "Jutalom",
|
||||||
"6": "Jutalék"
|
"6": "Jutalék",
|
||||||
|
"231": "Automatikus visszaállítás",
|
||||||
|
"232": "Előzetes visszaállítás",
|
||||||
|
"233": "Fizetős visszaállítás",
|
||||||
|
"321": "Feltöltés",
|
||||||
|
"322": "Kivétel",
|
||||||
|
"323": "Fizetés",
|
||||||
|
"324": "Visszatérítés",
|
||||||
|
"325": "Jutalom",
|
||||||
|
"326": "Admin módosítás",
|
||||||
|
"331": "Vásárlás",
|
||||||
|
"332": "Megújítás",
|
||||||
|
"333": "Visszatérítés",
|
||||||
|
"334": "Kivétel",
|
||||||
|
"335": "Admin módosítás",
|
||||||
|
"341": "Növelés",
|
||||||
|
"342": "Csökkentés"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "購入",
|
"3": "購入",
|
||||||
"4": "返金",
|
"4": "返金",
|
||||||
"5": "報酬",
|
"5": "報酬",
|
||||||
"6": "手数料"
|
"6": "手数料",
|
||||||
|
"231": "自動リセット",
|
||||||
|
"232": "事前リセット",
|
||||||
|
"233": "有料リセット",
|
||||||
|
"321": "チャージ",
|
||||||
|
"322": "引き出し",
|
||||||
|
"323": "支払い",
|
||||||
|
"324": "返金",
|
||||||
|
"325": "報酬",
|
||||||
|
"326": "管理者調整",
|
||||||
|
"331": "購入",
|
||||||
|
"332": "更新",
|
||||||
|
"333": "返金",
|
||||||
|
"334": "引き出し",
|
||||||
|
"335": "管理者調整",
|
||||||
|
"341": "増加",
|
||||||
|
"342": "減少"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "구매",
|
"3": "구매",
|
||||||
"4": "환불",
|
"4": "환불",
|
||||||
"5": "보상",
|
"5": "보상",
|
||||||
"6": "커미션"
|
"6": "커미션",
|
||||||
|
"231": "자동 초기화",
|
||||||
|
"232": "사전 초기화",
|
||||||
|
"233": "유료 초기화",
|
||||||
|
"321": "충전",
|
||||||
|
"322": "출금",
|
||||||
|
"323": "결제",
|
||||||
|
"324": "환불",
|
||||||
|
"325": "보상",
|
||||||
|
"326": "관리자 조정",
|
||||||
|
"331": "구매",
|
||||||
|
"332": "갱신",
|
||||||
|
"333": "환불",
|
||||||
|
"334": "출금",
|
||||||
|
"335": "관리자 조정",
|
||||||
|
"341": "증가",
|
||||||
|
"342": "감소"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "Kjøp",
|
"3": "Kjøp",
|
||||||
"4": "Refusjon",
|
"4": "Refusjon",
|
||||||
"5": "Belønning",
|
"5": "Belønning",
|
||||||
"6": "Kommisjon"
|
"6": "Kommisjon",
|
||||||
|
"231": "Automatisk tilbakestilling",
|
||||||
|
"232": "Forhåndstilbakestilling",
|
||||||
|
"233": "Betalt tilbakestilling",
|
||||||
|
"321": "Innskudd",
|
||||||
|
"322": "Uttak",
|
||||||
|
"323": "Betaling",
|
||||||
|
"324": "Refusjon",
|
||||||
|
"325": "Belønning",
|
||||||
|
"326": "Admin-justering",
|
||||||
|
"331": "Kjøp",
|
||||||
|
"332": "Fornyelse",
|
||||||
|
"333": "Refusjon",
|
||||||
|
"334": "Uttak",
|
||||||
|
"335": "Admin-justering",
|
||||||
|
"341": "Økning",
|
||||||
|
"342": "Reduksjon"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "Zakup",
|
"3": "Zakup",
|
||||||
"4": "Zwrot",
|
"4": "Zwrot",
|
||||||
"5": "Nagroda",
|
"5": "Nagroda",
|
||||||
"6": "Prowizja"
|
"6": "Prowizja",
|
||||||
|
"231": "Automatyczne resetowanie",
|
||||||
|
"232": "Wcześniejszy reset",
|
||||||
|
"233": "Płatny reset",
|
||||||
|
"321": "Doładowanie",
|
||||||
|
"322": "Wypłata",
|
||||||
|
"323": "Płatność",
|
||||||
|
"324": "Zwrot",
|
||||||
|
"325": "Nagroda",
|
||||||
|
"326": "Korekta administratora",
|
||||||
|
"331": "Zakup",
|
||||||
|
"332": "Odnowienie",
|
||||||
|
"333": "Zwrot",
|
||||||
|
"334": "Wypłata",
|
||||||
|
"335": "Korekta administratora",
|
||||||
|
"341": "Zwiększenie",
|
||||||
|
"342": "Zmniejszenie"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "compra",
|
"3": "compra",
|
||||||
"4": "reembolso",
|
"4": "reembolso",
|
||||||
"5": "recompensa",
|
"5": "recompensa",
|
||||||
"6": "comissão"
|
"6": "comissão",
|
||||||
|
"231": "redefinição automática",
|
||||||
|
"232": "redefinição antecipada",
|
||||||
|
"233": "redefinição paga",
|
||||||
|
"321": "recarga",
|
||||||
|
"322": "retirada",
|
||||||
|
"323": "pagamento",
|
||||||
|
"324": "reembolso",
|
||||||
|
"325": "recompensa",
|
||||||
|
"326": "ajuste do administrador",
|
||||||
|
"331": "compra",
|
||||||
|
"332": "renovação",
|
||||||
|
"333": "reembolso",
|
||||||
|
"334": "retirada",
|
||||||
|
"335": "ajuste do administrador",
|
||||||
|
"341": "aumento",
|
||||||
|
"342": "redução"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "Cumpărare",
|
"3": "Cumpărare",
|
||||||
"4": "Rambursare",
|
"4": "Rambursare",
|
||||||
"5": "Recompensă",
|
"5": "Recompensă",
|
||||||
"6": "Comision"
|
"6": "Comision",
|
||||||
|
"231": "Resetare automată",
|
||||||
|
"232": "Resetare în avans",
|
||||||
|
"233": "Resetare plătită",
|
||||||
|
"321": "Reîncărcare",
|
||||||
|
"322": "Retragere",
|
||||||
|
"323": "Plată",
|
||||||
|
"324": "Rambursare",
|
||||||
|
"325": "Recompensă",
|
||||||
|
"326": "Ajustare administrator",
|
||||||
|
"331": "Cumpărare",
|
||||||
|
"332": "Reînnoire",
|
||||||
|
"333": "Rambursare",
|
||||||
|
"334": "Retragere",
|
||||||
|
"335": "Ajustare administrator",
|
||||||
|
"341": "Creștere",
|
||||||
|
"342": "Reducere"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "Покупка",
|
"3": "Покупка",
|
||||||
"4": "Возврат",
|
"4": "Возврат",
|
||||||
"5": "Награда",
|
"5": "Награда",
|
||||||
"6": "Комиссия"
|
"6": "Комиссия",
|
||||||
|
"231": "Автосброс",
|
||||||
|
"232": "Предварительный сброс",
|
||||||
|
"233": "Платный сброс",
|
||||||
|
"321": "Пополнение",
|
||||||
|
"322": "Вывод",
|
||||||
|
"323": "Оплата",
|
||||||
|
"324": "Возврат",
|
||||||
|
"325": "Награда",
|
||||||
|
"326": "Корректировка администратора",
|
||||||
|
"331": "Покупка",
|
||||||
|
"332": "Продление",
|
||||||
|
"333": "Возврат",
|
||||||
|
"334": "Вывод",
|
||||||
|
"335": "Корректировка администратора",
|
||||||
|
"341": "Увеличение",
|
||||||
|
"342": "Уменьшение"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "ซื้อ",
|
"3": "ซื้อ",
|
||||||
"4": "คืนเงิน",
|
"4": "คืนเงิน",
|
||||||
"5": "รางวัล",
|
"5": "รางวัล",
|
||||||
"6": "ค่าคอมมิชชั่น"
|
"6": "ค่าคอมมิชชั่น",
|
||||||
|
"231": "รีเซ็ตอัตโนมัติ",
|
||||||
|
"232": "รีเซ็ตล่วงหน้า",
|
||||||
|
"233": "รีเซ็ตแบบเสียค่าใช้จ่าย",
|
||||||
|
"321": "เติมเงิน",
|
||||||
|
"322": "ถอนเงิน",
|
||||||
|
"323": "การชำระเงิน",
|
||||||
|
"324": "คืนเงิน",
|
||||||
|
"325": "รางวัล",
|
||||||
|
"326": "ปรับโดยผู้ดูแล",
|
||||||
|
"331": "ซื้อ",
|
||||||
|
"332": "ต่ออายุ",
|
||||||
|
"333": "คืนเงิน",
|
||||||
|
"334": "ถอนเงิน",
|
||||||
|
"335": "ปรับโดยผู้ดูแล",
|
||||||
|
"341": "เพิ่มขึ้น",
|
||||||
|
"342": "ลดลง"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "Satın Alma",
|
"3": "Satın Alma",
|
||||||
"4": "İade",
|
"4": "İade",
|
||||||
"5": "Ödül",
|
"5": "Ödül",
|
||||||
"6": "Komisyon"
|
"6": "Komisyon",
|
||||||
|
"231": "Otomatik Sıfırlama",
|
||||||
|
"232": "Önceden Sıfırlama",
|
||||||
|
"233": "Ücretli Sıfırlama",
|
||||||
|
"321": "Yükleme",
|
||||||
|
"322": "Çekme",
|
||||||
|
"323": "Ödeme",
|
||||||
|
"324": "İade",
|
||||||
|
"325": "Ödül",
|
||||||
|
"326": "Yönetici Ayarı",
|
||||||
|
"331": "Satın Alma",
|
||||||
|
"332": "Yenileme",
|
||||||
|
"333": "İade",
|
||||||
|
"334": "Çekme",
|
||||||
|
"335": "Yönetici Ayarı",
|
||||||
|
"341": "Artış",
|
||||||
|
"342": "Azaltma"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "Покупка",
|
"3": "Покупка",
|
||||||
"4": "Повернення коштів",
|
"4": "Повернення коштів",
|
||||||
"5": "Нагорода",
|
"5": "Нагорода",
|
||||||
"6": "Комісія"
|
"6": "Комісія",
|
||||||
|
"231": "Автоскидання",
|
||||||
|
"232": "Попереднє скидання",
|
||||||
|
"233": "Платне скидання",
|
||||||
|
"321": "Поповнення",
|
||||||
|
"322": "Виведення",
|
||||||
|
"323": "Платіж",
|
||||||
|
"324": "Повернення коштів",
|
||||||
|
"325": "Нагорода",
|
||||||
|
"326": "Коригування адміністратора",
|
||||||
|
"331": "Покупка",
|
||||||
|
"332": "Поновлення",
|
||||||
|
"333": "Повернення коштів",
|
||||||
|
"334": "Виведення",
|
||||||
|
"335": "Коригування адміністратора",
|
||||||
|
"341": "Збільшення",
|
||||||
|
"342": "Зменшення"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "Mua",
|
"3": "Mua",
|
||||||
"4": "Hoàn tiền",
|
"4": "Hoàn tiền",
|
||||||
"5": "Thưởng",
|
"5": "Thưởng",
|
||||||
"6": "Hoa hồng"
|
"6": "Hoa hồng",
|
||||||
|
"231": "Tự động đặt lại",
|
||||||
|
"232": "Đặt lại trước hạn",
|
||||||
|
"233": "Đặt lại trả phí",
|
||||||
|
"321": "Nạp tiền",
|
||||||
|
"322": "Rút tiền",
|
||||||
|
"323": "Thanh toán",
|
||||||
|
"324": "Hoàn tiền",
|
||||||
|
"325": "Thưởng",
|
||||||
|
"326": "Điều chỉnh quản trị",
|
||||||
|
"331": "Mua",
|
||||||
|
"332": "Gia hạn",
|
||||||
|
"333": "Hoàn tiền",
|
||||||
|
"334": "Rút tiền",
|
||||||
|
"335": "Điều chỉnh quản trị",
|
||||||
|
"341": "Tăng",
|
||||||
|
"342": "Giảm"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "购买",
|
"3": "购买",
|
||||||
"4": "退款",
|
"4": "退款",
|
||||||
"5": "奖励",
|
"5": "奖励",
|
||||||
"6": "佣金"
|
"6": "佣金",
|
||||||
|
"231": "自动重置",
|
||||||
|
"232": "提前重置",
|
||||||
|
"233": "付费重置",
|
||||||
|
"321": "充值",
|
||||||
|
"322": "提取",
|
||||||
|
"323": "付款",
|
||||||
|
"324": "退款",
|
||||||
|
"325": "奖励",
|
||||||
|
"326": "管理员调整",
|
||||||
|
"331": "购买",
|
||||||
|
"332": "续订",
|
||||||
|
"333": "退款",
|
||||||
|
"334": "提取",
|
||||||
|
"335": "管理员调整",
|
||||||
|
"341": "增加",
|
||||||
|
"342": "减少"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,22 @@
|
|||||||
"3": "購買",
|
"3": "購買",
|
||||||
"4": "退款",
|
"4": "退款",
|
||||||
"5": "獎勵",
|
"5": "獎勵",
|
||||||
"6": "佣金"
|
"6": "佣金",
|
||||||
|
"231": "自動重置",
|
||||||
|
"232": "預先重置",
|
||||||
|
"233": "付費重置",
|
||||||
|
"321": "充值",
|
||||||
|
"322": "提取",
|
||||||
|
"323": "付款",
|
||||||
|
"324": "退款",
|
||||||
|
"325": "獎勵",
|
||||||
|
"326": "管理員調整",
|
||||||
|
"331": "購買",
|
||||||
|
"332": "續訂",
|
||||||
|
"333": "退款",
|
||||||
|
"334": "提取",
|
||||||
|
"335": "管理員調整",
|
||||||
|
"341": "增加",
|
||||||
|
"342": "減少"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
"zh-CN",
|
"zh-CN",
|
||||||
"zh-HK"
|
"zh-HK"
|
||||||
],
|
],
|
||||||
"modelName": "gpt-4o-mini",
|
"modelName": "gpt-4o",
|
||||||
"experimental": {
|
"experimental": {
|
||||||
"jsonMode": true
|
"jsonMode": true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -47,6 +47,18 @@ export async function userLogin(body: API.UserLoginRequest, options?: { [key: st
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Device Login POST /v1/auth/login/device */
|
||||||
|
export async function deviceLogin(body: API.DeviceLoginRequest, options?: { [key: string]: any }) {
|
||||||
|
return request<API.Response & { data?: API.LoginResponse }>('/v1/auth/login/device', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
data: body,
|
||||||
|
...(options || {}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** User Telephone login POST /v1/auth/login/telephone */
|
/** User Telephone login POST /v1/auth/login/telephone */
|
||||||
export async function telephoneLogin(
|
export async function telephoneLogin(
|
||||||
body: API.TelephoneLoginRequest,
|
body: API.TelephoneLoginRequest,
|
||||||
|
|||||||
+21
-1
@@ -114,6 +114,7 @@ declare namespace API {
|
|||||||
type AuthConfig = {
|
type AuthConfig = {
|
||||||
mobile: MobileAuthenticateConfig;
|
mobile: MobileAuthenticateConfig;
|
||||||
email: EmailAuthticateConfig;
|
email: EmailAuthticateConfig;
|
||||||
|
device: DeviceAuthticateConfig;
|
||||||
register: PubilcRegisterConfig;
|
register: PubilcRegisterConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -211,6 +212,19 @@ declare namespace API {
|
|||||||
currency_symbol: string;
|
currency_symbol: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type DeviceAuthticateConfig = {
|
||||||
|
enable: boolean;
|
||||||
|
show_ads: boolean;
|
||||||
|
enable_security: boolean;
|
||||||
|
only_real_device: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
|
type DeviceLoginRequest = {
|
||||||
|
identifier: string;
|
||||||
|
user_agent: string;
|
||||||
|
cf_token?: string;
|
||||||
|
};
|
||||||
|
|
||||||
type Document = {
|
type Document = {
|
||||||
id: number;
|
id: number;
|
||||||
title: string;
|
title: string;
|
||||||
@@ -324,7 +338,7 @@ declare namespace API {
|
|||||||
state: string;
|
state: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type Hysteria = {
|
type Hysteria2 = {
|
||||||
port: number;
|
port: number;
|
||||||
hop_ports: string;
|
hop_ports: string;
|
||||||
hop_interval: number;
|
hop_interval: number;
|
||||||
@@ -706,6 +720,7 @@ declare namespace API {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type ResetPasswordRequest = {
|
type ResetPasswordRequest = {
|
||||||
|
identifier: string;
|
||||||
email: string;
|
email: string;
|
||||||
password: string;
|
password: string;
|
||||||
code?: string;
|
code?: string;
|
||||||
@@ -898,6 +913,7 @@ declare namespace API {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type TelephoneLoginRequest = {
|
type TelephoneLoginRequest = {
|
||||||
|
identifier: string;
|
||||||
telephone: string;
|
telephone: string;
|
||||||
telephone_code: string;
|
telephone_code: string;
|
||||||
telephone_area_code: string;
|
telephone_area_code: string;
|
||||||
@@ -906,6 +922,7 @@ declare namespace API {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type TelephoneRegisterRequest = {
|
type TelephoneRegisterRequest = {
|
||||||
|
identifier: string;
|
||||||
telephone: string;
|
telephone: string;
|
||||||
telephone_area_code: string;
|
telephone_area_code: string;
|
||||||
password: string;
|
password: string;
|
||||||
@@ -915,6 +932,7 @@ declare namespace API {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type TelephoneResetPasswordRequest = {
|
type TelephoneResetPasswordRequest = {
|
||||||
|
identifier: string;
|
||||||
telephone: string;
|
telephone: string;
|
||||||
telephone_area_code: string;
|
telephone_area_code: string;
|
||||||
password: string;
|
password: string;
|
||||||
@@ -1035,12 +1053,14 @@ declare namespace API {
|
|||||||
};
|
};
|
||||||
|
|
||||||
type UserLoginRequest = {
|
type UserLoginRequest = {
|
||||||
|
identifier: string;
|
||||||
email: string;
|
email: string;
|
||||||
password: string;
|
password: string;
|
||||||
cf_token?: string;
|
cf_token?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
type UserRegisterRequest = {
|
type UserRegisterRequest = {
|
||||||
|
identifier: string;
|
||||||
email: string;
|
email: string;
|
||||||
password: string;
|
password: string;
|
||||||
invite?: string;
|
invite?: string;
|
||||||
|
|||||||
@@ -19,3 +19,14 @@ export async function querySubscribeList(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Get user subscribe node info GET /v1/public/subscribe/node/list */
|
||||||
|
export async function queryUserSubscribeNodeList(options?: { [key: string]: any }) {
|
||||||
|
return request<API.Response & { data?: API.QueryUserSubscribeNodeListResponse }>(
|
||||||
|
'/v1/public/subscribe/node/list',
|
||||||
|
{
|
||||||
|
method: 'GET',
|
||||||
|
...(options || {}),
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
Vendored
+55
-1
@@ -108,6 +108,7 @@ declare namespace API {
|
|||||||
type AuthConfig = {
|
type AuthConfig = {
|
||||||
mobile: MobileAuthenticateConfig;
|
mobile: MobileAuthenticateConfig;
|
||||||
email: EmailAuthticateConfig;
|
email: EmailAuthticateConfig;
|
||||||
|
device: DeviceAuthticateConfig;
|
||||||
register: PubilcRegisterConfig;
|
register: PubilcRegisterConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -204,6 +205,13 @@ declare namespace API {
|
|||||||
currency_symbol: string;
|
currency_symbol: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type DeviceAuthticateConfig = {
|
||||||
|
enable: boolean;
|
||||||
|
show_ads: boolean;
|
||||||
|
enable_security: boolean;
|
||||||
|
only_real_device: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
type Document = {
|
type Document = {
|
||||||
id: number;
|
id: number;
|
||||||
title: string;
|
title: string;
|
||||||
@@ -256,6 +264,11 @@ declare namespace API {
|
|||||||
list: PaymentMethod[];
|
list: PaymentMethod[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type GetDeviceListResponse = {
|
||||||
|
list: UserDevice[];
|
||||||
|
total: number;
|
||||||
|
};
|
||||||
|
|
||||||
type GetLoginLogParams = {
|
type GetLoginLogParams = {
|
||||||
page: number;
|
page: number;
|
||||||
size: number;
|
size: number;
|
||||||
@@ -343,7 +356,7 @@ declare namespace API {
|
|||||||
list: Ticket[];
|
list: Ticket[];
|
||||||
};
|
};
|
||||||
|
|
||||||
type Hysteria = {
|
type Hysteria2 = {
|
||||||
port: number;
|
port: number;
|
||||||
hop_ports: string;
|
hop_ports: string;
|
||||||
hop_interval: number;
|
hop_interval: number;
|
||||||
@@ -799,6 +812,10 @@ declare namespace API {
|
|||||||
total: number;
|
total: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type QueryUserSubscribeNodeListResponse = {
|
||||||
|
list: UserSubscribeInfo[];
|
||||||
|
};
|
||||||
|
|
||||||
type RechargeOrderRequest = {
|
type RechargeOrderRequest = {
|
||||||
amount: number;
|
amount: number;
|
||||||
payment: number;
|
payment: number;
|
||||||
@@ -1039,6 +1056,10 @@ declare namespace API {
|
|||||||
security_config: SecurityConfig;
|
security_config: SecurityConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type UnbindDeviceRequest = {
|
||||||
|
id: number;
|
||||||
|
};
|
||||||
|
|
||||||
type UnbindOAuthRequest = {
|
type UnbindOAuthRequest = {
|
||||||
method: string;
|
method: string;
|
||||||
};
|
};
|
||||||
@@ -1150,6 +1171,26 @@ declare namespace API {
|
|||||||
updated_at: number;
|
updated_at: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type UserSubscribeInfo = {
|
||||||
|
id: number;
|
||||||
|
user_id: number;
|
||||||
|
order_id: number;
|
||||||
|
subscribe_id: number;
|
||||||
|
start_time: number;
|
||||||
|
expire_time: number;
|
||||||
|
finished_at: number;
|
||||||
|
reset_time: number;
|
||||||
|
traffic: number;
|
||||||
|
download: number;
|
||||||
|
upload: number;
|
||||||
|
token: string;
|
||||||
|
status: number;
|
||||||
|
created_at: number;
|
||||||
|
updated_at: number;
|
||||||
|
is_try_out: boolean;
|
||||||
|
nodes: UserSubscribeNodeInfo[];
|
||||||
|
};
|
||||||
|
|
||||||
type UserSubscribeLog = {
|
type UserSubscribeLog = {
|
||||||
id: number;
|
id: number;
|
||||||
user_id: number;
|
user_id: number;
|
||||||
@@ -1160,6 +1201,19 @@ declare namespace API {
|
|||||||
timestamp: number;
|
timestamp: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type UserSubscribeNodeInfo = {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
uuid: string;
|
||||||
|
protocol: string;
|
||||||
|
port: number;
|
||||||
|
address: string;
|
||||||
|
tags: string[];
|
||||||
|
country: string;
|
||||||
|
city: string;
|
||||||
|
created_at: number;
|
||||||
|
};
|
||||||
|
|
||||||
type VerifyCodeConfig = {
|
type VerifyCodeConfig = {
|
||||||
verify_code_expire_time: number;
|
verify_code_expire_time: number;
|
||||||
verify_code_limit: number;
|
verify_code_limit: number;
|
||||||
|
|||||||
@@ -128,6 +128,14 @@ export async function queryUserCommissionLog(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Get Device List GET /v1/public/user/devices */
|
||||||
|
export async function getDeviceList(options?: { [key: string]: any }) {
|
||||||
|
return request<API.Response & { data?: API.GetDeviceListResponse }>('/v1/public/user/devices', {
|
||||||
|
method: 'GET',
|
||||||
|
...(options || {}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** Query User Info GET /v1/public/user/info */
|
/** Query User Info GET /v1/public/user/info */
|
||||||
export async function queryUserInfo(options?: { [key: string]: any }) {
|
export async function queryUserInfo(options?: { [key: string]: any }) {
|
||||||
return request<API.Response & { data?: API.User }>('/v1/public/user/info', {
|
return request<API.Response & { data?: API.User }>('/v1/public/user/info', {
|
||||||
@@ -236,6 +244,21 @@ export async function resetUserSubscribeToken(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Unbind Device PUT /v1/public/user/unbind_device */
|
||||||
|
export async function unbindDevice(
|
||||||
|
body: API.UnbindDeviceRequest,
|
||||||
|
options?: { [key: string]: any },
|
||||||
|
) {
|
||||||
|
return request<API.Response & { data?: any }>('/v1/public/user/unbind_device', {
|
||||||
|
method: 'PUT',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
data: body,
|
||||||
|
...(options || {}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** Unbind OAuth POST /v1/public/user/unbind_oauth */
|
/** Unbind OAuth POST /v1/public/user/unbind_oauth */
|
||||||
export async function unbindOAuth(body: API.UnbindOAuthRequest, options?: { [key: string]: any }) {
|
export async function unbindOAuth(body: API.UnbindOAuthRequest, options?: { [key: string]: any }) {
|
||||||
return request<API.Response & { data?: any }>('/v1/public/user/unbind_oauth', {
|
return request<API.Response & { data?: any }>('/v1/public/user/unbind_oauth', {
|
||||||
|
|||||||
+86
-4
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ppanel-web",
|
"name": "ppanel-web",
|
||||||
"version": "1.5.2",
|
"version": "1.5.4",
|
||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "https://github.com/perfect-panel/ppanel-web",
|
"homepage": "https://github.com/perfect-panel/ppanel-web",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
@@ -12,8 +12,8 @@
|
|||||||
},
|
},
|
||||||
"license": "GUN",
|
"license": "GUN",
|
||||||
"workspaces": [
|
"workspaces": [
|
||||||
"apps/*",
|
"packages/*",
|
||||||
"packages/*"
|
"apps/*"
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "turbo build",
|
"build": "turbo build",
|
||||||
@@ -47,21 +47,103 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"prettier": "@workspace/prettier-config",
|
"prettier": "@workspace/prettier-config",
|
||||||
|
"dependencies": {
|
||||||
|
"@dnd-kit/core": "^6.3.1",
|
||||||
|
"@dnd-kit/sortable": "^10.0.0",
|
||||||
|
"@dnd-kit/utilities": "^3.2.2",
|
||||||
|
"@hookform/resolvers": "^5.2.1",
|
||||||
|
"@iconify-json/flagpack": "^1.2.2",
|
||||||
|
"@iconify-json/logos": "^1.2.4",
|
||||||
|
"@iconify-json/mdi": "^1.2.2",
|
||||||
|
"@iconify-json/simple-icons": "^1.2.20",
|
||||||
|
"@iconify-json/uil": "^1.2.3",
|
||||||
|
"@iconify/react": "^5.2.0",
|
||||||
|
"@lottiefiles/dotlottie-react": "^0.15.1",
|
||||||
|
"@monaco-editor/react": "^4.7.0",
|
||||||
|
"@radix-ui/react-accordion": "^1.2.12",
|
||||||
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
||||||
|
"@radix-ui/react-aspect-ratio": "^1.1.7",
|
||||||
|
"@radix-ui/react-avatar": "^1.1.10",
|
||||||
|
"@radix-ui/react-checkbox": "^1.3.3",
|
||||||
|
"@radix-ui/react-collapsible": "^1.1.12",
|
||||||
|
"@radix-ui/react-context-menu": "^2.2.16",
|
||||||
|
"@radix-ui/react-dialog": "^1.1.15",
|
||||||
|
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
||||||
|
"@radix-ui/react-hover-card": "^1.1.15",
|
||||||
|
"@radix-ui/react-label": "^2.1.7",
|
||||||
|
"@radix-ui/react-menubar": "^1.1.16",
|
||||||
|
"@radix-ui/react-navigation-menu": "^1.2.14",
|
||||||
|
"@radix-ui/react-popover": "^1.1.15",
|
||||||
|
"@radix-ui/react-progress": "^1.1.7",
|
||||||
|
"@radix-ui/react-radio-group": "^1.3.8",
|
||||||
|
"@radix-ui/react-scroll-area": "^1.2.10",
|
||||||
|
"@radix-ui/react-select": "^2.2.6",
|
||||||
|
"@radix-ui/react-separator": "^1.1.7",
|
||||||
|
"@radix-ui/react-slider": "^1.3.6",
|
||||||
|
"@radix-ui/react-slot": "^1.2.3",
|
||||||
|
"@radix-ui/react-switch": "^1.2.6",
|
||||||
|
"@radix-ui/react-tabs": "^1.1.13",
|
||||||
|
"@radix-ui/react-toast": "^1.2.4",
|
||||||
|
"@radix-ui/react-toggle": "^1.1.10",
|
||||||
|
"@radix-ui/react-toggle-group": "^1.1.11",
|
||||||
|
"@radix-ui/react-tooltip": "^1.2.8",
|
||||||
|
"@tanstack/react-table": "^8.20.6",
|
||||||
|
"ahooks": "^3.9.4",
|
||||||
|
"class-variance-authority": "^0.7.1",
|
||||||
|
"clsx": "^2.1.1",
|
||||||
|
"cmdk": "^1.1.1",
|
||||||
|
"date-fns": "^4.1.0",
|
||||||
|
"embla-carousel-react": "^8.6.0",
|
||||||
|
"framer-motion": "^11.18.1",
|
||||||
|
"input-otp": "^1.4.2",
|
||||||
|
"lucide-react": "^0.542.0",
|
||||||
|
"mathjs": "^14.0.1",
|
||||||
|
"monaco-editor": "^0.54.0 ",
|
||||||
|
"monaco-themes": "^0.4.6",
|
||||||
|
"motion": "^11.18.1",
|
||||||
|
"next-themes": "^0.4.6",
|
||||||
|
"react-day-picker": "^9.9.0",
|
||||||
|
"react-hook-form": "^7.62.0",
|
||||||
|
"react-markdown": "^9.0.3",
|
||||||
|
"react-resizable-panels": "^3.0.5",
|
||||||
|
"react-syntax-highlighter": "^15.6.1",
|
||||||
|
"recharts": "2.15.4",
|
||||||
|
"rehype-katex": "^7.0.1",
|
||||||
|
"rehype-raw": "^7.0.0",
|
||||||
|
"remark-gfm": "^4.0.0",
|
||||||
|
"remark-math": "^6.0.0",
|
||||||
|
"remark-toc": "^9.0.0",
|
||||||
|
"rtl-detect": "^1.1.2",
|
||||||
|
"sonner": "^2.0.7",
|
||||||
|
"tailwind-merge": "^2.6.0",
|
||||||
|
"tailwindcss-animate": "^1.0.7",
|
||||||
|
"vaul": "^1.1.2",
|
||||||
|
"zod": "^4.1.5"
|
||||||
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@eslint/js": "^9.38.0",
|
||||||
"@netlify/plugin-nextjs": "^5.12.1",
|
"@netlify/plugin-nextjs": "^5.12.1",
|
||||||
"@umijs/openapi": "^1.13.15",
|
"@umijs/openapi": "^1.13.15",
|
||||||
"@workspace/commitlint-config": "workspace:*",
|
"@workspace/commitlint-config": "workspace:*",
|
||||||
"@workspace/eslint-config": "workspace:*",
|
"@workspace/eslint-config": "workspace:*",
|
||||||
"@workspace/prettier-config": "workspace:*",
|
"@workspace/prettier-config": "workspace:*",
|
||||||
"@workspace/typescript-config": "workspace:*",
|
"@workspace/typescript-config": "workspace:*",
|
||||||
|
"autoprefixer": "^10.4.21",
|
||||||
|
"commitlint": "^19.6.1",
|
||||||
|
"eslint": "^9.17.0",
|
||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
"lint-staged": "^16.1.5",
|
"lint-staged": "^16.1.5",
|
||||||
|
"postcss": "^8.5.6",
|
||||||
|
"prettier": "^3.4.2",
|
||||||
|
"react": "^19.1.1",
|
||||||
|
"react-dom": "^19.1.1",
|
||||||
"semantic-release": "21.1.2",
|
"semantic-release": "21.1.2",
|
||||||
"semantic-release-config-gitmoji": "^1.5.3",
|
"semantic-release-config-gitmoji": "^1.5.3",
|
||||||
|
"tailwindcss": "^3.4.17",
|
||||||
"turbo": "^2.5.6",
|
"turbo": "^2.5.6",
|
||||||
"typescript": "^5.9.2"
|
"typescript": "^5.9.2"
|
||||||
},
|
},
|
||||||
"packageManager": "bun@1.1.43",
|
"packageManager": "bun@1.3.0",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=20"
|
"node": ">=20"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@dnd-kit/core": "^6.3.1",
|
"@dnd-kit/core": "^6.3.1",
|
||||||
"@dnd-kit/sortable": "^10.0.0",
|
"@dnd-kit/sortable": "^10.0.0",
|
||||||
|
"@dnd-kit/utilities": "^3.2.2",
|
||||||
"@hookform/resolvers": "^5.2.1",
|
"@hookform/resolvers": "^5.2.1",
|
||||||
"@iconify-json/flagpack": "^1.2.2",
|
"@iconify-json/flagpack": "^1.2.2",
|
||||||
"@iconify-json/logos": "^1.2.4",
|
"@iconify-json/logos": "^1.2.4",
|
||||||
@@ -27,7 +28,7 @@
|
|||||||
"@iconify-json/simple-icons": "^1.2.20",
|
"@iconify-json/simple-icons": "^1.2.20",
|
||||||
"@iconify-json/uil": "^1.2.3",
|
"@iconify-json/uil": "^1.2.3",
|
||||||
"@iconify/react": "^5.2.0",
|
"@iconify/react": "^5.2.0",
|
||||||
"@monaco-editor/react": "^4.6.0",
|
"@monaco-editor/react": "^4.7.0",
|
||||||
"@radix-ui/react-accordion": "^1.2.12",
|
"@radix-ui/react-accordion": "^1.2.12",
|
||||||
"@radix-ui/react-alert-dialog": "^1.1.15",
|
"@radix-ui/react-alert-dialog": "^1.1.15",
|
||||||
"@radix-ui/react-aspect-ratio": "^1.1.7",
|
"@radix-ui/react-aspect-ratio": "^1.1.7",
|
||||||
@@ -65,6 +66,7 @@
|
|||||||
"input-otp": "^1.4.2",
|
"input-otp": "^1.4.2",
|
||||||
"lucide-react": "^0.542.0",
|
"lucide-react": "^0.542.0",
|
||||||
"mathjs": "^14.0.1",
|
"mathjs": "^14.0.1",
|
||||||
|
"monaco-editor": "^0.54.0 ",
|
||||||
"monaco-themes": "^0.4.6",
|
"monaco-themes": "^0.4.6",
|
||||||
"motion": "^11.18.1",
|
"motion": "^11.18.1",
|
||||||
"next-themes": "^0.4.6",
|
"next-themes": "^0.4.6",
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ interface FieldConfig extends Omit<EnhancedInputProps, 'type'> {
|
|||||||
name: string;
|
name: string;
|
||||||
type: 'text' | 'number' | 'select' | 'time' | 'boolean' | 'textarea';
|
type: 'text' | 'number' | 'select' | 'time' | 'boolean' | 'textarea';
|
||||||
options?: { label: string; value: string }[];
|
options?: { label: string; value: string }[];
|
||||||
|
// optional per-item visibility function: returns true to show the field for the given item
|
||||||
|
visible?: (item: Record<string, any>) => boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ObjectInputProps<T> {
|
interface ObjectInputProps<T> {
|
||||||
@@ -40,6 +42,8 @@ export function ObjectInput<T extends Record<string, any>>({
|
|||||||
onChange(updatedInternalState);
|
onChange(updatedInternalState);
|
||||||
};
|
};
|
||||||
const renderField = (field: FieldConfig) => {
|
const renderField = (field: FieldConfig) => {
|
||||||
|
// if visible callback exists and returns false for current item, don't render
|
||||||
|
if (field.visible && !field.visible(internalState)) return null;
|
||||||
switch (field.type) {
|
switch (field.type) {
|
||||||
case 'select':
|
case 'select':
|
||||||
return (
|
return (
|
||||||
@@ -86,11 +90,15 @@ export function ObjectInput<T extends Record<string, any>>({
|
|||||||
};
|
};
|
||||||
return (
|
return (
|
||||||
<div className={cn('flex flex-1 flex-wrap gap-4', className)}>
|
<div className={cn('flex flex-1 flex-wrap gap-4', className)}>
|
||||||
{fields.map((field) => (
|
{fields.map((field) => {
|
||||||
|
const node = renderField(field);
|
||||||
|
if (node === null) return null; // don't render wrapper if field hidden
|
||||||
|
return (
|
||||||
<div key={field.name} className={cn('flex-1', field.className)}>
|
<div key={field.name} className={cn('flex-1', field.className)}>
|
||||||
{renderField(field)}
|
{node}
|
||||||
</div>
|
</div>
|
||||||
))}
|
);
|
||||||
|
})}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
import { Button } from '@workspace/ui/components/button';
|
import { Button } from '@workspace/ui/components/button';
|
||||||
import { cn } from '@workspace/ui/lib/utils';
|
import { cn } from '@workspace/ui/lib/utils';
|
||||||
import 'katex/dist/katex.min.css';
|
|
||||||
import { Check, Copy } from 'lucide-react';
|
import { Check, Copy } from 'lucide-react';
|
||||||
import { useCallback, useState } from 'react';
|
import { useCallback, useState } from 'react';
|
||||||
import ReactMarkdown, { Components } from 'react-markdown';
|
import ReactMarkdown, { Components } from 'react-markdown';
|
||||||
|
|||||||
@@ -143,9 +143,9 @@ export function ProTable<
|
|||||||
header: texts?.actions,
|
header: texts?.actions,
|
||||||
cell: ({ row }) => (
|
cell: ({ row }) => (
|
||||||
<div className='flex items-center justify-end gap-2'>
|
<div className='flex items-center justify-end gap-2'>
|
||||||
{actions
|
{actions?.render?.(row.original).map((item, index) => (
|
||||||
?.render?.(row.original)
|
<Fragment key={index}>{item}</Fragment>
|
||||||
.map((item, index) => <Fragment key={index}>{item}</Fragment>)}
|
))}
|
||||||
</div>
|
</div>
|
||||||
),
|
),
|
||||||
enableSorting: false,
|
enableSorting: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user