Skip to content

Commit c3f5b15

Browse files
DouDOU-startclaude
andcommitted
fix(web): 改进前端本地构建与文案
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7c57e64 commit c3f5b15

4 files changed

Lines changed: 32 additions & 10 deletions

File tree

Makefile

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ SDK_FRONTEND := ../airgate-sdk/frontend
99
# data/plugins/<id>/assets 读。这样三个插件的 dev 体验完全一致,没有特例。
1010
OPENAI_PLUGIN := ../airgate-openai/web
1111
CLAUDE_PLUGIN := ../airgate-claude/web
12+
PLAYGROUND_PLUGIN := ../airgate-playground/web
1213
EPAY_PLUGIN := ../airgate-epay/web
1314
HEALTH_PLUGIN := ../airgate-health/web
1415
# build-plugins 阶段(生产)同步各插件的 admin dist/index.js 到
1516
# core 的 plugin assets dir;health 的公开状态页仍走 /status 反代,不经过这套 assets。
1617
OPENAI_ASSETS := $(BACKEND_DIR)/data/plugins/gateway-openai/assets
1718
CLAUDE_ASSETS := $(BACKEND_DIR)/data/plugins/gateway-anthropic/assets
19+
PLAYGROUND_ASSETS := $(BACKEND_DIR)/data/plugins/airgate-playground/assets
1820
EPAY_ASSETS := $(BACKEND_DIR)/data/plugins/payment-epay/assets
1921
HEALTH_ASSETS := $(BACKEND_DIR)/data/plugins/airgate-health/assets
2022
BINARY := $(BACKEND_DIR)/server
@@ -25,7 +27,7 @@ GO := GOTOOLCHAIN=local go
2527
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
2628
LDFLAGS := -X github.com/DouDOU-start/airgate-core/internal/version.Version=$(VERSION)
2729

28-
.PHONY: help dev dev-backend dev-frontend dev-sdk dev-plugins dev-plugin-openai dev-plugin-claude dev-plugin-epay dev-plugin-health \
30+
.PHONY: help dev dev-backend dev-frontend dev-sdk dev-plugins dev-plugin-openai dev-plugin-claude dev-plugin-playground dev-plugin-epay dev-plugin-health \
2931
build build-backend build-frontend \
3032
build-plugins sync-plugins \
3133
ent lint fmt test clean install ci pre-commit setup-hooks \
@@ -50,12 +52,14 @@ dev-sdk: ## 启动 SDK 主题 watch 模式(修改 token 自动编译)
5052

5153
dev-plugins: ## 启动所有插件前端 watch 模式
5254
@echo "启动插件前端 watch(统一输出到 <plugin>/web/dist,core 在 dev 模式下直读):"
53-
@echo " - openai → ../airgate-openai/web/dist/"
54-
@echo " - claude → ../airgate-claude/web/dist/"
55-
@echo " - epay → ../airgate-epay/web/dist/"
56-
@echo " - health → ../airgate-health/web/dist/ (含 admin index.js + standalone status page)"
55+
@echo " - openai → ../airgate-openai/web/dist/"
56+
@echo " - claude → ../airgate-claude/web/dist/"
57+
@echo " - playground → ../airgate-playground/web/dist/"
58+
@echo " - epay → ../airgate-epay/web/dist/"
59+
@echo " - health → ../airgate-health/web/dist/ (含 admin index.js + standalone status page)"
5760
@$(MAKE) dev-plugin-openai &
5861
@$(MAKE) dev-plugin-claude &
62+
@$(MAKE) dev-plugin-playground &
5963
@$(MAKE) dev-plugin-epay &
6064
@$(MAKE) dev-plugin-health &
6165
@wait
@@ -74,6 +78,13 @@ dev-plugin-claude: ## 单独 watch claude 插件前端(输出到 ../airgate-cl
7478
echo "跳过 claude 插件前端 watch:$(CLAUDE_PLUGIN) 不存在"; \
7579
fi
7680

