diff --git a/.gitignore b/.gitignore index 8be615c08..898c3a7a2 100644 --- a/.gitignore +++ b/.gitignore @@ -140,8 +140,4 @@ cython_debug/ model.pt tmp .DS_Store -.config.yaml -.secrets.yaml -.private_config.yaml -.env.development -docker-compose.yml +/data diff --git a/Dockerfile b/Dockerfile index 9648b7b58..849e049eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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" diff --git a/Dockerfile-pip b/Dockerfile-pip index 00ad57f04..4ed6084fe 100755 --- a/Dockerfile-pip +++ b/Dockerfile-pip @@ -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 . . diff --git a/manager/http_server.py b/manager/http_server.py index 565c1cf47..9c477020f 100644 --- a/manager/http_server.py +++ b/manager/http_server.py @@ -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() diff --git a/ZhiKongTaiWeb/.env.development b/web/.env.development similarity index 100% rename from ZhiKongTaiWeb/.env.development rename to web/.env.development diff --git a/ZhiKongTaiWeb/.env.production b/web/.env.production similarity index 100% rename from ZhiKongTaiWeb/.env.production rename to web/.env.production diff --git a/ZhiKongTaiWeb/.gitignore b/web/.gitignore similarity index 100% rename from ZhiKongTaiWeb/.gitignore rename to web/.gitignore diff --git a/ZhiKongTaiWeb/README.md b/web/README.md similarity index 100% rename from ZhiKongTaiWeb/README.md rename to web/README.md diff --git a/ZhiKongTaiWeb/index.html b/web/index.html similarity index 100% rename from ZhiKongTaiWeb/index.html rename to web/index.html diff --git a/ZhiKongTaiWeb/package-lock.json b/web/package-lock.json similarity index 99% rename from ZhiKongTaiWeb/package-lock.json rename to web/package-lock.json index a9af8c769..484d6f825 100644 --- a/ZhiKongTaiWeb/package-lock.json +++ b/web/package-lock.json @@ -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" diff --git a/ZhiKongTaiWeb/package.json b/web/package.json similarity index 95% rename from ZhiKongTaiWeb/package.json rename to web/package.json index 7f488208f..d7fa4ade7 100644 --- a/ZhiKongTaiWeb/package.json +++ b/web/package.json @@ -1,5 +1,5 @@ { - "name": "zhikongtaiweb", + "name": "web", "private": true, "version": "0.0.0", "type": "module", diff --git a/ZhiKongTaiWeb/public/favicon.ico b/web/public/favicon.ico similarity index 100% rename from ZhiKongTaiWeb/public/favicon.ico rename to web/public/favicon.ico diff --git a/ZhiKongTaiWeb/public/vite.svg b/web/public/vite.svg similarity index 100% rename from ZhiKongTaiWeb/public/vite.svg rename to web/public/vite.svg diff --git a/ZhiKongTaiWeb/src/App.vue b/web/src/App.vue similarity index 100% rename from ZhiKongTaiWeb/src/App.vue rename to web/src/App.vue diff --git a/ZhiKongTaiWeb/src/assets/favicon.ico b/web/src/assets/favicon.ico similarity index 100% rename from ZhiKongTaiWeb/src/assets/favicon.ico rename to web/src/assets/favicon.ico diff --git a/ZhiKongTaiWeb/src/assets/robot.png b/web/src/assets/robot.png similarity index 100% rename from ZhiKongTaiWeb/src/assets/robot.png rename to web/src/assets/robot.png diff --git a/ZhiKongTaiWeb/src/assets/vue.svg b/web/src/assets/vue.svg similarity index 100% rename from ZhiKongTaiWeb/src/assets/vue.svg rename to web/src/assets/vue.svg diff --git a/ZhiKongTaiWeb/src/components/DeviceCard.vue b/web/src/components/DeviceCard.vue similarity index 100% rename from ZhiKongTaiWeb/src/components/DeviceCard.vue rename to web/src/components/DeviceCard.vue diff --git a/ZhiKongTaiWeb/src/components/Footer.vue b/web/src/components/Footer.vue similarity index 100% rename from ZhiKongTaiWeb/src/components/Footer.vue rename to web/src/components/Footer.vue diff --git a/ZhiKongTaiWeb/src/components/Login.vue b/web/src/components/Login.vue similarity index 100% rename from ZhiKongTaiWeb/src/components/Login.vue rename to web/src/components/Login.vue diff --git a/ZhiKongTaiWeb/src/components/Main.vue b/web/src/components/Main.vue similarity index 100% rename from ZhiKongTaiWeb/src/components/Main.vue rename to web/src/components/Main.vue diff --git a/ZhiKongTaiWeb/src/components/NavBar.vue b/web/src/components/NavBar.vue similarity index 100% rename from ZhiKongTaiWeb/src/components/NavBar.vue rename to web/src/components/NavBar.vue diff --git a/ZhiKongTaiWeb/src/components/Registration.vue b/web/src/components/Registration.vue similarity index 100% rename from ZhiKongTaiWeb/src/components/Registration.vue rename to web/src/components/Registration.vue diff --git a/ZhiKongTaiWeb/src/components/RoleSetting.vue b/web/src/components/RoleSetting.vue similarity index 100% rename from ZhiKongTaiWeb/src/components/RoleSetting.vue rename to web/src/components/RoleSetting.vue diff --git a/ZhiKongTaiWeb/src/components/SwitchToggle.vue b/web/src/components/SwitchToggle.vue similarity index 100% rename from ZhiKongTaiWeb/src/components/SwitchToggle.vue rename to web/src/components/SwitchToggle.vue diff --git a/ZhiKongTaiWeb/src/components/panel.vue b/web/src/components/panel.vue similarity index 100% rename from ZhiKongTaiWeb/src/components/panel.vue rename to web/src/components/panel.vue diff --git a/ZhiKongTaiWeb/src/config/api.js b/web/src/config/api.js similarity index 100% rename from ZhiKongTaiWeb/src/config/api.js rename to web/src/config/api.js diff --git a/ZhiKongTaiWeb/src/main.js b/web/src/main.js similarity index 100% rename from ZhiKongTaiWeb/src/main.js rename to web/src/main.js diff --git a/ZhiKongTaiWeb/src/style.css b/web/src/style.css similarity index 100% rename from ZhiKongTaiWeb/src/style.css rename to web/src/style.css diff --git a/ZhiKongTaiWeb/src/utils/RoleTemplates.js b/web/src/utils/RoleTemplates.js similarity index 100% rename from ZhiKongTaiWeb/src/utils/RoleTemplates.js rename to web/src/utils/RoleTemplates.js diff --git a/ZhiKongTaiWeb/src/utils/api.js b/web/src/utils/api.js similarity index 100% rename from ZhiKongTaiWeb/src/utils/api.js rename to web/src/utils/api.js diff --git a/ZhiKongTaiWeb/vite.config.js b/web/vite.config.js similarity index 100% rename from ZhiKongTaiWeb/vite.config.js rename to web/vite.config.js diff --git a/ZhiKongTaiWeb/yarn.lock b/web/yarn.lock similarity index 100% rename from ZhiKongTaiWeb/yarn.lock rename to web/yarn.lock