feat: improve critical reads, device list and modelPaths bug fix
- main_state_machine.ts: add to CriticalReadsState GPV: ProvisioningCode (confirm CPE persisted value), UpTime (detect reboots), ManagementServer.URL (verify ACS URL), ConnectionRequestUsername/Password (ensure wake credentials are always available) - Home.vue: add Last Seen column (device.updatedAt) - pages_controller.ts: fix modelPaths bug — was never passed to DeviceDetail, now auto-detected from dataModel and passed as predefined TR-181/TR-098 paths
This commit is contained in:
1 parent
7d603da0ca
commit
8969355688
3 files changed
+16
-1
No files matched your search
@@ -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) {
|
||||
|
||||
@@ -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`,
|
||||
]
|
||||
|
||||
@@ -157,6 +157,7 @@ async function deleteSelected() {
|
||||
<th scope="col">{{ t('labels.serialNumber') }}</th>
|
||||
<th scope="col">{{ t('labels.externalIP') }}</th>
|
||||
<th scope="col">{{ t('labels.softwareVersion') }}</th>
|
||||
<th scope="col">{{ t('labels.lastSeen') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@@ -185,6 +186,7 @@ async function deleteSelected() {
|
||||
<td>{{ device.deviceId?.serialNumber }}</td>
|
||||
<td>{{ getIpAddress(device.parameters, device.properties) }}</td>
|
||||
<td>{{ getPropertyValue(device.properties, 'InternetGatewayDevice.DeviceInfo.SoftwareVersion') || getPropertyValue(device.properties, 'Device.DeviceInfo.SoftwareVersion') || '—' }}</td>
|
||||
<td>{{ device.updatedAt ? new Date(device.updatedAt).toLocaleString() : '—' }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
Reference in new issue
Block a user