From a0d833726ddd616567d9731a15134b4e6f73dc28 Mon Sep 17 00:00:00 2001 From: Manuel Aranda Date: Wed, 16 Apr 2025 11:17:11 +0200 Subject: [PATCH] refs #1922. Show new fields in clients table --- .../app/components/groups/groups.component.html | 17 +++++++++++++++-- .../app/components/groups/groups.component.ts | 2 +- .../manage-client/manage-client.component.ts | 4 +++- .../ogdhcp/og-dhcp-subnets.component.spec.ts | 6 ------ ogWebconsole/src/locale/en.json | 1 + ogWebconsole/src/locale/es.json | 1 + 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/ogWebconsole/src/app/components/groups/groups.component.html b/ogWebconsole/src/app/components/groups/groups.component.html index 7510c73..c780882 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.html +++ b/ogWebconsole/src/app/components/groups/groups.component.html @@ -348,9 +348,22 @@ IP - {{ client.ip }} +
+ {{ client.ip }} + {{ client.mac }} +
+ + + {{ 'firmwareType' | translate }} + + + {{ client.firmwareType ? client.firmwareType : 'N/A' }} + + + + OG Live {{ client.ogLive?.date | date }} @@ -429,4 +442,4 @@ - \ No newline at end of file + diff --git a/ogWebconsole/src/app/components/groups/groups.component.ts b/ogWebconsole/src/app/components/groups/groups.component.ts index 20e52bf..894fff1 100644 --- a/ogWebconsole/src/app/components/groups/groups.component.ts +++ b/ogWebconsole/src/app/components/groups/groups.component.ts @@ -87,7 +87,7 @@ export class GroupsComponent implements OnInit, OnDestroy { { value: 'mac', name: 'Mac' }, ]; - displayedColumns: string[] = ['select', 'status', 'ip', 'name', 'oglive', 'subnet', 'pxeTemplate', 'actions']; + displayedColumns: string[] = ['select', 'status', 'ip', 'firmwareType', 'name', 'oglive', 'subnet', 'pxeTemplate', 'actions']; private _sort!: MatSort; diff --git a/ogWebconsole/src/app/components/groups/shared/clients/manage-client/manage-client.component.ts b/ogWebconsole/src/app/components/groups/shared/clients/manage-client/manage-client.component.ts index 3f6a793..163fbcb 100644 --- a/ogWebconsole/src/app/components/groups/shared/clients/manage-client/manage-client.component.ts +++ b/ogWebconsole/src/app/components/groups/shared/clients/manage-client/manage-client.component.ts @@ -105,6 +105,7 @@ export class ManageClientComponent implements OnInit { this.parentUnitsWithPaths = this.parentUnits.map(unit => ({ id: unit['@id'], name: unit.name, + netiface: unit.networkSettings?.netiface, path: this.dataService.getOrganizationalUnitPath(unit, this.parentUnits), repository: unit.networkSettings?.repository?.['@id'], hardwareProfile: unit.networkSettings?.hardwareProfile?.['@id'], @@ -226,7 +227,8 @@ export class ManageClientComponent implements OnInit { repository: selectedUnit.repository || null, hardwareProfile: selectedUnit.hardwareProfile || null, ogLive: selectedUnit.ogLive || null, - menu: selectedUnit.menu || null + menu: selectedUnit.menu || null, + netiface: selectedUnit.netiface || null, }); } } diff --git a/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets.component.spec.ts b/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets.component.spec.ts index e39ef39..a97e5bc 100644 --- a/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets.component.spec.ts +++ b/ogWebconsole/src/app/components/ogdhcp/og-dhcp-subnets.component.spec.ts @@ -72,10 +72,4 @@ describe('OgDhcpSubnetsComponent', () => { expect(component).toBeTruthy(); }); - it('should call syncSubnets and handle success', () => { - component.syncSubnets(); - expect(mockHttpClient.post).toHaveBeenCalledWith(`${component.baseUrl}/subnets/sync`, {}); - expect(mockToastrService.success).toHaveBeenCalledWith('Sincronización con componente DHCP exitosa'); - }); - }); diff --git a/ogWebconsole/src/locale/en.json b/ogWebconsole/src/locale/en.json index e4cdc65..6bc649a 100644 --- a/ogWebconsole/src/locale/en.json +++ b/ogWebconsole/src/locale/en.json @@ -21,6 +21,7 @@ "labelOrganizationalUnit": "Organizational Unit", "buttonCancel": "Cancel", "buttonAdd": "Add", + "firmwareType": "Firmware", "addRule": "Add rule", "rulesHeader": "Rules", "statusUnavailable": "Unavailable", diff --git a/ogWebconsole/src/locale/es.json b/ogWebconsole/src/locale/es.json index 61d4a44..fb6d793 100644 --- a/ogWebconsole/src/locale/es.json +++ b/ogWebconsole/src/locale/es.json @@ -21,6 +21,7 @@ "labelOrganizationalUnit": "Unidad organizativa", "buttonCancel": "Cancelar", "buttonAdd": "Añadir", + "firmwareType": "Firmware", "back": "Atrás", "addClientDialogTitle": "Añadir Cliente", "dialogTitleEditUser": "Editar usuario",