feat(web): 账号即环境 UI 收敛——删 /browsers 页面,环境并入账号详情

- 删除 /browsers 列表/创建/详情页与菜单项,运行环境不再是独立资源
- 账号详情:GET /api/phase-a/accounts/:id 内联 environment 字段
  (网关/出口/绑定版本/运行实例/不可调度原因),固定资源卡直接展示
- 状态卡两态开关:暂停→「启动账号」(start=resume+启动环境),
  运行中→「暂停账号」(联动停环境);出口重绑卡片内完成
  (POST /network-exits/:id/rebind 返回内联 environment,出口切换不再跳环境页)
- 删除 creator/settings 残留的转写服务字段(后端 settings 无此列)
- helpers.ts accountReadiness 改用 runtime_id/runtime_cleanup_pending
- network-exits 列表绑定账号列改由账号列表内联数据驱动
- 全量验证:go test ./...(PG)全绿、tsc --noEmit 通过、max build 通过、
  node --test 12/12 通过
This commit is contained in:
2026-09-28 20:30:23 +08:00
parent bcc33fe497
commit 7dea052e55
13 changed files with 175 additions and 643 deletions
+2 -2
View File
@@ -77,14 +77,14 @@ export function accountReadiness(account: any, binding: any, bindingError: any =
if (bindingError) return { label: '环境状态未知', reason: 'environment_unavailable', canResume: false, ready: false };
if (!binding) return { label: '未绑定运行环境', reason: 'binding_missing', canResume: false, ready: false };
let blocked = '';
if (binding.cleanup_pending) {
if (binding.runtime_cleanup_pending) {
blocked = 'runtime_stop_pending';
} else if (binding.network_exit_id && binding.network_exit_health !== 'healthy') {
blocked = 'network_exit_unhealthy';
}
if (blocked) return { label: readinessReasonText[blocked], reason: blocked, canResume: false, ready: false };
if (account.runtime_status === 'paused') {
const stopped = !binding.runtime_instance_id;
const stopped = !binding.runtime_id;
return { label: stopped ? '资源就绪,可恢复' : '等待运行环境停止', reason: stopped ? '' : 'runtime_stop_pending', canResume: stopped, ready: false };
}
const schedule = binding.schedule_block_reason || '';
-5
View File
@@ -7,7 +7,6 @@ import {
CommentOutlined,
SettingOutlined,
ProfileOutlined,
LaptopOutlined,
ClusterOutlined,
GatewayOutlined,
DashboardOutlined,
@@ -26,9 +25,6 @@ const rules: Array<{ test: (path: string) => boolean; title: string; subtitle: s
{ test: (p) => p === '/creator/competitors', title: '竞品分析', subtitle: '查看竞品作品与指标,分享链接导入请前往账号导入。' },
{ test: (p) => p === '/creator/settings', title: '采集设置', subtitle: '统一配置采集窗口、指标采集和已批准的服务。' },
{ test: (p) => p.startsWith('/creator/competitors/'), title: '竞品账号详情', subtitle: '查看竞品画像与作品列表,点击作品可追溯指标统计。' },
{ test: (p) => p === '/browsers', title: '运行环境', subtitle: '启动、停止并回收隔离的指纹浏览器运行环境。' },
{ test: (p) => p === '/browsers/new', title: '创建运行环境', subtitle: '为已授权且暂停的账号绑定网关、指纹与网络出口。' },
{ test: (p) => p.startsWith('/browsers/'), title: '运行环境详情', subtitle: '查看环境状态、账号绑定和运行实例信息。' },
{ test: (p) => p === '/network-exits', title: '网络出口', subtitle: '维护固定出口、健康观测与账号绑定。' },
{ test: (p) => p.startsWith('/network-exits/'), title: '网络出口详情', subtitle: '查看出口配置、健康状态和绑定关系。' },
{ test: (p) => p === '/gateways', title: '网关管理', subtitle: '注册并检查宿主机 native browser gateway。' },
@@ -51,7 +47,6 @@ export const menu: MenuDataItem[] = [
{
name: '资源',
children: [
{ path: '/browsers', name: '运行环境', icon: <LaptopOutlined /> },
{ path: '/network-exits', name: '网络出口', icon: <ClusterOutlined /> },
{ path: '/gateways', name: '网关管理', icon: <GatewayOutlined /> },
],