分享链接解析任务
diff --git a/web/src/pages/browsers/index.tsx b/web/src/pages/browsers/index.tsx
index 454f677..20b767e 100644
--- a/web/src/pages/browsers/index.tsx
+++ b/web/src/pages/browsers/index.tsx
@@ -6,6 +6,7 @@ import { Alert, Button, Card, Popconfirm, Space, Table, Tag, Typography, message
import { CopyOutlined, PlusOutlined } from '@ant-design/icons';
import type { ColumnsType } from 'antd/es/table';
import { browserAction, getList } from '@/services/api';
+import { usePageActions } from '@/components/PageActions';
const stateText: Record
= {
created: '已创建',
@@ -159,15 +160,15 @@ export default function Page() {
},
];
+ usePageActions(
+ } onClick={() => history.push('/browsers/new')}>
+ 创建环境
+ ,
+ );
+
return (
{contextHolder}
-
- 启动、停止并回收隔离的指纹浏览器运行环境
- } onClick={() => history.push('/browsers/new')}>
- 创建环境
-
-
{error ? (
重试} />
) : null}
diff --git a/web/src/pages/creator/workbench/index.tsx b/web/src/pages/creator/workbench/index.tsx
index ec34307..0ff3034 100644
--- a/web/src/pages/creator/workbench/index.tsx
+++ b/web/src/pages/creator/workbench/index.tsx
@@ -990,7 +990,7 @@ export default function Page() {
];
const operationsTab = (
-
+ <>
-
+ >
);
return (
-
+
{contextHolder}
当前私信文案尚未发送,放弃后再切换吗?
-
+
);
}
diff --git a/web/src/pages/dashboard/index.tsx b/web/src/pages/dashboard/index.tsx
index 5830b5b..fdd03b9 100644
--- a/web/src/pages/dashboard/index.tsx
+++ b/web/src/pages/dashboard/index.tsx
@@ -1,11 +1,12 @@
// 工作台:对标 pro 官方 workplace 预览的占位页。
// 统计卡片与快捷入口暂不接真实数据(后期规划),仅布局占位;不引入兜底数据。
-import { PageContainer } from '@ant-design/pro-components';
import { Card, Col, Empty, Row, Typography } from 'antd';
+// 统计卡片与快捷入口暂不接真实数据(后期规划),仅布局占位;不引入兜底数据。
+// 页面标题由全局布局的 PageContainer 提供,这里只渲染内容区。
export default function Page() {
return (
-
+ <>
@@ -28,6 +29,6 @@ export default function Page() {
>
-
+ >
);
}
diff --git a/web/src/pages/gateways/index.tsx b/web/src/pages/gateways/index.tsx
index a325209..47f98ab 100644
--- a/web/src/pages/gateways/index.tsx
+++ b/web/src/pages/gateways/index.tsx
@@ -5,6 +5,7 @@ import { CopyOutlined, EyeInvisibleOutlined, EyeOutlined, PlusOutlined } from '@
import type { ColumnsType } from 'antd/es/table';
import { create, getList, remove, update } from '@/services/api';
import { conflictMessage } from '@/utils/helpers';
+import { usePageActions } from '@/components/PageActions';
const namePattern = /^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/;
const tokenPattern = /^[A-Za-z0-9][A-Za-z0-9._-]{15,127}$/;
@@ -169,15 +170,15 @@ export default function Page() {
},
];
+ usePageActions(
+ } onClick={() => setCreateOpen(true)}>
+ 注册网关
+ ,
+ );
+
return (
{contextHolder}
-
- 注册宿主机 native browser gateway;令牌须与 gateway 进程的 GATEWAY_TOKEN 一致
- } onClick={() => setCreateOpen(true)}>
- 注册网关
-
-
{created ? (
= {
unchecked: '未检测',
@@ -277,15 +278,15 @@ export default function Page() {
},
];
+ usePageActions(
+ } onClick={() => setCreateOpen(true)}>
+ 创建网络出口
+ ,
+ );
+
return (
{contextHolder}
-
- 维护固定出口、健康观测与账号绑定
- } onClick={() => setCreateOpen(true)}>
- 创建网络出口
-
-
{error ? (
重试} />
) : null}
diff --git a/web/src/utils/metadata.tsx b/web/src/utils/metadata.tsx
index 0e75f31..653b4ef 100644
--- a/web/src/utils/metadata.tsx
+++ b/web/src/utils/metadata.tsx
@@ -74,3 +74,17 @@ export function pageMetadata(pathname: string): { title: string; subtitle: strin
}
return { title: 'CreatorHub', subtitle: '运营控制台' };
}
+
+export function menuSelectedKey(pathname: string): string {
+ const leafPaths = menu.flatMap((group) => (group.children ?? []).map((item) => item.path ?? ''));
+ const segments = pathname.split('/').filter(Boolean);
+ for (let i = segments.length; i >= 1; i--) {
+ const candidate = `/${segments.slice(0, i).join('/')}`;
+ if (leafPaths.includes(candidate)) return candidate;
+ }
+ return pathname;
+}
+
+// 侧栏选中态:ProLayout 默认按路径前缀高亮(/accounts 是 /accounts/import 的前缀,两项会同时高亮)。
+// 这里改为受控 selectedKeys:从完整路径逐段向前回退,仅精确命中菜单叶路径;
+// 详情页(如 /accounts/123、/accounts/new)回落到父级菜单项。