fix: 移除 iframe 浏览器并优化推送页服务器展示

删除内置浏览器前后端;推送页支持卡片/列表切换、点击名称复制与长名称展示。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Nexus Agent
2026-06-12 01:43:51 +08:00
parent 17abd62261
commit 540712500f
19 changed files with 415 additions and 1233 deletions
@@ -0,0 +1,45 @@
# 移除 iframe 内置浏览器
**日期**2026-06-11
**动机**:用户拒绝 iframe 方案,待独立 Worker + Playwright Chromium 重建;先清理现有实现避免误导。
## 变更摘要
删除全局浮动浏览器、侧栏「浏览器」页、`/api/browser/state` 及关联前后端代码。
## 涉及文件
| 文件 | 动作 |
|------|------|
| `frontend/src/components/GlobalBrowserPanel.vue` | 删除 |
| `frontend/src/composables/useGlobalBrowser.ts` | 删除 |
| `frontend/src/pages/BrowserPage.vue` | 删除 |
| `server/api/browser.py` | 删除 |
| `server/utils/browser_ui_state.py` | 删除 |
| `tests/test_browser_ui_state.py` | 删除 |
| `frontend/src/App.vue` | 移除挂载与侧栏入口 |
| `frontend/src/router/index.ts` | 移除 `/browser` |
| `frontend/src/pages/ServersPage.vue` | 「站点」改为新标签打开 |
| `server/main.py` | 注销 browser 路由 |
**保留**`frontend/src/utils/browserUrl.ts`(域名 → https URL,供「站点」外链)
## 迁移 / 重启
- 无需 DB 迁移;`admin_ui_preferences``embedded_browser` 上下文可留空或手动清理
- 需重启 API + 前端构建部署
## 验证
```bash
cd frontend && npm run type-check
pytest tests/ -q --ignore=tests/integration # 或 bash scripts/local_verify.sh
```
- 侧栏无「浏览器」
- `#/browser` 不再存在(404/回仪表盘)
- 服务器列表「站点」在新标签打开 `https://{domain}`
## 后续
服务端远程浏览器见 `docs/design/plans/2026-06-11-browser-worker-server-procurement.md`