diff --git a/.changeset/mdns-first-device-install.md b/.changeset/mdns-first-device-install.md new file mode 100644 index 00000000..0cfb9253 --- /dev/null +++ b/.changeset/mdns-first-device-install.md @@ -0,0 +1,9 @@ +--- +"ftw": patch +--- + +The setup wizard now installs a discovered device by its self-broadcast mDNS +(.local) name instead of its raw IP when the device advertises one, so the +connection survives DHCP lease changes. When only an IP address is used, the +wizard and device settings now tell the operator to reserve that IP for the +device in the router's DHCP settings. diff --git a/web/settings/tabs/devices.js b/web/settings/tabs/devices.js index 07218ec1..9fef2bdb 100644 --- a/web/settings/tabs/devices.js +++ b/web/settings/tabs/devices.js @@ -80,7 +80,7 @@ if (modbus) { html += '
Modbus TCP' + '
' + - '' + + '' + '' + '
' + '' + @@ -145,7 +145,7 @@ // post-render DOM edit mirrors the site-meter pattern above // and avoids a re-render race with the async catalog fetch. html += '
HTTP' + - '' + + '' + '' + '
' + '' + diff --git a/web/setup.html b/web/setup.html index c99ab597..5c4c92f7 100644 --- a/web/setup.html +++ b/web/setup.html @@ -353,6 +353,21 @@ margin: 1rem 0; } + /* ---- Host addressing hint (mDNS name vs fixed IP) ---- */ + .host-hint { + margin: 0 0 1rem; + padding: 10px 12px; + background: var(--ink-raised); + border: 1px solid var(--line); + border-radius: 8px; + font-size: 0.78rem; + color: var(--fg-dim); + line-height: 1.5; + } + + .host-hint.mdns { border-color: color-mix(in srgb, var(--green-e) 45%, var(--line)); } + .host-hint.dhcp { border-color: color-mix(in srgb, var(--yellow) 55%, var(--line)); } + /* ---- Driver picker ---- */ .driver-desc { margin-top: 0.5rem; @@ -595,8 +610,8 @@

Find devices