From: Codebuddy Date: Thu, 27 Aug 2026 02:56:15 +0000 (+0800) Subject: feat: 新增黑白灰终端风格站点图标(favicon + 登录页 logo) X-Git-Url: http://acesimba.cloud/gitweb/?a=commitdiff_plain;h=aad3e696a254606073dda410a7da10cf9f329717;p=codebuddy-web.git feat: 新增黑白灰终端风格站点图标(favicon + 登录页 logo) - 新增 frontend/favicon.svg:圆角方块 + 白色 > 提示符 + 灰色光标,黑/白/灰极简设计 - 后端新增 /favicon.svg 路由(image/svg+xml,缓存 1 天) - frontend/index.html 添加 并替换登录页 🤖 emoji 为同款内联 SVG Co-Authored-By: CodeBuddy --- diff --git a/backend/app.py b/backend/app.py index cae45d0..f804338 100644 --- a/backend/app.py +++ b/backend/app.py @@ -30,7 +30,7 @@ import zipfile import uvicorn from fastapi import FastAPI, WebSocket, WebSocketDisconnect, Request -from fastapi.responses import HTMLResponse, JSONResponse +from fastapi.responses import HTMLResponse, JSONResponse, Response # JWT from jose import jwt, JWTError @@ -511,6 +511,19 @@ async def index(): return HTMLResponse(load_html(), headers={"Cache-Control": "no-store"}) +# 站点图标(黑白灰终端提示符风格 SVG),供浏览器标签页 / 收藏夹使用 +FAVICON_FILE = FRONTEND_DIR / "favicon.svg" +@app.get("/favicon.svg") +async def favicon(): + if not FAVICON_FILE.exists(): + return Response(status_code=404) + return Response( + FAVICON_FILE.read_text(encoding="utf-8"), + media_type="image/svg+xml", + headers={"Cache-Control": "public, max-age=86400"}, + ) + + # 设计说明 / 帮助页(独立静态 HTML,可从应用内“❓ 帮助”打开,支持打印为 PDF) HELP_FILE = FRONTEND_DIR / "help.html" @app.get("/help") diff --git a/frontend/favicon.svg b/frontend/favicon.svg new file mode 100644 index 0000000..3a0be9a --- /dev/null +++ b/frontend/favicon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/frontend/index.html b/frontend/index.html index b12986a..997c642 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -4,6 +4,7 @@ Codebuddy Web Console +