feat: enhance admin user detail with campaign, panel data, node usage

- Add campaign card and referrals list to info tab
- Add panel config/links, live traffic, connection info to subscription tab
- Add node usage bars with 7/14/30 day period selector
- Add getPanelInfo/getNodeUsage API methods and types
- Add 18 new i18n keys across 4 languages
This commit is contained in:
Fringg
2026-02-07 06:07:13 +03:00
parent e0c9a89d34
commit 7b19f14dc3
6 changed files with 458 additions and 2 deletions

View File

@@ -101,6 +101,8 @@ export interface UserDetailResponse {
used_promocodes: number;
has_had_paid_subscription: boolean;
lifetime_used_traffic_bytes: number;
campaign_name: string | null;
campaign_id: number | null;
restriction_topup: boolean;
restriction_subscription: boolean;
restriction_reason: string | null;
@@ -111,6 +113,33 @@ export interface UserDetailResponse {
remnawave_uuid: string | null;
}
export interface UserPanelInfo {
found: boolean;
trojan_password: string | null;
vless_uuid: string | null;
ss_password: string | null;
subscription_url: string | null;
happ_link: string | null;
used_traffic_bytes: number;
lifetime_used_traffic_bytes: number;
traffic_limit_bytes: number;
first_connected_at: string | null;
online_at: string | null;
last_connected_node_uuid: string | null;
last_connected_node_name: string | null;
}
export interface UserNodeUsageItem {
node_uuid: string;
node_name: string;
total_bytes: number;
}
export interface UserNodeUsageResponse {
items: UserNodeUsageItem[];
period_days: number;
}
export interface UsersStatsResponse {
total_users: number;
active_users: number;
@@ -508,4 +537,18 @@ export const adminUsersApi = {
const response = await apiClient.post(`/cabinet/admin/users/${userId}/disable`);
return response.data;
},
// Get panel info
getPanelInfo: async (userId: number): Promise<UserPanelInfo> => {
const response = await apiClient.get(`/cabinet/admin/users/${userId}/panel-info`);
return response.data;
},
// Get node usage
getNodeUsage: async (userId: number, days = 7): Promise<UserNodeUsageResponse> => {
const response = await apiClient.get(`/cabinet/admin/users/${userId}/node-usage`, {
params: { days },
});
return response.data;
},
};