feat: version 2.17.0 -- Equipos: pestaña Usuarios (sesion, usuarios y grupos locales)
Migracion 027 (device_accounts). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@ import { XMLParser } from 'fast-xml-parser';
|
||||
|
||||
const XML_ARRAY_SECTIONS = new Set([
|
||||
'cpus', 'memories', 'storages', 'drives', 'networks', 'monitors', 'softwares', 'printers',
|
||||
'users', 'videos', 'sounds', 'batteries', 'controllers', 'ports', 'slots', 'antivirus',
|
||||
'users', 'local_users', 'local_groups', 'videos', 'sounds', 'batteries', 'controllers', 'ports', 'slots', 'antivirus',
|
||||
]);
|
||||
|
||||
const xmlParser = new XMLParser({ ignoreAttributes: true, parseTagValue: false, trimValues: true });
|
||||
@@ -144,6 +144,14 @@ export function normalizeInventory(parsed) {
|
||||
})
|
||||
.filter((s) => s.name);
|
||||
|
||||
// Cuentas: sesion iniciada (USERS), usuarios locales y grupos locales (solo cuentas LOCALES del equipo).
|
||||
const account = (kind, name, domain, sid) => ({ kind, name: str(name, 190), domain: str(domain, 190), sid: str(sid, 190) });
|
||||
const accounts = [
|
||||
...asArray(c.users).map((x) => account('session', x.login, x.domain, null)),
|
||||
...asArray(c.local_users).map((x) => account('local_user', x.name, null, x.id)),
|
||||
...asArray(c.local_groups).map((x) => account('local_group', x.name, null, x.id)),
|
||||
].filter((a) => a.name);
|
||||
|
||||
// Resumenes para listado/KPIs.
|
||||
const hostname = str(hw.name || nd.name || printer.name || os.fqdn, 190);
|
||||
const upIfaces = networks.filter((n) => n.ip && !/^(127\.|169\.254\.|::1|fe80)/i.test(n.ip) && !n.ip.includes(':'));
|
||||
@@ -190,5 +198,5 @@ export function normalizeInventory(parsed) {
|
||||
if (c[key] && (!Array.isArray(c[key]) || c[key].length)) extra[key] = c[key];
|
||||
}
|
||||
|
||||
return { device, cpus, memories, disks, volumes, networks, monitors, software, extra };
|
||||
return { device, cpus, memories, disks, volumes, networks, monitors, software, accounts, extra };
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ const CHILD_TABLES = {
|
||||
volumes: { table: 'device_volumes', cols: ['mount', 'label', 'filesystem', 'type', 'total_mb', 'free_mb'] },
|
||||
networks: { table: 'device_networks', cols: ['description', 'mac', 'ip', 'mask', 'gateway', 'type', 'status'] },
|
||||
monitors: { table: 'device_monitors', cols: ['manufacturer', 'model', 'serial'] },
|
||||
accounts: { table: 'device_accounts', cols: ['kind', 'name', 'domain', 'sid'] },
|
||||
software: { table: 'device_software', cols: ['name', 'version', 'publisher', 'install_date', 'category', 'is_component'] },
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user