]> acesimba.cloud Git - codebuddy-web.git/commitdiff
feat: 新增黑白灰终端风格站点图标(favicon + 登录页 logo)
authorCodebuddy <codebuddy@localhost>
Thu, 27 Aug 2026 02:56:15 +0000 (10:56 +0800)
committerCodebuddy <codebuddy@localhost>
Thu, 27 Aug 2026 02:56:15 +0000 (10:56 +0800)
- 新增 frontend/favicon.svg:圆角方块 + 白色 > 提示符 + 灰色光标,黑/白/灰极简设计
- 后端新增 /favicon.svg 路由(image/svg+xml,缓存 1 天)
- frontend/index.html 添加 <link rel="icon"> 并替换登录页 🤖 emoji 为同款内联 SVG

Co-Authored-By: CodeBuddy <noreply@codebuddy.ai>
backend/app.py
frontend/favicon.svg [new file with mode: 0644]
frontend/index.html

index cae45d079965d77b4e562b7a3c0ff6de7b4c3803..f804338f6ce241955ad52c83e2f471d664ce85ff 100644 (file)
@@ -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 (file)
index 0000000..3a0be9a
--- /dev/null
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="none">
+  <rect width="100" height="100" rx="20" fill="#18181b"/>
+  <rect x="1.5" y="1.5" width="97" height="97" rx="18.5" stroke="#3f3f46" stroke-width="3"/>
+  <path d="M30 38L46 50L30 62" stroke="#f4f4f5" stroke-width="7" stroke-linecap="round" stroke-linejoin="round"/>
+  <rect x="54" y="56" width="18" height="6" rx="1.5" fill="#a1a1aa"/>
+</svg>
index b12986aab38c7860e65db15c53136f27799ae286..997c6421a7b5958ddc4973b02207c54f4091170c 100644 (file)
@@ -4,6 +4,7 @@
 <meta charset="UTF-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover">
 <title>Codebuddy Web Console</title>
+<link rel="icon" type="image/svg+xml" href="/favicon.svg">
 <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/xterm@5.3.0/css/xterm.css">
 <style>
 * { margin: 0; padding: 0; box-sizing: border-box; }
@@ -234,7 +235,14 @@ body { position: fixed; top: 0; left: 0; right: 0; bottom: 0; width: 100%; heigh
 <!-- 登录页 -->
 <div id="login-page">
   <div class="login-card">
-    <div class="logo">🤖</div>
+    <div class="logo">
+      <svg width="56" height="56" viewBox="0 0 100 100" fill="none" xmlns="http://www.w3.org/2000/svg">
+        <rect width="100" height="100" rx="20" fill="#18181b"/>
+        <rect x="1.5" y="1.5" width="97" height="97" rx="18.5" stroke="#3f3f46" stroke-width="3"/>
+        <path d="M30 38L46 50L30 62" stroke="#f4f4f5" stroke-width="7" stroke-linecap="round" stroke-linejoin="round"/>
+        <rect x="54" y="56" width="18" height="6" rx="1.5" fill="#a1a1aa"/>
+      </svg>
+    </div>
     <h1>Codebuddy Console</h1>
     <p class="subtitle">AI 编程助手 · 多任务远程控制台</p>
     <input type="password" id="password-input" class="login-input" placeholder="输入访问密码" autofocus>