fix: support alias-based IPv6 interface names and add engine reset utility
- 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:
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
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user