From 8ae4d87e4f5caa94bd037fa60c0fbda77ab42477 Mon Sep 17 00:00:00 2001 From: hfshfg <38004547@qq.com> Date: Thu, 12 Mar 2026 20:26:15 +0800 Subject: [PATCH] feat: add independent config server to replace Config.html MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the problematic file:// protocol Config.html with a stable Node.js HTTP server following industry standard patterns (n8n, Langflow). Changes: - Add portable/config-server/ with REST API (GET/POST /api/config) - Add simplified Chinese/English web UI for AI model and QQ Bot config - Update Windows-Start.bat to launch both services simultaneously - Config Center on port 18788 - OpenClaw Gateway on port 18789 - Remove Config.html file:// protocol issues - Use zero-dependency pure Node.js standard library Benefits: - No file:// CORS or WebSocket issues - Industry-standard localhost HTTP pattern - Simplified configuration interface for Chinese users - Unified startup experience 🤖 Generated with Claude Code --- portable/Windows-Start.bat | 30 +++- portable/config-server/public/index.html | 207 +++++++++++++++++++++++ portable/config-server/server.js | 82 +++++++++ 3 files changed, 311 insertions(+), 8 deletions(-) create mode 100644 portable/config-server/public/index.html create mode 100644 portable/config-server/server.js diff --git a/portable/Windows-Start.bat b/portable/Windows-Start.bat index aa503a0..e1da2ca 100644 --- a/portable/Windows-Start.bat +++ b/portable/Windows-Start.bat @@ -79,17 +79,31 @@ if %errorlevel%==0 ( ) echo Starting OpenClaw on port %PORT%... -echo DO NOT close this window! +echo. + +REM Start Config Server in background +echo Starting Config Center on port 18788... +set "CONFIG_SERVER=%UCLAW_DIR%config-server" +start /B "" "%NODE_BIN%" "%CONFIG_SERVER%\server.js" >nul 2>&1 + +REM Wait for config server to start +timeout /t 2 /nobreak >nul + +REM Open both Config Center and Dashboard +echo Opening Config Center and Dashboard... +timeout /t 1 /nobreak >nul + +REM Open Config Center (Node.js web UI) +start "" http://127.0.0.1:18788/ + +REM Open OpenClaw Dashboard +start "" http://127.0.0.1:%PORT%/#token=uclaw + +echo Browsers opened. Starting OpenClaw Gateway on port %PORT%... +echo DO NOT close this window while using U-Claw! echo. cd /d "%CORE_DIR%" - -REM Always open dashboard - it will guide first-time setup -echo 正在打开控制台... -echo Opening dashboard at http://127.0.0.1:%PORT% -timeout /t 2 /nobreak >nul -start "" http://127.0.0.1:%PORT%/#token=uclaw - set "OPENCLAW_MJS=%CORE_DIR%\node_modules\openclaw\openclaw.mjs" "%NODE_BIN%" "%OPENCLAW_MJS%" gateway run --allow-unconfigured --force --port %PORT% diff --git a/portable/config-server/public/index.html b/portable/config-server/public/index.html new file mode 100644 index 0000000..1119b7f --- /dev/null +++ b/portable/config-server/public/index.html @@ -0,0 +1,207 @@ + + +
+ + +简单配置,快速启动
+ + +