🦄 refactor(web): 修改zhikongtaiweb到web

This commit is contained in:
kalicyh 2025-02-20 11:20:16 +08:00
parent afa469c08c
commit 71d3ff2a57
33 changed files with 13 additions and 17 deletions

6
.gitignore vendored
View file

@ -140,8 +140,4 @@ cython_debug/
model.pt
tmp
.DS_Store
.config.yaml
.secrets.yaml
.private_config.yaml
.env.development
docker-compose.yml
/data

View file

@ -2,15 +2,15 @@
FROM kalicyh/node:v18-alpine AS frontend-builder
WORKDIR /app/ZhiKongTaiWeb
WORKDIR /app/web
# RUN corepack enable && yarn config set registry https://registry.npmmirror.com
COPY ZhiKongTaiWeb/package.json ZhiKongTaiWeb/yarn.lock ./
COPY web/package.json web/yarn.lock ./
RUN yarn install --frozen-lockfile
COPY ZhiKongTaiWeb .
COPY web .
RUN yarn build
# 第二阶段:构建 Python 依赖
@ -35,7 +35,7 @@ RUN poetry install --no-root
# apt-get clean
# 从构建阶段复制虚拟环境和前端构建产物
COPY --from=frontend-builder /app/ZhiKongTaiWeb/dist /app/manager/static/webui
COPY --from=frontend-builder /app/web/dist /app/manager/static/webui
# 设置虚拟环境路径
ENV PATH="/app/.venv/bin:$PATH"

View file

@ -1,18 +1,18 @@
# 第一阶段:前端构建
FROM node:18 AS frontend-builder
WORKDIR /app/ZhiKongTaiWeb
WORKDIR /app/web
# 配置npm使用淘宝源
RUN npm config set registry https://registry.npmmirror.com
COPY ZhiKongTaiWeb/package*.json ./
COPY web/package*.json ./
# 安装axios依赖
RUN npm install axios
RUN npm install
COPY ZhiKongTaiWeb .
COPY web .
RUN npm run build
@ -42,7 +42,7 @@ RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib
# 从构建阶段复制Python包和前端构建产物
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
COPY --from=frontend-builder /app/ZhiKongTaiWeb/dist /opt/xiaozhi-esp32-server/manager/static/webui
COPY --from=frontend-builder /app/web/dist /opt/xiaozhi-esp32-server/manager/static/webui
# 复制应用代码
COPY . .

View file

@ -38,7 +38,7 @@ class WebUI:
self.session_manager = SessionManager()
# 添加静态文件路径
self.static_path = os.path.join(root_dir, 'ZhiKongTaiWeb', 'dist')
self.static_path = os.path.join(root_dir, 'web', 'dist')
self.setup_routes()
self.setup_cors()

View file

@ -1,11 +1,11 @@
{
"name": "zhikongtaiweb",
"name": "web",
"version": "0.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "zhikongtaiweb",
"name": "web",
"version": "0.0.0",
"dependencies": {
"vue": "^3.5.10"

View file

@ -1,5 +1,5 @@
{
"name": "zhikongtaiweb",
"name": "web",
"private": true,
"version": "0.0.0",
"type": "module",

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View file

Before

Width:  |  Height:  |  Size: 496 B

After

Width:  |  Height:  |  Size: 496 B