81+
dev-plugin-playground: ## 单独 watch playground 插件前端(输出到 ../airgate-playground/web/dist)
82+
@if [ -d $(PLAYGROUND_PLUGIN) ]; then \
83+
cd $(PLAYGROUND_PLUGIN) && npx vite build --watch; \
84+
else \
85+
echo "跳过 playground 插件前端 watch:$(PLAYGROUND_PLUGIN) 不存在"; \
86+
fi
87+
7788
dev-plugin-epay: ## 单独 watch epay 插件前端(输出到 ../airgate-epay/web/dist)
7889
@if [ -d $(EPAY_PLUGIN) ]; then \
7990
cd $(EPAY_PLUGIN) && npx vite build --watch; \
@@ -131,7 +142,7 @@ build-plugins: sync-plugins ## 构建插件前端并同步到 core
131142
sync-plugins: ## 构建插件前端并同步 admin 资源到 data/plugins/
132143
@if [ -d $(OPENAI_PLUGIN) ]; then \
133144
echo "构建并同步 openai 插件前端..."; \
134-
cd $(OPENAI_PLUGIN) && npm run build; \
145+
(cd $(OPENAI_PLUGIN) && npm run build); \
135146
mkdir -p $(OPENAI_ASSETS); \
136147
cp $(OPENAI_PLUGIN)/dist/index.js $(OPENAI_ASSETS)/index.js; \
137148
echo "openai 插件前端已同步到 $(OPENAI_ASSETS)/"; \
@@ -140,16 +151,25 @@ sync-plugins: ## 构建插件前端并同步 admin 资源到 data/plugins/
140151
fi
141152
@if [ -d $(CLAUDE_PLUGIN) ]; then \
142153
echo "构建并同步 claude 插件前端..."; \
143-
cd $(CLAUDE_PLUGIN) && npm run build; \
154+
(cd $(CLAUDE_PLUGIN) && npm run build); \
144155
mkdir -p $(CLAUDE_ASSETS); \
145156
cp $(CLAUDE_PLUGIN)/dist/index.js $(CLAUDE_ASSETS)/index.js; \
146157
echo "claude 插件前端已同步到 $(CLAUDE_ASSETS)/"; \
147158
else \
148159
echo "跳过 claude 插件前端构建:$(CLAUDE_PLUGIN) 不存在"; \
149160
fi
161+
@if [ -d $(PLAYGROUND_PLUGIN) ]; then \
162+
echo "构建并同步 playground 插件前端..."; \
163+
(cd $(PLAYGROUND_PLUGIN) && npm run build); \
164+
mkdir -p $(PLAYGROUND_ASSETS); \
165+
cp $(PLAYGROUND_PLUGIN)/dist/index.js $(PLAYGROUND_ASSETS)/index.js; \
166+
echo "playground 插件前端已同步到 $(PLAYGROUND_ASSETS)/"; \
167+
else \
168+
echo "跳过 playground 插件前端构建:$(PLAYGROUND_PLUGIN) 不存在"; \
169+
fi
150170
@if [ -d $(EPAY_PLUGIN) ]; then \
151171
echo "构建并同步 epay 插件前端..."; \
152-
cd $(EPAY_PLUGIN) && npm run build; \
172+
(cd $(EPAY_PLUGIN) && npm run build); \
153173
mkdir -p $(EPAY_ASSETS); \
154174
cp $(EPAY_PLUGIN)/dist/index.js $(EPAY_ASSETS)/index.js; \
155175
echo "epay 插件前端已同步到 $(EPAY_ASSETS)/"; \
@@ -158,7 +178,7 @@ sync-plugins: ## 构建插件前端并同步 admin 资源到 data/plugins/
158178
fi
159179
@if [ -d $(HEALTH_PLUGIN) ]; then \
160180
echo "构建并同步 health 插件前端..."; \
161-
cd $(HEALTH_PLUGIN) && npm run build; \
181+
(cd $(HEALTH_PLUGIN) && npm run build); \
162182
mkdir -p $(HEALTH_ASSETS); \
163183
cp $(HEALTH_PLUGIN)/dist/index.js $(HEALTH_ASSETS)/index.js; \
164184
echo "health 插件 admin 前端已同步到 $(HEALTH_ASSETS)/"; \

web/src/app/layout/AppShell.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ export function AppShell({ children }: AppShellProps) {
317317
);
318318

319319
return (
320-
<div className="flex h-screen">
320+
<div className="flex h-screen" style={{ height: '100dvh' }}>
321321
{/* Mobile backdrop */}
322322
{isMobile && mobileOpen && (
323323
<div

web/src/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,7 @@
974974
"no_conversations": "No conversations yet",
975975
"no_conversations_hint": "Create a conversation to get started",
976976
"delete_conversation": "Delete",
977+
"delete_conversation_confirm": "Deleting this conversation permanently removes its history. Continue?",
977978
"empty_title": "Start a Conversation",
978979
"empty_description": "Select a model and start chatting with AI",
979980
"balance": "Balance",

web/src/i18n/zh.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -978,6 +978,7 @@
978978
"no_conversations": "暂无对话",
979979
"no_conversations_hint": "创建对话开始体验",
980980
"delete_conversation": "删除",
981+
"delete_conversation_confirm": "删除后会话记录将无法恢复,确定要删除吗?",
981982
"empty_title": "开始对话",
982983
"empty_description": "选择模型,与 AI 开始聊天",
983984
"balance": "余额",

0 commit comments

Comments
 (0)