mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-09-16 15:17:14 +00:00
8082ab4d74
* feat(clients): show short HWID fingerprint in admin device list Expose a 12-char prefix of the stored hwid_hash in the admin HWID list API and UI so admins can distinguish devices without querying the database. Full hashes and raw HWIDs remain unexposed. Fixes #6359 * ci: retrigger release matrix after 386 dependency download flake --------- Co-authored-by: mrchatam <mrchatam@users.noreply.github.com> Co-authored-by: mrchatam <287639636+mrchatam@users.noreply.github.com>
23 lines
722 B
TypeScript
23 lines
722 B
TypeScript
// Shape of one entry in a client's HWID (registered-device) log, as returned
|
|
// by POST /panel/api/clients/hwids/:email.
|
|
export type ClientHwidInfo = {
|
|
id: number;
|
|
firstSeen: number;
|
|
lastSeen: number;
|
|
userAgent: string;
|
|
deviceOs: string;
|
|
osVersion: string;
|
|
deviceModel: string;
|
|
fingerprint: string;
|
|
};
|
|
|
|
// normalizeClientHwids accepts the API payload and returns typed entries,
|
|
// dropping anything that isn't a real HWID row (missing/non-numeric id).
|
|
export function normalizeClientHwids(obj: unknown): ClientHwidInfo[] {
|
|
if (!Array.isArray(obj)) return [];
|
|
return obj.filter(
|
|
(x): x is ClientHwidInfo =>
|
|
!!x && typeof x === 'object' && typeof (x as ClientHwidInfo).id === 'number',
|
|
);
|
|
}
|