From 86276b2ffd262f3cac60b51b02f00d1a62741c5d Mon Sep 17 00:00:00 2001 From: dengqichen Date: Fri, 5 Dec 2025 18:02:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0SSH=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../List/components/SSHTerminalContent.tsx | 10 +++- .../List/components/SSHWindowManager.tsx | 60 +++++++++++-------- 2 files changed, 42 insertions(+), 28 deletions(-) diff --git a/frontend/src/pages/Resource/Server/List/components/SSHTerminalContent.tsx b/frontend/src/pages/Resource/Server/List/components/SSHTerminalContent.tsx index 3748545b..b7b41b2a 100644 --- a/frontend/src/pages/Resource/Server/List/components/SSHTerminalContent.tsx +++ b/frontend/src/pages/Resource/Server/List/components/SSHTerminalContent.tsx @@ -254,8 +254,6 @@ export const SSHTerminalContent: React.FC = ({ ws.onopen = () => { console.log('🔗 WebSocket已连接:', wsUrl); console.log('📺 Terminal实例存在:', !!terminalInstanceRef.current); - terminalInstanceRef.current?.writeln('\x1b[32m✓ WebSocket连接已建立\x1b[0m'); - terminalInstanceRef.current?.writeln('\x1b[36m正在建立SSH会话...\x1b[0m\r\n'); }; ws.onmessage = (event) => { @@ -287,7 +285,13 @@ export const SSHTerminalContent: React.FC = ({ if (msg.status) { setConnectionStatus(msg.status); if (msg.status === 'connected') { - terminalInstanceRef.current?.writeln('\x1b[32m✓ SSH会话已建立\x1b[0m\r\n'); + // 显示审计警告 + terminalInstanceRef.current?.writeln('\r\n\x1b[33m┌────────────────────────────────────────────────────────────┐\x1b[0m'); + terminalInstanceRef.current?.writeln('\x1b[33m│ ⚠️ 安全提示:本次SSH会话将被全程审计记录 │\x1b[0m'); + terminalInstanceRef.current?.writeln('\x1b[33m│ • 所有操作命令、输入、输出都将被完整记录 │\x1b[0m'); + terminalInstanceRef.current?.writeln('\x1b[33m│ • 审计日志用于安全审查、故障排查和合规要求 │\x1b[0m'); + terminalInstanceRef.current?.writeln('\x1b[33m│ • 请规范操作,遵守企业信息安全管理制度 │\x1b[0m'); + terminalInstanceRef.current?.writeln('\x1b[33m└────────────────────────────────────────────────────────────┘\x1b[0m\r\n'); setTimeout(() => { fitAddonRef.current?.fit(); }, 100); diff --git a/frontend/src/pages/Resource/Server/List/components/SSHWindowManager.tsx b/frontend/src/pages/Resource/Server/List/components/SSHWindowManager.tsx index 391cb909..3b1cdcbc 100644 --- a/frontend/src/pages/Resource/Server/List/components/SSHWindowManager.tsx +++ b/frontend/src/pages/Resource/Server/List/components/SSHWindowManager.tsx @@ -176,33 +176,43 @@ export const SSHWindowManager: React.FC = ({ onOpenWindow
{windows .filter(w => w.isMinimized) - .map((window) => ( - - ))} + + ); + })}
)}