mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-28 17:43:47 +00:00
feat: show VPN connection info and subscription request history on admin user detail
- Load panelInfo eagerly on page load (not just on subscription tab) - Add VPN connection card to info tab: last/first connection, online status indicator, last node - Rename "Last activity" to "Bot activity" to distinguish from VPN connection - Show cabinet_last_login field that was never rendered - Add collapsible subscription request history section in subscription tab with paginated table - Add subscription request history API types and method - Add i18n keys for all 4 locales (ru, en, zh, fa)
This commit is contained in:
@@ -158,6 +158,19 @@ export interface UserPanelInfo {
|
||||
last_connected_node_name: string | null;
|
||||
}
|
||||
|
||||
export interface SubscriptionRequestRecord {
|
||||
id: number;
|
||||
userUuid: string;
|
||||
requestAt: string;
|
||||
requestIp: string | null;
|
||||
userAgent: string | null;
|
||||
}
|
||||
|
||||
export interface SubscriptionRequestHistory {
|
||||
total: number;
|
||||
records: SubscriptionRequestRecord[];
|
||||
}
|
||||
|
||||
export interface UserNodeUsageItem {
|
||||
node_uuid: string;
|
||||
node_name: string;
|
||||
@@ -684,6 +697,22 @@ export const adminUsersApi = {
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Get subscription request history from RemnaWave panel
|
||||
getSubscriptionRequestHistory: async (
|
||||
userId: number,
|
||||
subscriptionId?: number,
|
||||
offset = 0,
|
||||
limit = 20,
|
||||
): Promise<SubscriptionRequestHistory> => {
|
||||
const params: Record<string, unknown> = { offset, limit };
|
||||
if (subscriptionId != null) params.subscription_id = subscriptionId;
|
||||
const response = await apiClient.get(
|
||||
`/cabinet/admin/users/${userId}/subscription-request-history`,
|
||||
{ params },
|
||||
);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Get user devices
|
||||
getUserDevices: async (
|
||||
userId: number,
|
||||
|
||||
Reference in New Issue
Block a user