+
Edge Console
-IOMATEX Edge OS
-Unified diagnostics, network operations and It-Screen foundation.
+Edge Automation Gateway
+Unified diagnostics, network operations and gateway commissioning.
diff --git a/stage_ui/console_core/backend/app.py b/stage_ui/console_core/backend/app.py index 2c302f7..c428073 100644 --- a/stage_ui/console_core/backend/app.py +++ b/stage_ui/console_core/backend/app.py @@ -549,6 +549,59 @@ def ip_addresses_for_iface(iface): return {"ipv4": ipv4, "ipv6": ipv6} +def iface_exists(iface): + return os.path.exists(f"/sys/class/net/{iface}") + + +def read_sysfs_value(path): + return read_text(path).strip() + + +def mac_address_for_iface(iface): + if not iface_exists(iface): + return "" + return read_sysfs_value(f"/sys/class/net/{iface}/address") + + +def carrier_state_for_iface(iface): + if not iface_exists(iface): + return None + raw = read_sysfs_value(f"/sys/class/net/{iface}/carrier") + if raw == "1": + return True + if raw == "0": + return False + return None + + +def operstate_for_iface(iface): + if not iface_exists(iface): + return "" + return read_sysfs_value(f"/sys/class/net/{iface}/operstate") + + +def link_speed_for_iface(iface): + if not iface_exists(iface): + return "" + raw = read_sysfs_value(f"/sys/class/net/{iface}/speed") + if raw.isdigit(): + speed = int(raw) + if speed >= 1000 and speed % 1000 == 0: + return f"{speed // 1000} Gbps" + if speed > 0: + return f"{speed} Mbps" + if shutil.which("ethtool"): + rc, stdout, _ = run(["ethtool", iface], timeout=8) + if rc == 0: + for line in stdout.splitlines(): + text = line.strip() + if text.startswith("Speed:"): + value = text.split(":", 1)[1].strip() + if value and value.lower() != "unknown!": + return value.replace("Mb/s", " Mbps").replace("Gb/s", " Gbps") + return "" + + def gateway_for_iface(iface): rc, stdout, _ = run(["ip", "route", "show", "default", "dev", iface], timeout=8) if rc != 0: @@ -561,6 +614,19 @@ def gateway_for_iface(iface): return "" +def default_route_iface(): + rc, stdout, _ = run(["ip", "route", "show", "default"], timeout=8) + if rc != 0: + return "" + for raw in stdout.splitlines(): + parts = raw.split() + if "dev" in parts: + index = parts.index("dev") + if index + 1 < len(parts): + return parts[index + 1] + return "" + + def dns_servers_for_iface(iface): if nmcli_available(): rc, stdout, _ = run(["nmcli", "-g", "IP4.DNS", "dev", "show", iface], timeout=8) @@ -629,16 +695,72 @@ def get_network_activity(iface): } +def summarize_interface(iface, kind="ethernet"): + present = iface_exists(iface) + addresses = ip_addresses_for_iface(iface) if present else {"ipv4": [], "ipv6": []} + gateway = gateway_for_iface(iface) if present else "" + dns = dns_servers_for_iface(iface) if present else [] + activity = get_network_activity(iface) if present else {"rx_bytes_per_sec": None, "tx_bytes_per_sec": None} + nm_state = nmcli_device_state(iface) if present and nmcli_available() else {} + mac_address = mac_address_for_iface(iface) if present else "" + oper_state = operstate_for_iface(iface) if present else "" + carrier = carrier_state_for_iface(iface) if kind == "ethernet" and present else None + link_speed = link_speed_for_iface(iface) if kind == "ethernet" and present else "" + default_iface = default_route_iface() + is_default_route = bool(present and iface == default_iface) + + if not present: + status = "not available" + status_text = "Ethernet interface not available" if kind == "ethernet" else "Wi-Fi interface not available" + elif kind == "ethernet": + if carrier is False: + status = "disconnected" + status_text = "Ethernet cable not connected" + elif nm_state.get("state") == "connected" or gateway or addresses["ipv4"] or addresses["ipv6"]: + status = "connected" + status_text = "Connected" + else: + status = "disconnected" + status_text = "Disconnected" + else: + if nm_state.get("state") == "connected" or gateway or addresses["ipv4"] or addresses["ipv6"]: + status = "connected" + status_text = "Connected" + elif nm_state.get("state"): + status = nm_state.get("state") + status_text = nm_state.get("state").replace("-", " ").capitalize() + else: + status = "disconnected" + status_text = "Disconnected" + + return { + "interface": iface, + "kind": kind, + "present": present, + "status": status, + "status_text": status_text, + "connected": status == "connected", + "connection": nm_state.get("connection", ""), + "state": nm_state.get("state", "") or oper_state or status, + "addresses": addresses, + "gateway": gateway, + "dns": dns, + "activity": activity, + "mac_address": mac_address, + "link_speed": link_speed, + "carrier": carrier, + "is_default_route": is_default_route, + } + + def get_network_summary(): iface = get_primary_interface() profile = read_wifi_profile_state() script_status = parse_wifi_status_script() - nm_state = nmcli_device_state(iface) - addresses = ip_addresses_for_iface(iface) - gateway = gateway_for_iface(iface) - dns = dns_servers_for_iface(iface) current_ssid = get_active_ssid(iface) - activity = get_network_activity(iface) + wifi_summary = summarize_interface(iface, "wifi") + wifi_summary["ssid"] = current_ssid or profile["ssid"] + eth_summary = summarize_interface("eth0", "ethernet") try: ap_status = public_ap_status() except Exception: @@ -656,15 +778,20 @@ def get_network_summary(): "desired_profile": profile, "ap_status": ap_status, "wifi": { - "connected": nm_state.get("state") == "connected", - "state": nm_state.get("state") or script_status.get("NM_STATE", "unknown"), - "connection": nm_state.get("connection") or script_status.get("NM_CONNECTION", ""), + "connected": wifi_summary["connected"], + "state": wifi_summary["state"] or script_status.get("NM_STATE", "unknown"), + "connection": wifi_summary["connection"] or script_status.get("NM_CONNECTION", ""), "ssid": current_ssid or profile["ssid"], }, - "addresses": addresses, - "gateway": gateway, - "dns": dns, - "activity": activity, + "addresses": wifi_summary["addresses"], + "gateway": wifi_summary["gateway"], + "dns": wifi_summary["dns"], + "activity": wifi_summary["activity"], + "interfaces": { + "wifi": wifi_summary, + "ethernet": eth_summary, + }, + "active_uplink": "eth0" if eth_summary["is_default_route"] else iface if wifi_summary["is_default_route"] else "", "script_status": script_status, } @@ -1042,6 +1169,13 @@ class Handler(BaseHTTPRequestHandler): if parsed.path == "/logo.png": self.send_file(os.path.join(PUBLIC_DIR, "logo.png"), "image/png") return + if parsed.path == "/g-box.png": + gbox_path = os.path.join(PUBLIC_DIR, "g-box.png") + if os.path.exists(gbox_path): + self.send_file(gbox_path, "image/png") + else: + self.send_file(os.path.join(PUBLIC_DIR, "logo.png"), "image/png") + return if parsed.path == "/favicon.png": self.send_file(os.path.join(PUBLIC_DIR, "favicon.png"), "image/png") return diff --git a/stage_ui/console_core/frontend/console.css b/stage_ui/console_core/frontend/console.css index 067a291..d634249 100644 --- a/stage_ui/console_core/frontend/console.css +++ b/stage_ui/console_core/frontend/console.css @@ -25,15 +25,29 @@ body{ } .brand{display:flex;align-items:center;gap:16px;min-width:0} .brandCopy{display:flex;flex-direction:column;justify-content:center;gap:4px;min-width:0} -.brandLogo{ - width:68px;height:68px;object-fit:contain;display:block;flex:0 0 auto; - border-radius:18px;background:rgba(255,255,255,.9);border:1px solid rgba(215,224,219,.9);padding:7px; - box-shadow:0 10px 24px rgba(16,24,20,.06); +.brandDevice{ + width:min(26vw, 280px); + max-height:190px; + object-fit:contain; + display:block; + flex:0 0 auto; + filter:drop-shadow(0 12px 20px rgba(16,24,20,.12)); } .eyebrow{font-size:11px;letter-spacing:.18em;text-transform:uppercase;color:var(--accent);font-weight:600} h1{margin:0;font-size:34px;line-height:1.02;font-weight:650;letter-spacing:-.03em} .sub{margin:0;color:var(--muted);font-weight:300} -.osLabel{font-size:14px;color:var(--ink);font-weight:400} +.osLabel,.brandSupport{font-size:14px;color:var(--ink);font-weight:400} +.capabilityBadge{ + display:inline-flex; + align-items:center; + align-self:flex-start; + border-radius:999px; + padding:7px 12px; + background:rgba(14,122,83,.10); + color:var(--accent); + font-size:12px; + font-weight:700; +} .identityPanel{ display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;padding:14px 16px;min-width:300px; } @@ -152,9 +166,90 @@ h1{margin:0;font-size:34px;line-height:1.02;font-weight:650;letter-spacing:-.03e } .displayHero.is-connected,.apHero.is-enabled{background:rgba(14,122,83,.08)} .displayHero.is-empty,.apHero.is-disabled{background:#f7f8f7} +.apExplanation{ + margin-top:14px; + padding:14px 16px; + border:1px solid var(--line); + border-radius:14px; + background:#fbfcfb; +} +.apExplanation p{ + margin:8px 0 0; + color:var(--muted); + font-size:13px; + line-height:1.55; +} .displayHeroLabel{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin-bottom:6px} .displayHeroText{font-size:20px;font-weight:700} .displayHeroMeta{display:flex;gap:10px;flex-wrap:wrap;color:var(--muted);font-size:13px} +.networkOverviewGrid{ + display:grid; + grid-template-columns:repeat(2,minmax(0,1fr)); + gap:16px; + margin-top:16px; +} +.networkInterfaceBlock{ + border:1px solid var(--line); + border-radius:14px; + background:#fbfcfb; + padding:14px; +} +.networkInterfaceHead{ + display:flex; + justify-content:space-between; + gap:10px; + align-items:flex-start; + flex-wrap:wrap; +} +.networkInterfaceHead h3{ + margin:0 0 8px; + font-size:18px; +} +.gboxHero{ + display:grid; + grid-template-columns:minmax(220px, 340px) minmax(0,1fr); + gap:24px; + align-items:center; +} +.gboxHeroImage{ + width:100%; + max-height:320px; + object-fit:contain; +} +.gboxHeroCopy{ + display:grid; + gap:10px; +} +.specTable{ + display:grid; + grid-template-columns:180px minmax(0,1fr); + gap:10px 14px; + margin-top:16px; + font-size:14px; +} +.specTable .key{ + color:var(--muted); + font-weight:600; +} +.manualGrid{ + display:grid; + grid-template-columns:repeat(2,minmax(0,1fr)); + gap:14px; + margin-top:16px; +} +.manualGroup{ + border:1px solid var(--line); + border-radius:14px; + padding:14px; + background:#fbfcfb; +} +.manualSteps{ + margin:10px 0 0; + padding-left:20px; + color:var(--ink); +} +.manualSteps li + li{margin-top:8px} +.manualNotes{margin-top:10px} .connectorList{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px} .connectorCard{border:1px solid var(--line);border-radius:14px;padding:14px;background:#fbfcfb} .connectorHead{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;margin-bottom:12px} @@ -202,6 +297,11 @@ h1{margin:0;font-size:34px;line-height:1.02;font-weight:650;letter-spacing:-.03e .banner.success{background:rgba(14,122,83,.10);color:var(--accent)} .banner.error{background:rgba(185,52,52,.10);color:var(--error)} .scanList{display:grid;gap:10px} +.scanCollapsedHint{ + margin-top:14px; + color:var(--muted); + font-size:13px; +} .scanRow{ display:flex;justify-content:space-between;gap:12px;align-items:center; border:1px solid var(--line);border-radius:12px;background:#fbfcfb;padding:12px 14px; @@ -241,12 +341,15 @@ h1{margin:0;font-size:34px;line-height:1.02;font-weight:650;letter-spacing:-.03e @media (max-width:940px){ .hero{grid-template-columns:1fr} .identityPanel{min-width:0} + .gboxHero{grid-template-columns:1fr} } @media (max-width:720px){ - .summaryGrid{grid-template-columns:1fr} .meta{grid-template-columns:1fr 1fr} .splitMeta{grid-template-columns:1fr} - .brandLogo{width:58px;height:58px} + .networkOverviewGrid{grid-template-columns:1fr} + .manualGrid{grid-template-columns:1fr} + .specTable{grid-template-columns:1fr} + .brandDevice{width:min(70vw, 260px);max-height:180px} .wideCard,.displayCard,.accessPointCard{grid-column:auto} .displayHeroText{font-size:18px} } diff --git a/stage_ui/console_core/frontend/console.js b/stage_ui/console_core/frontend/console.js index 858a8e9..2b42965 100644 --- a/stage_ui/console_core/frontend/console.js +++ b/stage_ui/console_core/frontend/console.js @@ -16,7 +16,7 @@ status: null, health: null, network: null, - scan: { ok: true, networks: [], error: "", warning: "", message: "", loading: false, scannedAt: "" }, + scan: { ok: true, networks: [], error: "", warning: "", message: "", loading: false, scannedAt: "", expanded: false }, networkForm: { ssid: "", password: "", @@ -307,6 +307,12 @@ +
Access Point creates a local Wi-Fi network on the device. It is used for first-time setup, maintenance, and recovery when the device cannot connect to the configured network.
+It usually turns on when the device has no working uplink or when an engineer enables AP mode for service access. In normal operation it may remain disabled.
+
+ Compact edge gateway for automation workloads, local service access, commissioning, and resilient field maintenance.
+
+
IOMATEX Edge OS
-Unified diagnostics, network operations and It-Screen foundation.
+Unified diagnostics, network operations and gateway commissioning.