From 0109bca236d6a9fdc2bf14cd3ffa91647ca3dd41 Mon Sep 17 00:00:00 2001 From: Kevin L'Hereec Date: Mon, 1 Jun 2026 17:35:38 +0200 Subject: [PATCH] fix: show ExternalIPAddress from properties in device table --- inertia/pages/Home.vue | 2 +- tests/unit/services/main_state_machine.spec.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/inertia/pages/Home.vue b/inertia/pages/Home.vue index 5f0cff4..12df4ec 100644 --- a/inertia/pages/Home.vue +++ b/inertia/pages/Home.vue @@ -140,7 +140,7 @@ async function deleteSelected() { {{ device.deviceId?.manufacturer }} {{ device.deviceId?.productClass }} {{ device.deviceId?.serialNumber }} - {{ getParameterValue(device.parameters, 'InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress') || getPropertyValue(device.properties, 'Device.IP.Interface.1.IPv4Address.1.IPAddress') || '—' }} + {{ getParameterValue(device.parameters, 'InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress') || getPropertyValue(device.properties, 'InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.1.ExternalIPAddress') || getParameterValue(device.parameters, 'Device.IP.Interface.1.IPv4Address.1.IPAddress') || getPropertyValue(device.properties, 'Device.IP.Interface.1.IPv4Address.1.IPAddress') || '—' }} {{ getPropertyValue(device.properties, 'InternetGatewayDevice.DeviceInfo.SoftwareVersion') || getPropertyValue(device.properties, 'Device.DeviceInfo.SoftwareVersion') || '—' }} diff --git a/tests/unit/services/main_state_machine.spec.ts b/tests/unit/services/main_state_machine.spec.ts index ae9ec7c..e1643f8 100644 --- a/tests/unit/services/main_state_machine.spec.ts +++ b/tests/unit/services/main_state_machine.spec.ts @@ -31,7 +31,7 @@ vi.mock('../../../app/models/command.js', () => ({ import { MainStateMachine } from '../../../app/services/cwmp/main_state_machine.js' import { Device } from '../../../app/domain/device/device.js' import { DeviceId } from '../../../app/domain/device/device_id.js' -import { DeviceProperty, DeviceParameter } from '../../../app/domain/device/device_parameter.js' +import { DeviceProperty } from '../../../app/domain/device/device_parameter.js' import { CWMPTaskQueue } from '../../../app/services/cwmp/task_queue.js' import { ParameterType } from '../../../app/domain/shared/types.js' @@ -111,7 +111,7 @@ describe('MainStateMachine — TR-181 device', () => { await sm.start() // Get the task from the queue and execute its callback manually - const tasks = Array.from((taskQueue as any).tasks.values()) + const tasks: any[] = Array.from((taskQueue as any).tasks.values()) const gpnTask = tasks.find((t: any) => t.type === 'get_parameter_names') expect(gpnTask).toBeDefined() @@ -127,7 +127,7 @@ describe('MainStateMachine — TR-181 device', () => { it('GPN callback sets gpnStatus to supported on success', async () => { await sm.start() - const tasks = Array.from((taskQueue as any).tasks.values()) + const tasks: any[] = Array.from((taskQueue as any).tasks.values()) const gpnTask = tasks.find((t: any) => t.type === 'get_parameter_names') expect(gpnTask).toBeDefined() @@ -150,7 +150,7 @@ describe('MainStateMachine — TR-181 device', () => { await sm.start() - const tasks = Array.from((taskQueue as any).tasks.values()) + const tasks: any[] = Array.from((taskQueue as any).tasks.values()) const gpnTask = tasks.find((t: any) => t.type === 'get_parameter_names') await taskQueue.executeTaskCallback(gpnTask!.id, 'success' as any, { @@ -276,7 +276,7 @@ describe('DeviceActionExecutor — reclassification after updateFromValues', () expect(spvXml).toContain('SetParameterValues') // Get the task and execute callback with success (simulating CPE response) - const tasks = Array.from((taskQueue as any).tasks.values()) + const tasks: any[] = Array.from((taskQueue as any).tasks.values()) const spvTask = tasks.find((t: any) => t.type === 'set_parameter_values') expect(spvTask).toBeDefined() @@ -304,7 +304,7 @@ describe('DeviceActionExecutor — reclassification after updateFromValues', () async () => '' ) - const tasks = Array.from((taskQueue as any).tasks.values()) + const tasks: any[] = Array.from((taskQueue as any).tasks.values()) const spvTask = tasks.find((t: any) => t.type === 'set_parameter_values') await taskQueue.executeTaskCallback(spvTask!.id, 'success' as any, { Status: 0 })