mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-29 18:13:47 +00:00
feat: add device management UI in admin user card
Show connected devices in subscription tab with ability to: - View device platform, model, HWID and connection date - Delete individual devices - Reset all devices at once
This commit is contained in:
@@ -563,4 +563,33 @@ export const adminUsersApi = {
|
||||
const response = await apiClient.get(`/cabinet/admin/users/${userId}/node-usage`);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Get user devices
|
||||
getUserDevices: async (
|
||||
userId: number,
|
||||
): Promise<{
|
||||
devices: { hwid: string; platform: string; device_model: string; created_at: string | null }[];
|
||||
total: number;
|
||||
device_limit: number;
|
||||
}> => {
|
||||
const response = await apiClient.get(`/cabinet/admin/users/${userId}/devices`);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Delete single device
|
||||
deleteUserDevice: async (
|
||||
userId: number,
|
||||
hwid: string,
|
||||
): Promise<{ success: boolean; message: string; deleted_hwid: string | null }> => {
|
||||
const response = await apiClient.delete(`/cabinet/admin/users/${userId}/devices/${hwid}`);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
// Reset all devices
|
||||
resetUserDevices: async (
|
||||
userId: number,
|
||||
): Promise<{ success: boolean; message: string; deleted_count: number }> => {
|
||||
const response = await apiClient.delete(`/cabinet/admin/users/${userId}/devices`);
|
||||
return response.data;
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user