- Shared API, i18n, stores, listenerConfig + capabilityForm + form schema - Full routes and pages for all three editions - Listeners: protocol form, Access Profile, templates, clone, versions, batch - Users: bind nodes, subscription, reset traffic feat(ui): align MUI/Mantine/shadcn editions with Ant Design - Shared API, i18n, stores, listenerConfig + capabilityForm + form schema - Full routes and pages for all three editions - Listeners: protocol form, Access Profile, templates, clone, versions, batch - Users: bind nodes, subscription, reset traffic feat(ui): align MUI/Mantine/shadcn editions with Ant Design - Shared API, i18n, stores, listenerConfig + capabilityForm + form schema - Full routes and pages for all three editions - Listeners: protocol form, Access Profile, templates, clone, versions, batch - Users: bind nodes, subscription, reset traffic feat(ui): align MUI/Mantine/shadcn editions with Ant Design - Shared API, i18n, stores, listenerConfig + capabilityForm + form schema - Full routes and pages for all three editions - Listeners: protocol form, Access Profile, templates, clone, versions, batch - Users: bind nodes, subscription, reset traffic feat(ui): align MUI/Mantine/shadcn editions with Ant Design - Shared API, i18n, stores, listenerConfig + capabilityForm + form schema - Full routes and pages for all three editions - Listeners: protocol form, Access Profile, templates, clone, versions, batch - Users: bind nodes, subscription, reset traffic feat(ui): align MUI/Mantine/shadcn editions with Ant Design - Shared API, i18n, stores, listenerConfig + capabilityForm + form schema - Full routes and pages for all three editions - Listeners: protocol form, Access Profile, templates, clone, versions, batch - Users: bind nodes, subscription, reset traffic feat(ui): align MUI/Mantine/shadcn editions with Ant Design - Shared API, i18n, stores, listenerConfig + capabilityForm + form schema - Full routes and pages for all three editions - Listeners: protocol form, Access Profile, templates, clone, versions, batch - Users: bind nodes, subscription, reset traffic feat(ui): align MUI/Mantine/shadcn editions with Ant Design - Shared API, i18n, stores, listenerConfig + capabilityForm + form schema - Full routes and pages for all three editions - Listeners: protocol form, Access Profile, templates, clone, versions, batch - Users: bind nodes, subscription, reset traffic feat(ui): align MUI/Mantine/shadcn editions with Ant Design - Shared API, i18n, stores, listenerConfig + capabilityForm + form schema - Full routes and pages for all three editions - Listeners: protocol form, Access Profile, templates, clone, versions, batch - Users: bind nodes, subscription, reset traffic feat(ui): align MUI/Mantine/shadcn editions with Ant Design - Shared API, i18n, stores, listenerConfig + capabilityForm + form schema - Full routes and pages for all three editions - Listeners: protocol form, Access Profile, templates, clone, versions, batch - Users: bind nodes, subscription, reset traffic feat(ui): align MUI/Mantine/shadcn editions with Ant Design - Shared API, i18n, stores, listenerConfig + capabilityForm + form schema - Full routes and pages for all three editions - Listeners: protocol form, Access Profile, templates, clone, versions, batch - Users: bind nodes, subscription, reset traffic feat(ui): align MUI/Mantine/shadcn editions with Ant Design - Shared API, i18n, stores, listenerConfig + capabilityForm + form schema - Full routes and pages for all three editions - Listeners: protocol form, Access Profile, templates, clone, versions, batch - Users: bind nodes, subscription, reset traffic
53 lines
1.8 KiB
TypeScript
53 lines
1.8 KiB
TypeScript
import client from './client';
|
|
|
|
export interface ProxyUser {
|
|
id: number;
|
|
username: string;
|
|
password?: string;
|
|
uuid_masked?: string;
|
|
enabled: boolean;
|
|
traffic_limit?: number;
|
|
traffic_used?: number;
|
|
upload_bytes?: number;
|
|
download_bytes?: number;
|
|
last_seen?: string | null;
|
|
online?: boolean;
|
|
expire_time?: string;
|
|
blocked?: boolean;
|
|
ip_limit?: number;
|
|
remark?: string;
|
|
sub_token?: string;
|
|
created_at?: string;
|
|
}
|
|
|
|
export interface BoundNode {
|
|
id: number;
|
|
name: string;
|
|
protocol: string;
|
|
port: string;
|
|
bind_address: string;
|
|
enabled: boolean;
|
|
tls?: boolean;
|
|
udp?: boolean;
|
|
status?: string;
|
|
}
|
|
|
|
export const fetchUsers = () => client.get<ProxyUser[]>('/users').then((r) => r.data);
|
|
export const createUser = (payload: Record<string, unknown>) =>
|
|
client.post<ProxyUser>('/users', payload).then((r) => r.data);
|
|
export const updateUser = (id: number, payload: Record<string, unknown>) =>
|
|
client.put<ProxyUser>(`/users/${id}`, payload).then((r) => r.data);
|
|
export const deleteUser = (id: number) => client.delete(`/users/${id}`);
|
|
export const resetUserTraffic = (id: number) =>
|
|
client.post<ProxyUser>(`/users/${id}/reset-traffic`).then((r) => r.data);
|
|
|
|
export const fetchUserNodes = (userId: number) =>
|
|
client.get<BoundNode[]>(`/users/${userId}/nodes`).then((r) => r.data);
|
|
export const bindUserNodes = (userId: number, listenerIds: number[]) =>
|
|
client.post(`/users/${userId}/nodes`, { listener_ids: listenerIds }).then((r) => r.data);
|
|
|
|
export const fetchUserSubscription = (id: number) =>
|
|
client.get<{ token: string; url: string }>(`/users/${id}/subscription`).then((r) => r.data);
|
|
export const rotateUserSubscription = (id: number) =>
|
|
client.post<{ token: string; url: string }>(`/users/${id}/subscription/rotate`).then((r) => r.data);
|