import { getStoredRole } from "../../lib/api"; import { KeyValueRow, Notice, PageHeader } from "../components"; import { Surface, Tag } from "../../components/primitives"; import { Icon } from "../../components/Icon"; /** * 系统设置 (design/10)。后端 M10+ 才提供真实的密钥轮换/备份/环境变量写入等 * 系统级操作;在此之前只呈现**诚实的只读配置事实**,并把尚未实现的操作合并成 * 一条「未实现」说明——不做满屏点击后 `alert` 的占位按钮。 */ export function SystemModule(): React.ReactNode { const isOwner = getStoredRole() === "owner"; return (
} title="安全 & 密钥" ownerOnly /> } title="存储" /> } title="环境变量" /> } title="运行时" />
以下系统操作后端暂未实现(M10+ 落地),当前不可用:轮换 JWT 密钥 · 吊销全部 API key · 备份/恢复 · 编辑环境变量 · 重启服务 · 检查更新。均为真实读写,未实现前不做占位。 {!isOwner ? 安全 / 密钥 / 系统设置类敏感操作仅 owner 可执行;当前角色 {getStoredRole()}。 : null}
); } function SectionTitle({ icon, title, ownerOnly = false }: { icon: React.ReactNode; title: string; ownerOnly?: boolean }): React.ReactNode { return (

{icon} {title} {ownerOnly ? owner : null}

); }