2 Commits
Author SHA1 Message Date
clawdbuddy bf209e5236 fix: load node specs from backend on App mount so remote-host config is included in sim start
Previously nodeSpecs was only set when user visited NodeManager tab.
If user clicked Start from Dashboard without visiting NodeManager first,
the start request had no 'nodes' field -> backend generated all-local
defaults -> remote host-manet-node never started.

Fix: fetch /api/nodes/specs in App useEffect on mount.
2026-05-17 14:42:11 +08:00
clawdbuddy b55a819067 fix: handle host-manet-node:latest image mapping in start_one 2026-05-17 14:06:31 +08:00
3 changed files with 17 additions and 7 deletions

No files matched your search

+1 -1
View File
@@ -23,6 +23,6 @@
"pathLossExponent": 2.0,
"frequencyMhz": 2412,
"channelWidthMhz": 20,
"rangeTargetM": 3400.0,
"rangeTargetM": 500.0,
"pathLossModel": "FreeSpace"
}
@@ -217,12 +217,14 @@ class HostNodeMgr:
name, self.host_ip, spec.image, spec.ip)
# 3) docker run (--net=host, --privileged)
# If spec.image is the default container image, use the host-specific one.
# Otherwise trust the caller's image choice (e.g. GHCR path).
if spec.image == "manet-node:latest":
# Map local image names to GHCR host-manet-node images.
# If the caller specifies a custom image (e.g. GHCR path), use it as-is.
image = spec.image or "manet-node:latest"
if image in ("manet-node:latest", "host-manet-node:latest"):
image = "ghcr.io/clawdbuddy/host-manet-node:main"
else:
image = spec.image
# v1.1.4+ tagged images
if image == "host-manet-node:1.1.4":
image = "ghcr.io/clawdbuddy/host-manet-node:1.1.4"
# Auto-pull if not present
self._exec(f"docker images -q {image} 2>/dev/null | grep -q . || docker pull {image}")
run_cmd = (
+9 -1
View File
@@ -1,4 +1,4 @@
import { useState, useCallback } from 'react';
import { useState, useCallback, useEffect } from 'react';
import { cn } from '@/lib/utils';
import { Button } from '@/components/ui/button';
import { useSimConfig } from '@/hooks/useSimConfig';
@@ -42,6 +42,14 @@ function App() {
const [activePage, setActivePage] = useState<PageKey>('dashboard');
const [nodeSpecs, setNodeSpecs] = useState<NodeSpec[] | undefined>(undefined);
// Load node specs from backend on mount (so Start always includes remote-host config)
useEffect(() => {
fetch('/api/nodes/specs')
.then(r => r.ok ? r.json() : [])
.then(data => { if (Array.isArray(data) && data.length > 0) setNodeSpecs(data); })
.catch(() => {});
}, []);
const handleStart = () => {
startSimulation(config, undefined, nodeSpecs);
};