统一使用 public logo 资源

- 登录页、侧栏和 favicon 统一引用 public/logo.png 暴露的 /logo.png。

- 删除根目录 logo_square.png 和 Express 中单独提供该文件的路由。

- 同步更新组件测试、项目文档和历史工程分析说明,避免继续引用旧 logo_square。

- 同步整理 ../Seg_Server_Docker 部署包,仅保留 public/logo.png 并更新前端 Docker 构建配置。
This commit is contained in:
2026-05-07 15:51:45 +08:00
parent d583b32221
commit 6f4d4efeaf
14 changed files with 16 additions and 21 deletions

View File

@@ -56,9 +56,8 @@ Seg_Server/
├── package.json # npm 依赖与脚本
├── .env.example # AI Studio/Gemini 前端环境变量模板
├── metadata.json # AI Studio 元数据
├── logo_square.png # 登录页、Sidebar 与 favicon 使用的根目录方形 Logo
├── public/
│ └── logo.png # 旧版保留 Logo 静态资源
│ └── logo.png # 登录页、Sidebar 与 favicon 使用的 Logo
├── doc/ # 当前实现审计、接口契约和后续实施文档
├── start_services.sh # 本地一键启动 PostgreSQL/Redis/MinIO/FastAPI/Celery/前端
├── restart_dev_services.sh # 本地开发重启脚本;重启 FastAPI/Celery/前端并检查 3000/8000

View File

@@ -139,9 +139,8 @@ Seg_Server/
├── uploads/ # 临时上传目录
├── frames/ # 临时帧目录
├── doc/ # 当前实现审计、接口契约与后续实施文档
├── logo_square.png # 侧边栏与 favicon 使用的根目录方形 Logo
├── public/
│ └── logo.png # 旧版保留 Logo 静态资源
│ └── logo.png # 登录页、侧边栏与 favicon 使用的 Logo
├── start_services.sh # 一键启动所有服务脚本
├── server.ts # Express + Vite 前端入口(不再提供旧版 mock API
├── index.html # SPA HTML 入口

View File

@@ -13,7 +13,7 @@
|------|------|------|------|
| 登录拦截 | `App.tsx` | 真实可用 | 未登录显示 `Login`,登录后显示主界面 |
| 模块切换 | `Sidebar.tsx` + `App.tsx` | 真实可用 | 切换 `dashboard/projects/workspace/ai/templates`“AI智能分割”入口使用 Bot + Sparkles 组合图标,强化 AI 语义 |
| Logo | `Login.tsx` / `Sidebar.tsx` | 真实可用 | 登录页侧边栏都使用根目录 `logo_square.png`favicon 使用 `/logo_square.png`,前端服务会从项目根目录提供该文件 |
| Logo | `Login.tsx` / `Sidebar.tsx` | 真实可用 | 登录页侧边栏和 favicon 都使用 `public/logo.png`,运行时访问路径为 `/logo.png` |
| GPU 状态圆标 | `Sidebar.tsx` | 真实可用 | 通过 `GET /api/ai/models/status` 显示 GPU/CPU 和当前模型可用性 |
## 登录页

View File

@@ -24,7 +24,7 @@
| 配置 | `src/lib/config.ts` | 推导 API 和 WebSocket 地址 |
| WebSocket | `src/lib/websocket.ts` | 进度流连接、订阅、连接状态通知、心跳和重连 |
| 模型状态 | `src/components/ModelStatusBadge.tsx` | 展示 GPU 与当前 SAM 模型真实可用状态;左侧 Sidebar 底部使用 compact 形态显示 GPU/CPU 状态,工作区顶栏不再重复显示,具体传播权重只在进入自动传播后由顶栏下拉负责 |
| 登录页 | `src/components/Login.tsx` | 使用根目录 `logo_square.png` 和系统标题文案,调用登录 API写入 store |
| 登录页 | `src/components/Login.tsx` | 使用 `public/logo.png` 和系统标题文案,调用登录 API写入 store |
| Dashboard | `src/components/Dashboard.tsx` | 展示统计、任务控制、失败详情和 WebSocket 进度消息 |
| 项目库 | `src/components/ProjectLibrary.tsx` | 项目列表、新建、重命名、删除、导入视频/DICOM、显式生成帧 |
| 工作区 | `src/components/VideoWorkspace.tsx` | 加载帧和模板组织工具栏、Canvas、本体面板、时间轴 |

View File

@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="/logo_square.png" />
<link rel="icon" type="image/png" href="/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>语义分割系统 SegServer</title>
</head>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

View File

