diff --git a/docs/specs/SDD-005-console-navigation.md b/docs/specs/SDD-005-console-navigation.md new file mode 100644 index 0000000..4bb38f3 --- /dev/null +++ b/docs/specs/SDD-005-console-navigation.md @@ -0,0 +1,31 @@ +# SDD-005:管理导航与设置页分区 + +| 字段 | 内容 | +|---|---| +| 级别 | S2(跨页面导航与 URL 状态) | +| 状态 | 已实现,待上线验证 | +| 参考 | opsx-sec 的固定侧栏、移动抽屉与设置标签页;保留 opsx-vpn 的现有路由和权限 | + +## 现状与选择 + +原 `Layout.vue` 固定 220px 侧栏,移动端无抽屉;用户/设备散列在多个标题下,`/ipsec-peer` 有页面但无导航入口。原 `Settings.vue` 把密码、MFA、服务器环境、域名证书拼为左右长列,难以定位。仅更改导航信息结构与呈现,不改业务 API 或角色权限。 + +- 工作台:总览独立;线路运维:专线列表、在线会话、日志中心,IPSec 第三方对接为该组的专业入口。 +- 身份与设备(仅管理员):VPN 拨号用户、客户端设备、后台用户。身份对象不同,保留各自独立页面,不将账号表合并。 +- 系统:系统设置独立入口。设置内分个人安全、管理员公网入口、管理员服务器环境。日志中心保留独立页面,不重复出现在设置。 +- `/settings?tab=security|gateway|host` 标记当前标签,可复制链接;普通用户及非法标签一律回到个人安全。右上角修改密码弹窗保留。 +- 桌面侧栏可折叠,中屏自动窄栏,手机使用菜单按钮和可关闭的遮罩。页面切换关闭手机抽屉;导航项和按钮具备键盘焦点与可读名称。 + +## 风险、发布与验收 + +路由路径不变,旧书签可继续访问。管理员专属菜单仅影响可见性,现有路由守卫仍负责权限校验。浏览器刷新标签时根据查询参数恢复;首次进入只加载原有配置接口,不触发系统更改。回退仅需恢复前端版本,无数据迁移。 + +| 验收 | 预期 | +|---|---| +| 桌面与手机导航 | 选中状态正确,创建/编辑专线仍高亮专线,折叠与遮罩可操作 | +| 角色隔离 | viewer/operator 不出现后台用户及管理员设置标签;直接访问后台路由继续被守卫拦截 | +| 设置链接 | 刷新与分享 `?tab=gateway` 保持标签,非法标签与非管理员回到个人安全 | +| 功能完整 | 密码/MFA、域名/证书、通用环境和部署说明都保留,专线/日志/IPSec 入口可达 | +| 检查 | 前端构建、主要路由和页面烟测通过;不改后端契约 | + +前端构建与差异检查已通过。页面交互和发布后的线上烟测需在部署后另行核验。 diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json index 756f3fc..8a75ee2 100644 --- a/frontend/src/locales/en-US.json +++ b/frontend/src/locales/en-US.json @@ -566,6 +566,8 @@ "noAlerts": "No traffic alerts" }, "settings": { + "pageDescription": "Manage account security, the public gateway, and server setup.", + "securityTab": "Account Security", "gatewayTab": "Public Gateway", "hostTab": "Server Setup", "mustChangePassword": "First login or password has been reset by admin. You must change your password before using other features.", "changePassword": "Change Password", "oldPassword": "Current Password", @@ -747,8 +749,11 @@ "logs": "Log Center", "notFound": "Page Not Found", "sidebarOps": "Tunnel Ops", - "sidebarResource": "Resource Mgmt", - "sidebarSystem": "System" + "sidebarResource": "Identity & Devices", + "sidebarSystem": "System", + "sidebarWorkspace": "Workspace", "console": "Admin Console", + "navigation": "Main navigation", "openNavigation": "Open navigation", "closeNavigation": "Close navigation", + "collapseNavigation": "Collapse sidebar", "expandNavigation": "Expand sidebar" }, "protocolIcon": { "custom": "Custom Protocol" diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json index 7bd4e94..3570fc7 100644 --- a/frontend/src/locales/zh-CN.json +++ b/frontend/src/locales/zh-CN.json @@ -566,6 +566,8 @@ "noAlerts": "暂无流量告警" }, "settings": { + "pageDescription": "管理个人安全、公网认证入口与服务器环境。", + "securityTab": "个人安全", "gatewayTab": "公网入口", "hostTab": "服务器环境", "mustChangePassword": "首次登录或密码已被管理员重置,必须修改密码后才能使用其他功能", "changePassword": "修改密码", "oldPassword": "原密码", @@ -747,8 +749,11 @@ "logs": "日志中心", "notFound": "页面不存在", "sidebarOps": "专线运维", - "sidebarResource": "资源管理", - "sidebarSystem": "系统" + "sidebarResource": "身份与设备", + "sidebarSystem": "系统", + "sidebarWorkspace": "工作台", "console": "管理控制台", + "navigation": "主导航", "openNavigation": "打开导航", "closeNavigation": "关闭导航", + "collapseNavigation": "收起侧栏", "expandNavigation": "展开侧栏" }, "protocolIcon": { "custom": "自定义协议" diff --git a/frontend/src/views/Layout.vue b/frontend/src/views/Layout.vue index fd452e8..6f0d843 100644 --- a/frontend/src/views/Layout.vue +++ b/frontend/src/views/Layout.vue @@ -1,32 +1,45 @@ diff --git a/frontend/src/views/Settings.vue b/frontend/src/views/Settings.vue index f55c7f2..7e0f58a 100644 --- a/frontend/src/views/Settings.vue +++ b/frontend/src/views/Settings.vue @@ -1,6 +1,11 @@ - - - - {{ $t('router.logs') }} - + + + +
+ + + + + {{ $t('tls.refresh') }} - + + + + {{ $t('settings.deliveryDesc') }} + {{ $t('settings.dataDirDesc') }} + {{ $t('settings.listenAddrDesc') }} + {{ $t('settings.keyStorageDesc') }} + {{ $t('settings.systemDepsDesc') }} + {{ $t('settings.prodSuggestionDesc') }} + + +
+
+ {{ $t('settings.savedConfirm') }} - +