Add controller node selector and accordion wizards
This commit is contained in:
@@ -4,11 +4,14 @@ import path from 'node:path'
|
||||
|
||||
const root = process.cwd()
|
||||
|
||||
const [wizardSource, planRouteSource, deployRouteSource, planLibSource] = await Promise.all([
|
||||
const [wizardSource, sidebarSource, planRouteSource, deployRouteSource, registryRouteSource, planLibSource, registryLibSource] = await Promise.all([
|
||||
readFile(path.join(root, 'app/components/WizardPanel.tsx'), 'utf8'),
|
||||
readFile(path.join(root, 'app/components/Sidebar.tsx'), 'utf8'),
|
||||
readFile(path.join(root, 'app/api/controller-node/plan/route.ts'), 'utf8'),
|
||||
readFile(path.join(root, 'app/api/controller-node/deploy/route.ts'), 'utf8'),
|
||||
readFile(path.join(root, 'app/api/controller-node/registry/route.ts'), 'utf8'),
|
||||
readFile(path.join(root, 'app/lib/controllerNodePlan.ts'), 'utf8'),
|
||||
readFile(path.join(root, 'app/lib/controllerNodeRegistry.ts'), 'utf8'),
|
||||
])
|
||||
|
||||
assert.match(wizardSource, /Spawn a Controller Node/, 'wizard must expose a controller-node workflow')
|
||||
@@ -24,8 +27,11 @@ assert.match(wizardSource, /OPENCLAW_DASHBOARD_URL|OpenClaw Dashboard URL/, 'wiz
|
||||
assert.match(wizardSource, /OPENSHELL_GATEWAY|OpenShell Gateway/, 'wizard must collect the remote OpenShell gateway context')
|
||||
assert.match(wizardSource, /Controller Env/, 'wizard must expose the generated controller environment')
|
||||
assert.match(wizardSource, /Readiness Checks/, 'wizard must show remote readiness checks')
|
||||
assert.match(wizardSource, /aria-expanded=\{controllerWizardOpen\}/, 'controller node wizard must render as an accordion')
|
||||
assert.match(wizardSource, /aria-expanded=\{cloneWizardOpen\}/, 'clone wizard must render as an accordion')
|
||||
|
||||
assert.match(planRouteSource, /buildControllerNodePlan/, 'plan API must use shared controller plan builder')
|
||||
assert.match(planRouteSource, /upsertControllerNode/, 'plan API must register generated controller nodes')
|
||||
assert.match(planLibSource, /OPENCLAW_INSTANCE_REGISTRY_JSON/, 'plan builder must configure the OpenClaw instance registry')
|
||||
assert.match(planLibSource, /CONTROLLER_NODE_PARENT_URL/, 'plan builder must configure parent controller connectivity')
|
||||
assert.match(planLibSource, /CONTROLLER_NODE_SHARED_SECRET/, 'plan builder must generate a node shared secret')
|
||||
@@ -38,6 +44,13 @@ assert.match(deployRouteSource, /remotePassword/, 'deploy API must accept one-ti
|
||||
assert.match(deployRouteSource, /sudo -S/, 'deploy API must support explicit sudo elevation')
|
||||
assert.match(deployRouteSource, /expectedHostKeySha256/, 'deploy API must support host-key fingerprint verification')
|
||||
assert.match(deployRouteSource, /acceptUnknownHostKey/, 'deploy API must require explicit trust-on-first-deploy')
|
||||
assert.doesNotMatch(`${planRouteSource}\n${deployRouteSource}\n${planLibSource}`, /\/home\/nvidia|\/Users\/markmckeen/, 'controller node code must not bake in developer machine paths')
|
||||
assert.match(sidebarSource, /OpenShell Control/, 'sidebar must keep the OpenShell Control header')
|
||||
assert.match(sidebarSource, /\/api\/controller-node\/registry/, 'sidebar must load managed controller nodes')
|
||||
assert.match(sidebarSource, /Friendly Name/, 'sidebar must allow friendly names for controller nodes')
|
||||
assert.match(sidebarSource, /Managed Node/, 'sidebar must expose a managed-node selector')
|
||||
assert.match(registryRouteSource, /listControllerNodes/, 'registry API must expose controller nodes')
|
||||
assert.match(registryRouteSource, /renameControllerNode/, 'registry API must support friendly-name updates')
|
||||
assert.match(registryLibSource, /OPENSHELL_CONTROLLER_NODES_JSON|OPENCLAW_INSTANCE_REGISTRY_JSON/, 'registry must detect configured remote controller nodes')
|
||||
assert.doesNotMatch(`${planRouteSource}\n${deployRouteSource}\n${planLibSource}\n${registryLibSource}`, /\/home\/nvidia|\/Users\/markmckeen/, 'controller node code must not bake in developer machine paths')
|
||||
|
||||
console.log('controller-node-wizard-check: PASS controller node wizard assertions')
|
||||
|
||||
Reference in New Issue
Block a user