feat(rdp): 新增 RDP 远程桌面/SMB/账单同步能力 + 清理编译产物

主要变更:
- RDP 远程桌面:新增 backend/pkg/rdp(RDP 引擎 + credssp/display/rle/trace)、
  backend/controller/rdp*(连接/凭证/文件/会话/实时)、frontend RDP 组件与 API
- Windows SMB 文件传输:backend/pkg/winsmb
- 云账单同步:backend/pkg/billingsync + billing_sync/aliyun_billing,前端账单详情
- Agent CLI Kubernetes 工具:kubernetes_action/get、pod_execute/logs
- 服务器导入助手:server_import_helpers、ImportCredentialSettings
- 国际化与组件重构(cloud/deploy/monitor/server/system 等多模块)
- 清理编译产物二进制:移除 backend/server、backend/agent/bin/aiops-agent-*
- .gitignore:新增 backend/agent/ 与 .cache/(避免 334MB go-build 缓存误入库)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
LoganandClaude committed 2026-07-04 01:50:36 +08:00
1 parent 777d9e4e71
commit 76ec9387f0
202 files changed
+16555 -2543

No files matched your search

@@ -14,7 +14,7 @@ import { Loader2, Maximize2, Minimize2, Monitor, X } from 'lucide-react';
import { cn } from '@/lib/utils';
import { attachTerminalResize, mountXterm } from '@/lib/xterm-utils';
import { useUserStore } from '@/store';
import { useTranslation } from 'react-i18next';
import { TerminalLoadingOverlay } from '@/components/common/TerminalLoadingOverlay';
interface SessionInfo {
session_id: number;
@@ -33,7 +33,6 @@ interface LiveMonitorProps {
}
export function LiveMonitorDialog({ open, onOpenChange, sessionId, sessionInfo }: LiveMonitorProps) {
const { t } = useTranslation();
const containerRef = useRef<HTMLDivElement>(null);
const termRef = useRef<XTerm | null>(null);
const fitRef = useRef<FitAddon | null>(null);
@@ -126,11 +125,11 @@ export function LiveMonitorDialog({ open, onOpenChange, sessionId, sessionInfo }
}
};
ws.onerror = () => setConnectError(t('aiops.wsConnectFailed'));
ws.onerror = () => setConnectError('WebSocket 连接失败');
ws.onclose = (e) => {
if (!didOpen) {
setConnectError(`连接失败 (code=${e.code}): ${e.reason || t('aiops.authOrNetwork')}`);
setConnectError(`连接失败 (code=${e.code}): ${e.reason || '认证失败或网络问题'}`);
}
setConnected(false);
term.writeln('\r\n\x1b[33m[审计监控] 连接已断开\x1b[0m');
@@ -138,7 +137,7 @@ export function LiveMonitorDialog({ open, onOpenChange, sessionId, sessionInfo }
const timeout = setTimeout(() => {
if (!didOpen) {
setConnectError(t('aiops.connectTimeoutActive'));
setConnectError('连接超时 — 请确认已登录且有活跃会话');
ws.close();
}
}, 5000);
@@ -196,14 +195,14 @@ export function LiveMonitorDialog({ open, onOpenChange, sessionId, sessionInfo }
: { maxWidth: '960px', width: '92vw' }
}
>
<DialogTitle className="sr-only">{t('system.terminalLiveMonitor')}</DialogTitle>
<DialogDescription className="sr-only">{t('system.auditWebssh')}</DialogDescription>
<DialogTitle className="sr-only">终端实时监控</DialogTitle>
<DialogDescription className="sr-only">审计在线 WebSSH 会话</DialogDescription>
{/* 工具栏 — 与 TerminalDialog 一致 // Logan.Li */}
<div className="flex items-center justify-between px-4 py-2 border-b border-[var(--dg-border)]">
<div className="flex items-center gap-2 text-sm min-w-0 flex-wrap">
<Monitor className="h-4 w-4 dg-text-green shrink-0" />
<span className="text-[var(--dg-text-primary)] font-medium">{t('system.terminalLiveMonitor')}</span>
<span className="text-[var(--dg-text-primary)] font-medium">终端实时监控</span>
{meta && (
<span className="text-[var(--dg-text-muted)] truncate">
{meta.username} · {meta.server_name} ({meta.server_ip}) · {formatTime(meta.start_time)}
@@ -217,12 +216,12 @@ export function LiveMonitorDialog({ open, onOpenChange, sessionId, sessionInfo }
{!connected && !connectError && (
<Badge variant="outline" className="border-yellow-500/30 dg-text-yellow bg-yellow-500/10 text-xs">
<Loader2 className="h-3 w-3 animate-spin mr-1" />
{t('common.connecting')}
连接中
</Badge>
)}
{connectError && (
<Badge variant="outline" className="border-red-500/30 dg-text-red bg-red-500/10 text-xs">
{t('system.ldapTestFailed')}
连接失败
</Badge>
)}
</div>
@@ -231,7 +230,7 @@ export function LiveMonitorDialog({ open, onOpenChange, sessionId, sessionInfo }
type="button"
onClick={() => setFullscreen(!fullscreen)}
className="p-1.5 rounded hover:bg-[var(--dg-bg-hover)] text-[var(--dg-text-secondary)]"
title={fullscreen ? t('common.exitFullscreen') : t('common.fullscreen')}
title={fullscreen ? '退出全屏' : '全屏'}
>
{fullscreen ? <Minimize2 className="h-4 w-4" /> : <Maximize2 className="h-4 w-4" />}
</button>
@@ -249,12 +248,11 @@ export function LiveMonitorDialog({ open, onOpenChange, sessionId, sessionInfo }
<p className="text-sm dg-text-red px-4 py-2 border-b border-[var(--dg-border)]">{connectError}</p>
)}
<div
ref={containerRef}
className="xterm-terminal-host"
style={{ height: fullscreen ? 'calc(100vh - 49px)' : '520px' }}
/>
<div className="relative bg-[#0a0e14]" style={{ height: fullscreen ? 'calc(100vh - 49px)' : '520px' }}>
<div ref={containerRef} className="xterm-terminal-host h-full" />
<TerminalLoadingOverlay show={!connected && !connectError} label="正在连接监控..." />
</div>
</DialogContent>
</Dialog>
);
}
}