feat: 完善堡垒机与 Agent 智能运维能力
- 支持 Windows Agent 构建、安装脚本和统一上报协议 - 增强 RDP 剪贴板、虚拟盘和文件传输能力 - 新增 AIOps 上下文工具、告警 RCA trace 落库和回放接口 - 重构 docs 模块文档并补充终端、堡垒机、监控、AI Agent 设计
This commit is contained in:
1 parent
a9513c2056
commit
e0d652d211
169 files changed
+12192
-9116
No files matched your search
@@ -0,0 +1,42 @@
|
||||
import { useMemo } from "react";
|
||||
import { useSessionSecurityStore, useUserStore } from "@/store";
|
||||
|
||||
interface SessionWatermarkProps {
|
||||
className?: string;
|
||||
}
|
||||
|
||||
function escapeSvgText(text: string) {
|
||||
return text
|
||||
.replace(/&/g, "&")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/"/g, """);
|
||||
}
|
||||
|
||||
// SessionWatermark 在远程会话画面上叠加当前登录用户,便于截图和录屏追责。 // Logan.Li
|
||||
export function SessionWatermark({ className = "" }: SessionWatermarkProps) {
|
||||
const enabled = useSessionSecurityStore((state) => state.watermarkEnabled);
|
||||
const user = useUserStore((state) => state.user);
|
||||
const username = user?.username || "unknown";
|
||||
|
||||
const backgroundImage = useMemo(() => {
|
||||
const text = escapeSvgText(username);
|
||||
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="260" height="150" viewBox="0 0 260 150"><g transform="rotate(-24 130 75)"><text x="130" y="78" text-anchor="middle" font-family="Menlo, Monaco, Consolas, monospace" font-size="22" font-weight="700" fill="rgba(255,255,255,0.26)">${text}</text></g></svg>`;
|
||||
return `url("data:image/svg+xml;utf8,${encodeURIComponent(svg)}")`;
|
||||
}, [username]);
|
||||
|
||||
if (!enabled || !username) return null;
|
||||
|
||||
return (
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className={`pointer-events-none absolute inset-0 z-10 mix-blend-screen ${className}`}
|
||||
style={{
|
||||
backgroundImage,
|
||||
backgroundRepeat: "repeat",
|
||||
backgroundSize: "260px 150px",
|
||||
opacity: 0.78,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user