2 Commits

Author SHA1 Message Date
Ding Shuo
28b85e1422 feat: add quick input button for PlanningAgent 2026-03-16 01:56:07 +08:00
Ding Shuo
ccfba711e7 chore: add docker deployment files and scripts 2026-03-15 12:19:47 +08:00
4 changed files with 121 additions and 1 deletions

24
Dockerfile Normal file
View File

@@ -0,0 +1,24 @@
# Stage 1: Build
FROM node:20-slim AS build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
# Stage 2: Serve with Nginx
FROM nginx:alpine
# Copy build output to nginx folder
COPY --from=build /app/dist /usr/share/nginx/html
# Custom nginx config to handle SPA routing if needed
RUN echo 'server { \
listen 80; \
location / { \
root /usr/share/nginx/html; \
index index.html; \
try_files $uri $uri/ /index.html; \
} \
}' > /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

29
build_and_push.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/bin/bash
# Configuration
REGISTRY="dcr-by1jwyxk44.71826370.xyz"
IMAGE_NAME="safe-os-ui"
TAG="latest"
FULL_IMAGE_NAME="$REGISTRY/$IMAGE_NAME:$TAG"
echo "Step 1: Building Docker image..."
docker build -t $IMAGE_NAME:$TAG .
if [ $? -ne 0 ]; then
echo "Error: Docker build failed."
exit 1
fi
echo "Step 2: Tagging image for registry..."
docker tag $IMAGE_NAME:$TAG $FULL_IMAGE_NAME
echo "Step 3: Pushing image to $REGISTRY..."
# Note: You might need to run 'docker login $REGISTRY' beforehand
docker push $FULL_IMAGE_NAME
if [ $? -eq 0 ]; then
echo "Success: Image has been pushed to $FULL_IMAGE_NAME"
else
echo "Error: Docker push failed."
exit 1
fi

45
deploy/docker-compose.yml Normal file
View File

@@ -0,0 +1,45 @@
version: '3.8'
services:
# Frontend Service
safe-os-ui:
image: dcr-by1jwyxk44.71826370.xyz/safe-os-ui:latest
container_name: safe-os-ui
restart: always
networks:
- npm_network
# Backend: Planning Agent
planning-agent:
image: dcr-by1jwyxk44.71826370.xyz/planning-agent:latest
container_name: planning-agent
restart: always
environment:
- PORT=8090
networks:
- npm_network
# Backend: DevOps Agent
devops-agent:
image: dcr-by1jwyxk44.71826370.xyz/devops-agent:latest
container_name: devops-agent
restart: always
environment:
- PORT=8000
networks:
- npm_network
# Backend: Quality Gate
quality-gate:
image: dcr-by1jwyxk44.71826370.xyz/quality-gate:latest
container_name: quality-gate
restart: always
environment:
- PORT=5000
networks:
- npm_network
networks:
npm_network:
external: true
name: proxy-net # 已更新为实际的 Docker 网络名称

View File

@@ -598,7 +598,29 @@ export default function PlanningAgent() {
<span key={f.id} className="badge text-[0.7rem]">{f.name}</span>
))}
<button
className="ml-auto text-xs text-txt-muted hover:text-magenta"
className="ml-auto text-xs text-txt-muted hover:text-magenta flex items-center gap-1.5"
onClick={() => setInput(`# Epic: Q3 智能云端电池预测性维护系统 (BMS-AI)
## 业务背景
目前我们接入云端的 50 万台新能源车辆中,电池因单体压差过大导致的突发性故障率有上升趋势,造成了较高的售后索赔成本和用户客诉。我们需要在 Q3 PI (Program Increment) 落地一套“电池预测性维护系统”。
## 核心目标
1. **数据实时采集**:云端需要能够高频接收车辆上报的电池运行遥测数据(包含单体电压、温度、充放电电流等)。
2. **云端 AI 分析**:利用云端的 AI 异常检测模型,对电池数据进行实时流式计算,预测未来 7 天内可能发生故障的电池包。
3. **多端预警联动**:一旦云端判定存在高风险,需立即向车机端(座舱屏幕)和车主的手机 App 同时下发告警弹窗,并生成一条云端售后维修建议工单。
## 约束与期望
- **合规性**:采集的车辆 VIN 码和位置信息必须符合个人信息保护法PIPL的数据脱敏要求。
- **性能**:云端必须能扛住 50 万台车同时在线高频上报数据的并发压力。告警下发延迟不能超过 3 秒。`)}
title="快速输入: BMS-AI 预测性维护 Epic 示例"
>
<svg className="w-3.5 h-3.5 opacity-60" fill="none" stroke="currentColor" viewBox="0 0 24 24">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M13 10V3L4 14h7v7l9-11h-7z" />
</svg>
</button>
<button
className="text-xs text-txt-muted hover:text-magenta"
onClick={handleReset}
>