diff --git a/app/controllers/pages_controller.ts b/app/controllers/pages_controller.ts index 88e75a2..b1b96e6 100644 --- a/app/controllers/pages_controller.ts +++ b/app/controllers/pages_controller.ts @@ -31,7 +31,15 @@ export default class PagesController { )[0] const commands = lastProcessed ? [...pending, lastProcessed] : pending - return (inertia as any).render('DeviceDetail', { device, commands }) + // Predefined model paths for the "Get Model" modal + // Detect data model from device properties to suggest the right root + const isTr181 = (device as any).dataModel === 'tr-181' || + (device as any).properties?.some((p: any) => p.name?.startsWith('Device.')) + const modelPaths = isTr181 + ? ['Device.', 'Device.DeviceInfo.', 'Device.IP.', 'Device.WiFi.', 'Device.ManagementServer.', 'Device.Hosts.'] + : ['InternetGatewayDevice.', 'InternetGatewayDevice.DeviceInfo.', 'InternetGatewayDevice.LANDevice.', 'InternetGatewayDevice.WANDevice.', 'InternetGatewayDevice.ManagementServer.'] + + return (inertia as any).render('DeviceDetail', { device, commands, modelPaths }) } async commands({ inertia, request }: HttpContext) { diff --git a/app/services/cwmp/main_state_machine.ts b/app/services/cwmp/main_state_machine.ts index d8dae55..7386853 100644 --- a/app/services/cwmp/main_state_machine.ts +++ b/app/services/cwmp/main_state_machine.ts @@ -226,7 +226,12 @@ class CriticalReadsState extends DeviceState { `${root}.DeviceInfo.HardwareVersion`, `${root}.DeviceInfo.SoftwareVersion`, `${root}.DeviceInfo.ModelName`, + `${root}.DeviceInfo.ProvisioningCode`, + `${root}.DeviceInfo.UpTime`, + `${root}.ManagementServer.URL`, `${root}.ManagementServer.ConnectionRequestURL`, + `${root}.ManagementServer.ConnectionRequestUsername`, + `${root}.ManagementServer.ConnectionRequestPassword`, `${root}.ManagementServer.PeriodicInformInterval`, `${root}.ManagementServer.PeriodicInformEnable`, ] diff --git a/inertia/pages/Home.vue b/inertia/pages/Home.vue index 22cb0b0..0b9015d 100644 --- a/inertia/pages/Home.vue +++ b/inertia/pages/Home.vue @@ -157,6 +157,7 @@ async function deleteSelected() { {{ t('labels.serialNumber') }} {{ t('labels.externalIP') }} {{ t('labels.softwareVersion') }} + {{ t('labels.lastSeen') }} @@ -185,6 +186,7 @@ async function deleteSelected() { {{ device.deviceId?.serialNumber }} {{ getIpAddress(device.parameters, device.properties) }} {{ getPropertyValue(device.properties, 'InternetGatewayDevice.DeviceInfo.SoftwareVersion') || getPropertyValue(device.properties, 'Device.DeviceInfo.SoftwareVersion') || '—' }} + {{ device.updatedAt ? new Date(device.updatedAt).toLocaleString() : '—' }}