From 68ab05b22066bd26f9e6fce96cd830cddfdb3bd8 Mon Sep 17 00:00:00 2001 From: TOM88812 Date: Sun, 16 Feb 2025 23:01:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DwebUI=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E8=B7=B3=E8=BD=AC=E7=99=BB=E5=BD=95=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dockerignore | 4 +- Dockerfile | 10 +- ZhiKongTaiWeb/package.json | 3 +- ZhiKongTaiWeb/src/App.vue | 49 +--- ZhiKongTaiWeb/src/components/Login.vue | 274 +++++++++--------- ZhiKongTaiWeb/src/components/Main.vue | 8 +- ZhiKongTaiWeb/src/components/NavBar.vue | 15 +- ZhiKongTaiWeb/src/components/Registration.vue | 108 ++++--- ZhiKongTaiWeb/src/components/RoleSetting.vue | 40 +-- ZhiKongTaiWeb/src/components/panel.vue | 16 +- ZhiKongTaiWeb/src/main.js | 55 +++- ZhiKongTaiWeb/vite.config.js | 5 +- 12 files changed, 288 insertions(+), 299 deletions(-) diff --git a/.dockerignore b/.dockerignore index 6a33ae9e..26d30488 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,4 +8,6 @@ tmp/ data/ LICENSE README.md -README_en.md \ No newline at end of file +README_en.md +manager/static +manager/static/webui/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index f19d7a22..5ae890f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,11 @@ # 第一阶段:前端构建 -FROM node:18 as frontend-builder +FROM node:18 AS frontend-builder WORKDIR /app/ZhiKongTaiWeb +# 配置npm使用淘宝源 +RUN npm config set registry https://registry.npmmirror.com + COPY ZhiKongTaiWeb/package*.json ./ RUN npm install @@ -12,7 +15,7 @@ COPY ZhiKongTaiWeb . RUN npm run build # 第二阶段:构建Python依赖 -FROM python:3.10-slim as builder +FROM python:3.10-slim AS builder WORKDIR /app @@ -58,8 +61,7 @@ RUN rm -rf /etc/apt/sources.list.d/* && \ # 从构建阶段复制虚拟环境和前端构建产物 COPY --from=builder /opt/venv /opt/venv -COPY --from=frontend-builder /app/ZhiKongTaiWeb/dist /opt/xiaozhi-esp32-server/manager/static - +COPY --from=frontend-builder /app/ZhiKongTaiWeb/dist /opt/xiaozhi-esp32-server/manager/static/webui # 设置虚拟环境路径 ENV PATH="/opt/venv/bin:$PATH" diff --git a/ZhiKongTaiWeb/package.json b/ZhiKongTaiWeb/package.json index a0bc4158..f67f2ffe 100644 --- a/ZhiKongTaiWeb/package.json +++ b/ZhiKongTaiWeb/package.json @@ -9,7 +9,8 @@ "preview": "vite preview" }, "dependencies": { - "vue": "^3.5.10" + "vue": "^3.5.10", + "vue-router": "^4.0.0" }, "devDependencies": { "@vitejs/plugin-vue": "^5.1.4", diff --git a/ZhiKongTaiWeb/src/App.vue b/ZhiKongTaiWeb/src/App.vue index de9472b9..7dbc3af7 100644 --- a/ZhiKongTaiWeb/src/App.vue +++ b/ZhiKongTaiWeb/src/App.vue @@ -1,64 +1,19 @@ diff --git a/ZhiKongTaiWeb/src/components/Login.vue b/ZhiKongTaiWeb/src/components/Login.vue index 575d2539..4fddaec3 100644 --- a/ZhiKongTaiWeb/src/components/Login.vue +++ b/ZhiKongTaiWeb/src/components/Login.vue @@ -12,148 +12,146 @@ -

还没注册账户? 点击注册

+

还没注册账户? 点击注册

- - - \ No newline at end of file +}; + + + \ No newline at end of file diff --git a/ZhiKongTaiWeb/src/components/Main.vue b/ZhiKongTaiWeb/src/components/Main.vue index b73478ee..6d81a77f 100644 --- a/ZhiKongTaiWeb/src/components/Main.vue +++ b/ZhiKongTaiWeb/src/components/Main.vue @@ -33,7 +33,9 @@ diff --git a/ZhiKongTaiWeb/src/components/NavBar.vue b/ZhiKongTaiWeb/src/components/NavBar.vue index 579e6846..38c55ffa 100644 --- a/ZhiKongTaiWeb/src/components/NavBar.vue +++ b/ZhiKongTaiWeb/src/components/NavBar.vue @@ -1,8 +1,8 @@ diff --git a/ZhiKongTaiWeb/src/components/Registration.vue b/ZhiKongTaiWeb/src/components/Registration.vue index 9dc09749..4015a9dd 100644 --- a/ZhiKongTaiWeb/src/components/Registration.vue +++ b/ZhiKongTaiWeb/src/components/Registration.vue @@ -18,72 +18,66 @@

已有账号? - 点击登录 + 点击登录

- diff --git a/ZhiKongTaiWeb/src/components/RoleSetting.vue b/ZhiKongTaiWeb/src/components/RoleSetting.vue index 58408a20..0f556e6c 100644 --- a/ZhiKongTaiWeb/src/components/RoleSetting.vue +++ b/ZhiKongTaiWeb/src/components/RoleSetting.vue @@ -4,8 +4,8 @@ @@ -107,12 +107,16 @@