app: Surface Ethernet uplink in the UI and gate wpa_supplicant access

When the configured Ethernet interface holds a DHCP-assigned IPv4 at
startup, the app now skips wifi.Initialize / StartEventMonitoring and
guards every wifi.* wrapper against a nil backend. This prevents D-Bus
calls to fi.w1.wpa_supplicant1 from re-activating the daemon via
dbus-activation, honoring the "do nothing" intent of the Ethernet path.

The probed state is exposed in SystemStatus and rendered in the header
as a third pill ("Ethernet · <IP>"); a new "disabled" connectionState
covers the WiFi pill in this mode.
This commit is contained in:
nemunaire 2026-05-02 11:24:36 +08:00
commit 8b1debdddc
7 changed files with 166 additions and 37 deletions

View file

@ -369,6 +369,26 @@ components:
- ssid
- password
EthernetStatus:
type: object
description: State of the wired uplink interface (probed via ip(8))
properties:
active:
type: boolean
description: True when the interface holds a DHCP-assigned IPv4
example: true
interface:
type: string
description: Probed interface name
example: "eth0"
ipv4:
type: string
description: DHCP-assigned IPv4 address (empty when no lease)
example: "192.168.1.42"
required:
- active
- interface
HotspotStatus:
type: object
description: Detailed hotspot status from hostapd_cli
@ -480,13 +500,14 @@ components:
example: true
connectionState:
type: string
description: Current WiFi connection state
description: Current WiFi connection state ("disabled" when Ethernet uplink is active and the WiFi backend is intentionally not initialized)
enum:
- connected
- disconnected
- connecting
- disconnecting
- roaming
- disabled
example: "connected"
connectedSSID:
type: string
@ -497,6 +518,11 @@ components:
- $ref: '#/components/schemas/HotspotStatus'
nullable: true
description: Detailed hotspot status (null if hotspot is not running)
ethernetStatus:
allOf:
- $ref: '#/components/schemas/EthernetStatus'
nullable: true
description: Wired uplink state (null when not yet probed)
connectedCount:
type: integer
description: Number of devices connected to hotspot