fix: support alias-based IPv6 interface names and add engine reset utility
Build & Deploy / build (push) Successful in 30s
Build & Deploy / docker (push) Successful in 1m4s
Build & Deploy / deploy (push) Successful in 35s

- Home.vue: extend RE_IPV4/RE_IPV6 to match alias-based interface names
  like Device.IP.Interface.[BR_LAN].IPv6Address.[GUA_LAN].IPAddress
  (used by Sagemcom Livebox 4 with AliasBasedAddressing=1)
- reference_engine.ts: add resetReferenceEngine() to allow config reload
  without restart (wassup provider disabled via config/references.json)
This commit is contained in:
Kevin L'Hereec committed 2026-07-17 14:21:02 +02:00
1 parent 1fc9715888
commit 3bb85d9031
2 files changed
+8 -2

No files matched your search

@@ -154,3 +154,7 @@ export function getReferenceEngine(): ReferenceEngine {
}
return instance
}
export function resetReferenceEngine(): void {
instance = null
}
+4 -2
View File
@@ -57,8 +57,10 @@ function getPropertyValue(props: any[], name: string): string {
}
// Hoisted regex constants — compiled once, not on every call
const RE_IPV4 = /^Device\.IP\.Interface\.\d+\.IPv4Address\.\d+\.IPAddress$/
const RE_IPV6 = /^Device\.IP\.Interface\.\d+\.IPv6Address\.\d+\.IPAddress$/
// Matches both numeric indexes (e.g. Interface.1) and alias-based names (e.g. Interface.[BR_LAN])
const IF_SEG = /(\d+|\[[^\]]+\])/
const RE_IPV4 = new RegExp(`^Device\\.IP\\.Interface\\.${IF_SEG.source}\\.IPv4Address\\.${IF_SEG.source}\\.IPAddress$`)
const RE_IPV6 = new RegExp(`^Device\\.IP\\.Interface\\.${IF_SEG.source}\\.IPv6Address\\.${IF_SEG.source}\\.IPAddress$`)
function getIpAddress(parameters: any[], properties: any[]): string {
// Priority 1 : TR-098 ExternalIPAddress (reuse existing helpers to avoid duplication)