@@ -7,9 +7,6 @@ async function startServer() {
const PORT = 3000;
app.use(express.json());
app.get("/logo_square.png", (_req, res) => {
res.sendFile(path.join(process.cwd(), "logo_square.png"));
});
// Vite middleware for development
if (process.env.NODE_ENV !== "production") {

View File

@@ -55,7 +55,7 @@ describe('Login', () => {
it('uses the product logo and updated system title copy', () => {
render(<Login />);
expect(screen.getByAltText('Logo')).toHaveAttribute('src', expect.stringContaining('logo_square'));
expect(screen.getByAltText('Logo')).toHaveAttribute('src', expect.stringContaining('logo.png'));
expect(screen.getByText('多模态影像及视频智能语义分割与标注系统')).toBeInTheDocument();
expect(screen.getByText('智能语义分割系统')).toBeInTheDocument();
expect(screen.queryByText('欢迎登录协同工作站')).not.toBeInTheDocument();

View File

@@ -33,7 +33,7 @@ export function Login() {
<div className="relative z-10 w-full max-w-md p-8 bg-[#111] border border-white/5 rounded-2xl shadow-2xl scale-in shadow-black/50">
<div className="flex flex-col items-center mb-8">
<div className="w-16 h-16 bg-white rounded-2xl flex items-center justify-center text-cyan-500 shadow-lg shadow-cyan-500/20 mb-4 overflow-hidden border border-white/10">
<img src="/logo_square.png" alt="Logo" className="h-full w-full object-contain" />
<img src="/logo.png" alt="Logo" className="h-full w-full object-contain" />
</div>
<h1 className="text-center text-2xl font-bold text-white tracking-wider mb-2"></h1>
<p className="text-sm text-gray-500"></p>

View File

@@ -41,10 +41,10 @@ describe('Sidebar', () => {
expect(screen.getByTitle('AI智能分割').querySelector('[data-testid="ai-segmentation-icon"]')).toBeInTheDocument();
});
it('uses the root logo_square asset for the sidebar logo', () => {
it('uses the public logo asset for the sidebar logo', () => {
render(<Sidebar activeModule="dashboard" setActiveModule={vi.fn()} />);
expect(screen.getByAltText('Logo')).toHaveAttribute('src', expect.stringContaining('logo_square'));
expect(screen.getByAltText('Logo')).toHaveAttribute('src', expect.stringContaining('logo.png'));
});
it('uses a logout icon and prevents the logout tooltip from catching workspace hover', () => {

View File

@@ -26,7 +26,7 @@ export function Sidebar({ activeModule, setActiveModule }: SidebarProps) {
return (
<aside className="w-16 flex flex-col items-center py-6 bg-[#0d0d0d] border-r border-white/10 z-50 gap-8">
<div className="w-10 h-10 rounded-lg overflow-hidden flex items-center justify-center bg-white">
<img src="/logo_square.png" alt="Logo" className="h-full w-full object-contain" />
<img src="/logo.png" alt="Logo" className="h-full w-full object-contain" />
</div>
<nav className="flex flex-col gap-6 w-full px-2">
{navItems.map((item) => {

View File

@@ -9,7 +9,7 @@
## 修改文件清单
### 文件 1: 创建 `public/` 目录并放入 logo
- **操作**: `mkdir public && cp logo_square.png public/logo.png`
- **操作**: 将系统 logo 放入 `public/logo.png`
- **说明**: Vite 自动将 `public/` 下文件暴露到根 URL
### 文件 2: `src/components/Sidebar.tsx`(修改)

View File

@@ -282,13 +282,13 @@ AI 助手运行的容器/环境与项目实际开发环境分离,后者才装
2. 浏览器控制台报 `favicon.ico 404`
### B. 产生原因
1. `logo_square.png` 位于项目根目录,但 Vite 不会自动将根目录文件暴露为静态资源
2. 前端代码引用路径为 `/Logo.png`(首字母大写),与实际文件名 `logo_square.png` 不匹配
1. 早期 logo 位于项目根目录,但 Vite 不会自动将根目录文件暴露为静态资源
2. 前端代码引用路径为 `/Logo.png`(首字母大写),与实际静态资源路径不匹配
3. `index.html` 无 favicon 声明,浏览器默认请求 `/favicon.ico`
### C. 解决方案
1. 创建 `public/` 目录Vite 原生支持,自动暴露到根 URL
2. `logo_square.png` 复制`public/logo.png`
2.系统 logo 统一放入并引用`public/logo.png`
3. `Sidebar.tsx` 引用路径改为 `/logo.png`
4. `index.html` 添加 `<link rel="icon" type="image/png" href="/logo.png" />`

View File

@@ -5,13 +5,13 @@
- 需求类型: 缺陷修复 + 资源部署
## 原始需求描述
1.@logo_square.png 移动到特定位置,作为系统 logo
1. 将 logo 静态资源移动到 `public/logo.png`,作为系统 logo
2. 解决 `Failed to load resource: the server responded with a status of 404 (Not Found) 3000/favicon.ico:1`
## 需求拆解
### 需求 1: 部署 logo 静态资源
- **详细描述**: logo_square.png 位于项目根目录,但前端 Sidebar.tsx 引用的是 `/Logo.png`,且 Vite 项目缺少 `public/` 目录导致静态文件无法暴露到根路径
- **详细描述**: 早期 logo 位于项目根目录,但前端 Sidebar.tsx 引用的是 `/Logo.png`,且 Vite 项目缺少 `public/` 目录导致静态文件无法暴露到根路径;当前项目已统一使用 `public/logo.png`
- **优先级**: P0-阻塞
- **影响范围**: `public/` 目录创建、`Sidebar.tsx`
- **验收标准**: 浏览器可正常加载 logoSidebar 正确显示