Import the existing state center, web UI, YiSaiQi callback skeleton, and project docs. Ignore local venvs, node_modules, recordings, and the duplicate state_center copy. |
||
|---|---|---|
| .. | ||
| src | ||
| LAYOUT_PROPOSAL.md | ||
| README.md | ||
| index.html | ||
| package-lock.json | ||
| package.json | ||
| tsconfig.json | ||
| vite.config.ts | ||
README.md
状态中心 Web 版
一键启动联调环境
在项目根目录执行:
macOS/Linux:
./.venv_test/bin/python scripts/dev.py start
Windows PowerShell:
.\.venv_test\Scripts\python.exe scripts\dev.py start
启动器会复用或创建 Docker MySQL 容器 rpa-center-mysql,然后启动 FastAPI 和 Vite。
python scripts/dev.py status
python scripts/dev.py stop
status 只有在 MySQL 端口、FastAPI /health(包含数据库探测)和 Vite 端口都正常时才返回成功。
手动启动
cd state_center_web
npm install
npm run dev
默认地址:http://localhost:5173
后端另开一个终端:
macOS/Linux:
python -m pip install -r state_center/requirements.txt
DEV_MODE=true python -m uvicorn state_center.app.main:app --reload --port 8000
Windows PowerShell:
$env:DEV_MODE = "true"
python -m pip install -r state_center\requirements.txt
python -m uvicorn state_center.app.main:app --reload --port 8000
浏览器访问:http://localhost:5173/。同一套页面适用于 Windows 和 macOS;前端不会自行推导流程下一节点,所有节点状态都来自 FastAPI。
说明
- 页面全中文。
- 后端可连时,直接读
state_center的 FastAPI 接口。 - 后端没起时,页面自动切到本地演示数据,仍可看到单据列表、流程状态图和待办面板。
- 页面顶部会明确显示“本地演示数据”或“后端已连接”。
- 对码待办可直接选择候选货品;人工节点按节点显示对应动作。
- 节点回调模拟区只在开发环境构建中显示。
- 开发令牌只保存在浏览器会话里,不会写进代码。