Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c3d0ef8317 | |||
| 8bd25d651b | |||
| ca892dd359 | |||
| 521a7a97fb | |||
| a46657d5ef |
+25
-15
@@ -1,38 +1,48 @@
|
||||
<a name="readme-top"></a>
|
||||
# Changelog
|
||||
|
||||
## [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)
|
||||
|
||||
|
||||
### 🐛 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))
|
||||
* 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))
|
||||
- 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))
|
||||
- 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)
|
||||
|
||||
|
||||
### 🐛 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)
|
||||
|
||||
|
||||
### ✨ 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
|
||||
|
||||
* 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 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 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))
|
||||
- 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 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 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))
|
||||
|
||||
<a name="readme-top"></a>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { x25519 } from '@noble/curves/ed25519';
|
||||
import * as x25519 from '@noble/ed25519';
|
||||
import { toB64Url } from './util';
|
||||
|
||||
/**
|
||||
|
||||
@@ -5,14 +5,11 @@ import {
|
||||
createServer,
|
||||
deleteServer,
|
||||
filterServerList,
|
||||
hasMigrateSeverNode,
|
||||
migrateServerNode,
|
||||
resetSortWithServer,
|
||||
updateServer,
|
||||
} from '@/services/admin/server';
|
||||
import { useNode } from '@/store/node';
|
||||
import { useServer } from '@/store/server';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { Badge } from '@workspace/ui/components/badge';
|
||||
import { Button } from '@workspace/ui/components/button';
|
||||
import { ConfirmButton } from '@workspace/ui/custom-components/confirm-button';
|
||||
@@ -66,33 +63,6 @@ export default function ServersPage() {
|
||||
const [migrating, setMigrating] = useState(false);
|
||||
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 (
|
||||
<div className='space-y-4'>
|
||||
<div className='grid grid-cols-1 gap-4 md:grid-cols-2'>
|
||||
@@ -105,11 +75,6 @@ export default function ServersPage() {
|
||||
title: t('pageTitle'),
|
||||
toolbar: (
|
||||
<div className='flex gap-2'>
|
||||
{hasMigrate && (
|
||||
<Button variant='outline' onClick={handleMigrate} disabled={migrating}>
|
||||
{migrating ? t('migrating') : t('migrate')}
|
||||
</Button>
|
||||
)}
|
||||
<ServerForm
|
||||
trigger={t('create')}
|
||||
title={t('drawerCreateTitle')}
|
||||
|
||||
@@ -43,6 +43,7 @@ import { useEffect, useState } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
import { toast } from 'sonner';
|
||||
import { z } from 'zod';
|
||||
import { SS_CIPHERS } from './form-schema';
|
||||
|
||||
const dnsConfigSchema = z.object({
|
||||
proto: z.string(), // z.enum(['tcp', 'udp', 'tls', 'https', 'quic']),
|
||||
@@ -55,6 +56,7 @@ const outboundConfigSchema = z.object({
|
||||
protocol: z.string(),
|
||||
address: z.string(),
|
||||
port: z.number(),
|
||||
cipher: z.string().optional(),
|
||||
password: z.string().optional(),
|
||||
rules: z.array(z.string()).optional(),
|
||||
});
|
||||
@@ -92,7 +94,7 @@ export default function ServerConfig() {
|
||||
node_pull_interval: undefined,
|
||||
node_push_interval: undefined,
|
||||
traffic_report_threshold: undefined,
|
||||
ip_strategy: undefined,
|
||||
ip_strategy: 'prefer_ipv4',
|
||||
dns: [],
|
||||
block: [],
|
||||
outbound: [],
|
||||
@@ -106,7 +108,8 @@ export default function ServerConfig() {
|
||||
node_pull_interval: cfgResp.node_pull_interval as number | undefined,
|
||||
node_push_interval: cfgResp.node_push_interval 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 || [],
|
||||
block: cfgResp.block || [],
|
||||
outbound: cfgResp.outbound || [],
|
||||
@@ -364,89 +367,104 @@ export default function ServerConfig() {
|
||||
<FormField
|
||||
control={form.control}
|
||||
name='outbound'
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
<FormControl>
|
||||
<ArrayInput
|
||||
className='grid grid-cols-2 gap-2'
|
||||
fields={[
|
||||
{
|
||||
name: 'name',
|
||||
type: 'text',
|
||||
className: 'col-span-2',
|
||||
placeholder: t('server_config.fields.outbound_name_placeholder'),
|
||||
},
|
||||
{
|
||||
name: 'protocol',
|
||||
type: 'select',
|
||||
placeholder: t(
|
||||
'server_config.fields.outbound_protocol_placeholder',
|
||||
),
|
||||
options: [
|
||||
{ label: 'HTTP', value: 'http' },
|
||||
{ label: 'SOCKS', value: 'socks' },
|
||||
{ label: 'Shadowsocks', value: 'shadowsocks' },
|
||||
{ label: 'Brook', value: 'brook' },
|
||||
{ label: 'Snell', value: 'snell' },
|
||||
{ label: 'VMess', value: 'vmess' },
|
||||
{ label: 'VLESS', value: 'vless' },
|
||||
{ label: 'Trojan', value: 'trojan' },
|
||||
{ label: 'WireGuard', value: 'wireguard' },
|
||||
{ label: 'Hysteria', value: 'hysteria' },
|
||||
{ label: 'TUIC', value: 'tuic' },
|
||||
{ label: 'AnyTLS', value: 'anytls' },
|
||||
{ label: 'Naive', value: 'naive' },
|
||||
{ label: 'Direct', value: 'direct' },
|
||||
{ label: 'Reject', value: 'reject' },
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'address',
|
||||
type: 'text',
|
||||
placeholder: t('server_config.fields.outbound_address_placeholder'),
|
||||
},
|
||||
{
|
||||
name: 'port',
|
||||
type: 'number',
|
||||
placeholder: t('server_config.fields.outbound_port_placeholder'),
|
||||
},
|
||||
{
|
||||
name: 'password',
|
||||
type: 'text',
|
||||
placeholder: t(
|
||||
'server_config.fields.outbound_password_placeholder',
|
||||
),
|
||||
},
|
||||
{
|
||||
name: 'rules',
|
||||
type: 'textarea',
|
||||
className: 'col-span-2',
|
||||
placeholder: t('server_config.fields.outbound_rules_placeholder'),
|
||||
},
|
||||
]}
|
||||
value={(field.value || []).map((item) => ({
|
||||
...item,
|
||||
rules: Array.isArray(item.rules) ? item.rules.join('\n') : '',
|
||||
}))}
|
||||
onChange={(values) => {
|
||||
const converted = values.map((item: any) => ({
|
||||
name: item.name,
|
||||
protocol: item.protocol,
|
||||
address: item.address,
|
||||
port: item.port,
|
||||
password: item.password,
|
||||
rules:
|
||||
typeof item.rules === 'string'
|
||||
? item.rules.split('\n').map((r: string) => r.trim())
|
||||
: item.rules || [],
|
||||
}));
|
||||
field.onChange(converted);
|
||||
}}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
render={({ field }) => {
|
||||
return (
|
||||
<FormItem>
|
||||
<FormControl>
|
||||
<ArrayInput
|
||||
className='grid grid-cols-2 gap-2'
|
||||
fields={[
|
||||
{
|
||||
name: 'name',
|
||||
type: 'text',
|
||||
className: 'col-span-2',
|
||||
placeholder: t('server_config.fields.outbound_name_placeholder'),
|
||||
},
|
||||
{
|
||||
name: 'protocol',
|
||||
type: 'select',
|
||||
placeholder: t(
|
||||
'server_config.fields.outbound_protocol_placeholder',
|
||||
),
|
||||
options: [
|
||||
{ label: 'HTTP', value: 'http' },
|
||||
{ label: 'SOCKS', value: 'socks' },
|
||||
{ label: 'Shadowsocks', value: 'shadowsocks' },
|
||||
{ label: 'Brook', value: 'brook' },
|
||||
{ label: 'Snell', value: 'snell' },
|
||||
{ label: 'VMess', value: 'vmess' },
|
||||
{ label: 'VLESS', value: 'vless' },
|
||||
{ label: 'Trojan', value: 'trojan' },
|
||||
{ label: 'WireGuard', value: 'wireguard' },
|
||||
{ label: 'Hysteria', value: 'hysteria' },
|
||||
{ label: 'TUIC', value: 'tuic' },
|
||||
{ label: 'AnyTLS', value: 'anytls' },
|
||||
{ label: 'Naive', value: 'naive' },
|
||||
{ label: 'Direct', value: 'direct' },
|
||||
{ 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',
|
||||
type: 'text',
|
||||
placeholder: t(
|
||||
'server_config.fields.outbound_address_placeholder',
|
||||
),
|
||||
},
|
||||
{
|
||||
name: 'port',
|
||||
type: 'number',
|
||||
placeholder: t('server_config.fields.outbound_port_placeholder'),
|
||||
},
|
||||
{
|
||||
name: 'password',
|
||||
type: 'text',
|
||||
placeholder: t(
|
||||
'server_config.fields.outbound_password_placeholder',
|
||||
),
|
||||
},
|
||||
{
|
||||
name: 'rules',
|
||||
type: 'textarea',
|
||||
className: 'col-span-2',
|
||||
placeholder: t('server_config.fields.outbound_rules_placeholder'),
|
||||
},
|
||||
]}
|
||||
value={(field.value || []).map((item) => ({
|
||||
...item,
|
||||
rules: Array.isArray(item.rules) ? item.rules.join('\n') : '',
|
||||
}))}
|
||||
onChange={(values) => {
|
||||
const converted = values.map((item: any) => ({
|
||||
name: item.name,
|
||||
protocol: item.protocol,
|
||||
address: item.address,
|
||||
port: item.port,
|
||||
cipher: item.cipher,
|
||||
password: item.password,
|
||||
rules:
|
||||
typeof item.rules === 'string'
|
||||
? item.rules.split('\n').map((r: string) => r.trim())
|
||||
: item.rules || [],
|
||||
}));
|
||||
field.onChange(converted);
|
||||
}}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
);
|
||||
}}
|
||||
/>
|
||||
</TabsContent>
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
'use client';
|
||||
|
||||
import useGlobalStore, { GlobalStore } from '@/config/use-global';
|
||||
import { useStatsStore } from '@/store/stats';
|
||||
import { Logout } from '@/utils/common';
|
||||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
|
||||
import { ReactQueryStreamedHydration } from '@tanstack/react-query-next-experimental';
|
||||
@@ -42,6 +43,12 @@ export default function Providers({
|
||||
setCommon(common);
|
||||
}, [setCommon, common]);
|
||||
|
||||
const { stats } = useStatsStore();
|
||||
|
||||
useEffect(() => {
|
||||
stats();
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<NextThemesProvider attribute='class' defaultTheme='system' enableSystem>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
|
||||
@@ -45,6 +45,12 @@ export const useGlobalStore = create<GlobalStore>((set, get) => ({
|
||||
ip_register_limit: 0,
|
||||
ip_register_limit_duration: 0,
|
||||
},
|
||||
device: {
|
||||
enable: false,
|
||||
show_ads: false,
|
||||
enable_security: false,
|
||||
only_real_device: false,
|
||||
},
|
||||
},
|
||||
invite: {
|
||||
forced_invite: false,
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
},
|
||||
"dependencies": {
|
||||
"@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-next-experimental": "^5.85.5",
|
||||
"@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 */
|
||||
export async function getPrivacyPolicyConfig(options?: { [key: string]: any }) {
|
||||
return request<API.Response & { data?: API.PrivacyPolicyConfig }>('/v1/admin/system/privacy', {
|
||||
|
||||
+14
-1
@@ -108,6 +108,7 @@ declare namespace API {
|
||||
type AuthConfig = {
|
||||
mobile: MobileAuthenticateConfig;
|
||||
email: EmailAuthticateConfig;
|
||||
device: DeviceAuthticateConfig;
|
||||
register: PubilcRegisterConfig;
|
||||
};
|
||||
|
||||
@@ -456,6 +457,13 @@ declare namespace API {
|
||||
user_subscribe_id: number;
|
||||
};
|
||||
|
||||
type DeviceAuthticateConfig = {
|
||||
enable: boolean;
|
||||
show_ads: boolean;
|
||||
enable_security: boolean;
|
||||
only_real_device: boolean;
|
||||
};
|
||||
|
||||
type Document = {
|
||||
id: number;
|
||||
title: string;
|
||||
@@ -1272,7 +1280,7 @@ declare namespace API {
|
||||
has_migrate: boolean;
|
||||
};
|
||||
|
||||
type Hysteria = {
|
||||
type Hysteria2 = {
|
||||
port: number;
|
||||
hop_ports: string;
|
||||
hop_interval: number;
|
||||
@@ -1495,6 +1503,11 @@ declare namespace API {
|
||||
orderNo: string;
|
||||
};
|
||||
|
||||
type PreViewNodeMultiplierResponse = {
|
||||
current_time: string;
|
||||
ratio: number;
|
||||
};
|
||||
|
||||
type PreviewSubscribeTemplateParams = {
|
||||
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 */
|
||||
export async function telephoneLogin(
|
||||
body: API.TelephoneLoginRequest,
|
||||
|
||||
+21
-1
@@ -114,6 +114,7 @@ declare namespace API {
|
||||
type AuthConfig = {
|
||||
mobile: MobileAuthenticateConfig;
|
||||
email: EmailAuthticateConfig;
|
||||
device: DeviceAuthticateConfig;
|
||||
register: PubilcRegisterConfig;
|
||||
};
|
||||
|
||||
@@ -211,6 +212,19 @@ declare namespace API {
|
||||
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 = {
|
||||
id: number;
|
||||
title: string;
|
||||
@@ -324,7 +338,7 @@ declare namespace API {
|
||||
state: string;
|
||||
};
|
||||
|
||||
type Hysteria = {
|
||||
type Hysteria2 = {
|
||||
port: number;
|
||||
hop_ports: string;
|
||||
hop_interval: number;
|
||||
@@ -706,6 +720,7 @@ declare namespace API {
|
||||
};
|
||||
|
||||
type ResetPasswordRequest = {
|
||||
identifier: string;
|
||||
email: string;
|
||||
password: string;
|
||||
code?: string;
|
||||
@@ -898,6 +913,7 @@ declare namespace API {
|
||||
};
|
||||
|
||||
type TelephoneLoginRequest = {
|
||||
identifier: string;
|
||||
telephone: string;
|
||||
telephone_code: string;
|
||||
telephone_area_code: string;
|
||||
@@ -906,6 +922,7 @@ declare namespace API {
|
||||
};
|
||||
|
||||
type TelephoneRegisterRequest = {
|
||||
identifier: string;
|
||||
telephone: string;
|
||||
telephone_area_code: string;
|
||||
password: string;
|
||||
@@ -915,6 +932,7 @@ declare namespace API {
|
||||
};
|
||||
|
||||
type TelephoneResetPasswordRequest = {
|
||||
identifier: string;
|
||||
telephone: string;
|
||||
telephone_area_code: string;
|
||||
password: string;
|
||||
@@ -1035,12 +1053,14 @@ declare namespace API {
|
||||
};
|
||||
|
||||
type UserLoginRequest = {
|
||||
identifier: string;
|
||||
email: string;
|
||||
password: string;
|
||||
cf_token?: string;
|
||||
};
|
||||
|
||||
type UserRegisterRequest = {
|
||||
identifier: string;
|
||||
email: string;
|
||||
password: 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 [loading, startTransition] = useTransition();
|
||||
const [initialValues, setInitialValues] = useState<API.TelephoneLoginRequest>({
|
||||
identifier: '',
|
||||
telephone: '',
|
||||
telephone_area_code: '1',
|
||||
password: '',
|
||||
|
||||
@@ -19,6 +19,8 @@ export default function Certification({ platform, children }: CertificationProps
|
||||
oAuthLoginGetToken({
|
||||
method: platform,
|
||||
callback: searchParams,
|
||||
// @ts-ignore
|
||||
invite: localStorage.getItem('invite') || '',
|
||||
})
|
||||
.then((res) => {
|
||||
const token = res?.data?.data?.token;
|
||||
|
||||
@@ -48,6 +48,12 @@ export const useGlobalStore = create<GlobalStore>((set, get) => ({
|
||||
ip_register_limit: 0,
|
||||
ip_register_limit_duration: 0,
|
||||
},
|
||||
device: {
|
||||
enable: false,
|
||||
show_ads: false,
|
||||
enable_security: false,
|
||||
only_real_device: false,
|
||||
},
|
||||
},
|
||||
invite: {
|
||||
forced_invite: false,
|
||||
|
||||
@@ -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 */
|
||||
export async function telephoneLogin(
|
||||
body: API.TelephoneLoginRequest,
|
||||
|
||||
+21
-1
@@ -114,6 +114,7 @@ declare namespace API {
|
||||
type AuthConfig = {
|
||||
mobile: MobileAuthenticateConfig;
|
||||
email: EmailAuthticateConfig;
|
||||
device: DeviceAuthticateConfig;
|
||||
register: PubilcRegisterConfig;
|
||||
};
|
||||
|
||||
@@ -211,6 +212,19 @@ declare namespace API {
|
||||
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 = {
|
||||
id: number;
|
||||
title: string;
|
||||
@@ -324,7 +338,7 @@ declare namespace API {
|
||||
state: string;
|
||||
};
|
||||
|
||||
type Hysteria = {
|
||||
type Hysteria2 = {
|
||||
port: number;
|
||||
hop_ports: string;
|
||||
hop_interval: number;
|
||||
@@ -706,6 +720,7 @@ declare namespace API {
|
||||
};
|
||||
|
||||
type ResetPasswordRequest = {
|
||||
identifier: string;
|
||||
email: string;
|
||||
password: string;
|
||||
code?: string;
|
||||
@@ -898,6 +913,7 @@ declare namespace API {
|
||||
};
|
||||
|
||||
type TelephoneLoginRequest = {
|
||||
identifier: string;
|
||||
telephone: string;
|
||||
telephone_code: string;
|
||||
telephone_area_code: string;
|
||||
@@ -906,6 +922,7 @@ declare namespace API {
|
||||
};
|
||||
|
||||
type TelephoneRegisterRequest = {
|
||||
identifier: string;
|
||||
telephone: string;
|
||||
telephone_area_code: string;
|
||||
password: string;
|
||||
@@ -915,6 +932,7 @@ declare namespace API {
|
||||
};
|
||||
|
||||
type TelephoneResetPasswordRequest = {
|
||||
identifier: string;
|
||||
telephone: string;
|
||||
telephone_area_code: string;
|
||||
password: string;
|
||||
@@ -1035,12 +1053,14 @@ declare namespace API {
|
||||
};
|
||||
|
||||
type UserLoginRequest = {
|
||||
identifier: string;
|
||||
email: string;
|
||||
password: string;
|
||||
cf_token?: string;
|
||||
};
|
||||
|
||||
type UserRegisterRequest = {
|
||||
identifier: string;
|
||||
email: string;
|
||||
password: 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 = {
|
||||
mobile: MobileAuthenticateConfig;
|
||||
email: EmailAuthticateConfig;
|
||||
device: DeviceAuthticateConfig;
|
||||
register: PubilcRegisterConfig;
|
||||
};
|
||||
|
||||
@@ -204,6 +205,13 @@ declare namespace API {
|
||||
currency_symbol: string;
|
||||
};
|
||||
|
||||
type DeviceAuthticateConfig = {
|
||||
enable: boolean;
|
||||
show_ads: boolean;
|
||||
enable_security: boolean;
|
||||
only_real_device: boolean;
|
||||
};
|
||||
|
||||
type Document = {
|
||||
id: number;
|
||||
title: string;
|
||||
@@ -256,6 +264,11 @@ declare namespace API {
|
||||
list: PaymentMethod[];
|
||||
};
|
||||
|
||||
type GetDeviceListResponse = {
|
||||
list: UserDevice[];
|
||||
total: number;
|
||||
};
|
||||
|
||||
type GetLoginLogParams = {
|
||||
page: number;
|
||||
size: number;
|
||||
@@ -343,7 +356,7 @@ declare namespace API {
|
||||
list: Ticket[];
|
||||
};
|
||||
|
||||
type Hysteria = {
|
||||
type Hysteria2 = {
|
||||
port: number;
|
||||
hop_ports: string;
|
||||
hop_interval: number;
|
||||
@@ -799,6 +812,10 @@ declare namespace API {
|
||||
total: number;
|
||||
};
|
||||
|
||||
type QueryUserSubscribeNodeListResponse = {
|
||||
list: UserSubscribeInfo[];
|
||||
};
|
||||
|
||||
type RechargeOrderRequest = {
|
||||
amount: number;
|
||||
payment: number;
|
||||
@@ -1039,6 +1056,10 @@ declare namespace API {
|
||||
security_config: SecurityConfig;
|
||||
};
|
||||
|
||||
type UnbindDeviceRequest = {
|
||||
id: number;
|
||||
};
|
||||
|
||||
type UnbindOAuthRequest = {
|
||||
method: string;
|
||||
};
|
||||
@@ -1150,6 +1171,26 @@ declare namespace API {
|
||||
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 = {
|
||||
id: number;
|
||||
user_id: number;
|
||||
@@ -1160,6 +1201,19 @@ declare namespace API {
|
||||
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 = {
|
||||
verify_code_expire_time: 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 */
|
||||
export async function queryUserInfo(options?: { [key: string]: any }) {
|
||||
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 */
|
||||
export async function unbindOAuth(body: API.UnbindOAuthRequest, options?: { [key: string]: any }) {
|
||||
return request<API.Response & { data?: any }>('/v1/public/user/unbind_oauth', {
|
||||
|
||||
+86
-4
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ppanel-web",
|
||||
"version": "1.5.2",
|
||||
"version": "1.5.3",
|
||||
"private": true,
|
||||
"homepage": "https://github.com/perfect-panel/ppanel-web",
|
||||
"bugs": {
|
||||
@@ -12,8 +12,8 @@
|
||||
},
|
||||
"license": "GUN",
|
||||
"workspaces": [
|
||||
"apps/*",
|
||||
"packages/*"
|
||||
"packages/*",
|
||||
"apps/*"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "turbo build",
|
||||
@@ -47,21 +47,103 @@
|
||||
]
|
||||
},
|
||||
"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": {
|
||||
"@eslint/js": "^9.38.0",
|
||||
"@netlify/plugin-nextjs": "^5.12.1",
|
||||
"@umijs/openapi": "^1.13.15",
|
||||
"@workspace/commitlint-config": "workspace:*",
|
||||
"@workspace/eslint-config": "workspace:*",
|
||||
"@workspace/prettier-config": "workspace:*",
|
||||
"@workspace/typescript-config": "workspace:*",
|
||||
"autoprefixer": "^10.4.21",
|
||||
"commitlint": "^19.6.1",
|
||||
"eslint": "^9.17.0",
|
||||
"husky": "^9.1.7",
|
||||
"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-config-gitmoji": "^1.5.3",
|
||||
"tailwindcss": "^3.4.17",
|
||||
"turbo": "^2.5.6",
|
||||
"typescript": "^5.9.2"
|
||||
},
|
||||
"packageManager": "bun@1.1.43",
|
||||
"packageManager": "bun@1.3.0",
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
"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",
|
||||
@@ -27,7 +28,7 @@
|
||||
"@iconify-json/simple-icons": "^1.2.20",
|
||||
"@iconify-json/uil": "^1.2.3",
|
||||
"@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-alert-dialog": "^1.1.15",
|
||||
"@radix-ui/react-aspect-ratio": "^1.1.7",
|
||||
@@ -65,6 +66,7 @@
|
||||
"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",
|
||||
|
||||
@@ -12,6 +12,8 @@ interface FieldConfig extends Omit<EnhancedInputProps, 'type'> {
|
||||
name: string;
|
||||
type: 'text' | 'number' | 'select' | 'time' | 'boolean' | 'textarea';
|
||||
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> {
|
||||
@@ -40,6 +42,8 @@ export function ObjectInput<T extends Record<string, any>>({
|
||||
onChange(updatedInternalState);
|
||||
};
|
||||
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) {
|
||||
case 'select':
|
||||
return (
|
||||
@@ -86,11 +90,15 @@ export function ObjectInput<T extends Record<string, any>>({
|
||||
};
|
||||
return (
|
||||
<div className={cn('flex flex-1 flex-wrap gap-4', className)}>
|
||||
{fields.map((field) => (
|
||||
<div key={field.name} className={cn('flex-1', field.className)}>
|
||||
{renderField(field)}
|
||||
</div>
|
||||
))}
|
||||
{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)}>
|
||||
{node}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
import { Button } from '@workspace/ui/components/button';
|
||||
import { cn } from '@workspace/ui/lib/utils';
|
||||
import 'katex/dist/katex.min.css';
|
||||
import { Check, Copy } from 'lucide-react';
|
||||
import { useCallback, useState } from 'react';
|
||||
import ReactMarkdown, { Components } from 'react-markdown';
|
||||
|
||||
@@ -143,9 +143,9 @@ export function ProTable<
|
||||
header: texts?.actions,
|
||||
cell: ({ row }) => (
|
||||
<div className='flex items-center justify-end gap-2'>
|
||||
{actions
|
||||
?.render?.(row.original)
|
||||
.map((item, index) => <Fragment key={index}>{item}</Fragment>)}
|
||||
{actions?.render?.(row.original).map((item, index) => (
|
||||
<Fragment key={index}>{item}</Fragment>
|
||||
))}
|
||||
</div>
|
||||
),
|
||||
enableSorting: false,
|
||||
|
||||
Reference in New Issue
Block a user