From 23321ce8e6f77a5a58a85e10be54ffb0b3a391bb Mon Sep 17 00:00:00 2001 From: Junyan Qin Date: Mon, 28 Apr 2025 21:59:37 +0800 Subject: [PATCH] ci: adapt for current webui --- Dockerfile | 2 +- pkg/api/http/controller/main.py | 10 +++++++++- pkg/core/app.py | 2 +- web/next.config.ts | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 428ad14d..5b6d4bff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,7 +12,7 @@ WORKDIR /app COPY . . -COPY --from=node /app/web/dist ./web/dist +COPY --from=node /app/web/out ./web/out RUN apt update \ && apt install gcc -y \ diff --git a/pkg/api/http/controller/main.py b/pkg/api/http/controller/main.py index 79838d7a..a727a7f9 100644 --- a/pkg/api/http/controller/main.py +++ b/pkg/api/http/controller/main.py @@ -65,11 +65,19 @@ class HTTPController: ginst = g(self.ap, self.quart_app) await ginst.initialize() - frontend_path = "web/dist" + frontend_path = "web/out" @self.quart_app.route("/") async def index(): return await quart.send_from_directory(frontend_path, "index.html") + + @self.quart_app.route("/login") + async def login(): + return await quart.send_from_directory(frontend_path, "login.html") + + @self.quart_app.route("/home") + async def home(): + return await quart.send_from_directory(frontend_path, "home.html") @self.quart_app.route("/") async def static_file(path: str): diff --git a/pkg/core/app.py b/pkg/core/app.py index 1c4042f8..9e337efb 100644 --- a/pkg/core/app.py +++ b/pkg/core/app.py @@ -145,7 +145,7 @@ class Application: async def print_web_access_info(self): """打印访问 webui 的提示""" - if not os.path.exists(os.path.join(".", "web/dist")): + if not os.path.exists(os.path.join(".", "web/out")): self.logger.warning("WebUI 文件缺失,请根据文档获取:https://docs.langbot.app/webui/intro.html") return diff --git a/web/next.config.ts b/web/next.config.ts index e9ffa308..9d1f4a25 100644 --- a/web/next.config.ts +++ b/web/next.config.ts @@ -2,6 +2,7 @@ import type { NextConfig } from "next"; const nextConfig: NextConfig = { /* config options here */ + output: 'export' }; export default nextConfig;