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:
@@ -103,6 +103,7 @@ function DeviceDetail({ id, onClose, onChanged, canEdit }) {
|
||||
|
||||
const tabs = [
|
||||
{ key: 'general', label: t('eq_tab_general') },
|
||||
{ key: 'users', label: t('eq_tab_users'), count: device.accounts.filter((a) => a.kind === 'local_user').length },
|
||||
{ key: 'hardware', label: t('eq_tab_hardware') },
|
||||
{ key: 'network', label: t('eq_tab_network'), count: device.networks.length },
|
||||
{ key: 'software', label: t('eq_tab_software'), count: device.software.filter((r) => showComponents || !r.is_component).length },
|
||||
@@ -152,6 +153,16 @@ function DeviceDetail({ id, onClose, onChanged, canEdit }) {
|
||||
<SimpleTable empty={emptyText} rows={rows} columns={columns} />
|
||||
</>
|
||||
);
|
||||
const sessionNames = device.accounts.filter((a) => a.kind === 'session').map((a) => (a.domain ? `${a.domain}\\${a.name}` : a.name));
|
||||
const allLocalUsers = device.accounts.filter((a) => a.kind === 'local_user');
|
||||
const allLocalGroups = device.accounts.filter((a) => a.kind === 'local_group');
|
||||
const userRows = [
|
||||
[t('eq_users_session'), val(sessionNames.join(', ')), sessionNames.join(' ')],
|
||||
[t('eq_users_local_count'), String(allLocalUsers.length), String(allLocalUsers.length)],
|
||||
[t('eq_groups_local_count'), String(allLocalGroups.length), String(allLocalGroups.length)],
|
||||
];
|
||||
const localUsers = only(allLocalUsers, (r) => [r.name, r.sid]);
|
||||
const localGroups = only(allLocalGroups, (r) => [r.name, r.sid]);
|
||||
const networks = only(device.networks, (r) => [r.description, r.ip, r.mask, r.gateway, r.mac, r.status]);
|
||||
const software = only(device.software.filter((r) => showComponents || !r.is_component), (r) => [r.name, r.version, r.publisher]);
|
||||
const changes = only(device.changes, (r) => [fmtDate(r.created_at), t(`eq_change_${r.change_type}`), r.field, r.old_value, r.new_value]);
|
||||
@@ -208,6 +219,20 @@ function DeviceDetail({ id, onClose, onChanged, canEdit }) {
|
||||
</>
|
||||
)}
|
||||
|
||||
{tab === 'users' && (
|
||||
<>
|
||||
{showRows(userRows)}
|
||||
{hwSection(t('eq_users_local'), localUsers, [
|
||||
{ key: 'name', label: t('common_name') }, { key: 'sid', label: 'SID' },
|
||||
])}
|
||||
{hwSection(t('eq_groups_local'), localGroups, [
|
||||
{ key: 'name', label: t('common_name') }, { key: 'sid', label: 'SID' },
|
||||
])}
|
||||
{q && showRows(userRows).length + localUsers.length + localGroups.length === 0 && <div className="text-muted">{t('common_search_no_results')}</div>}
|
||||
<div className="text-muted" style={{ fontSize: '.72rem', marginTop: 12 }}>{t('eq_users_hint')}</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
{tab === 'hardware' && (
|
||||
<>
|
||||
{showRows(hwRows)}
|
||||
|
||||
Reference in New Issue
Block a user