import { Card, CardContent, CardHeader, CardTitle, CardDescription } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Switch } from "@/components/ui/switch"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { Lock, Key, Loader2 } from "lucide-react"; import { useTranslation } from "react-i18next"; import { useUserStore } from "@/store"; import type { SystemSettingsTabProps } from "../SystemSettingsTab"; // 安全设置 Tab:安全策略 + 会话设置(水印/录制/剪贴板/上传/下载/命令策略/审批/超时/SSO) // Logan.Li type SecuritySettingsTabProps = Pick< SystemSettingsTabProps, | "sessionWatermarkEnabled" | "setSessionWatermarkEnabled" | "sessionRecordEnabled" | "setSessionRecordEnabled" | "clipboardEnabled" | "setClipboardEnabled" | "fileUploadEnabled" | "setFileUploadEnabled" | "fileDownloadEnabled" | "setFileDownloadEnabled" | "commandPolicyEnabled" | "setCommandPolicyEnabled" | "approvalRequired" | "setApprovalRequired" | "auditLoading" | "auditApplying" | "handleAuditApply" >; export function SecuritySettingsTab(props: SecuritySettingsTabProps) { const { t } = useTranslation(); const currentUsername = useUserStore( (state) => state.user?.username || "admin", ); const { sessionWatermarkEnabled, setSessionWatermarkEnabled, sessionRecordEnabled, setSessionRecordEnabled, clipboardEnabled, setClipboardEnabled, fileUploadEnabled, setFileUploadEnabled, fileDownloadEnabled, setFileDownloadEnabled, commandPolicyEnabled, setCommandPolicyEnabled, approvalRequired, setApprovalRequired, auditLoading, auditApplying, handleAuditApply, } = props; return (
{t("system.security")} {t("system.securityDesc")}

{t("system.forcePasswordComplexity")}

{t("system.forcePasswordComplexityDesc")}

{t("system.loginLockout")}

{t("system.loginLockoutDesc")}

{t("system.twoFactor")}

{t("system.twoFactorDesc")}

{t("system.sessionSettings")} {t("system.sessionSettingsDesc")}

{t("system.sessionWatermark")}

{t("system.sessionWatermarkDesc", { user: currentUsername, })}

{currentUsername} {currentUsername} {currentUsername} {currentUsername}

{t("system.sessionRecordEnabled")}

{t("system.sessionRecordEnabledDesc")}

{t("system.clipboardEnabled")}

{t("system.clipboardEnabledDesc")}

{t("system.fileUploadEnabled")}

{t("system.fileUploadEnabledDesc")}

{t("system.fileDownloadEnabled")}

{t("system.fileDownloadEnabledDesc")}

{t("system.commandPolicyEnabled")}

{t("system.commandPolicyEnabledDesc")}

{t("system.approvalRequired")}

{t("system.approvalRequiredDesc")}

{t("system.sessionTimeoutTime")}

{t("system.sessionTimeoutDesc")}

{t("system.sso")}

{t("system.singleSignOnDesc")}

); }