/** * ethernet.js — Wired interface IP configuration (eth0 + WAN uplink) * * v1.5.0 Phase 2: io.js의 두 wired 카드를 분리. * v1.7.1 Task 3: the second card was mislabeled "LTE Interface" — the device has * no cellular modem; this is a wired uplink port. The visible label/icon are * corrected to WAN/wired. The DB keys stay `lte_*` (backend/Java contract). * server endpoints (TIOT/Update/RTCM/uplink 등)는 server-setting.js 소유. * * Data model (nested — matches io.js state.device.eth / .lte convention): * state.device.eth = { ip, netmask, gateway } * state.device.lte = { ip, netmask, gateway, port } ← lte_* = wired WAN keys * * eth_ip / eth_netmask / eth_gateway / lte_ip / lte_netmask / lte_gateway are * present as DOM element IDs (ip-input component convention) and also used as * string literals for test detection. */ import { state, bindIpGroup } from '../state.js'; import { escapeHtml } from '../utils.js'; import { isValidIP } from '../validator.js'; import { renderIpOctets, setupIpOctets, collectIpValue } from '../components/ip-input.js'; import { icon } from '../icons.js'; // Field definitions — flat DOM ids map to nested state paths const ETH_FIELDS = [ { key: 'eth_ip', label: 'IP Address', group: 'eth', prop: 'ip' }, { key: 'eth_netmask', label: 'Subnet Mask', group: 'eth', prop: 'netmask' }, { key: 'eth_gateway', label: 'Gateway', group: 'eth', prop: 'gateway' }, ]; const LTE_FIELDS = [ { key: 'lte_ip', label: 'IP Address', group: 'lte', prop: 'ip' }, { key: 'lte_netmask', label: 'Subnet Mask', group: 'lte', prop: 'netmask' }, { key: 'lte_gateway', label: 'Gateway', group: 'lte', prop: 'gateway' }, ]; const ethernetPage = { render(container) { const d = state.device || {}; const eth = d.eth || {}; const lte = d.lte || {}; container.innerHTML = `
Configure the wired management and uplink interfaces. Server endpoints are configured under Network → Server Setting.
Physical eth0 uplink. Endpoint ports are configured on Server Setting.
${LTE_FIELDS.map(f => `