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:
1 parent
777d9e4e71
commit
76ec9387f0
202 files changed
+16555
-2543
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import type { ReactNode } from "react"
|
||||
|
||||
import {
|
||||
Empty,
|
||||
EmptyContent,
|
||||
EmptyDescription,
|
||||
EmptyHeader,
|
||||
EmptyMedia,
|
||||
EmptyTitle,
|
||||
} from "@/components/ui/empty"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
type EmptyStateProps = {
|
||||
title: ReactNode
|
||||
description?: ReactNode
|
||||
icon?: ReactNode
|
||||
action?: ReactNode
|
||||
className?: string
|
||||
}
|
||||
|
||||
export function EmptyState({ title, description, icon, action, className }: EmptyStateProps) {
|
||||
return (
|
||||
<Empty className={cn("border border-dashed border-[var(--dg-border)] bg-[var(--dg-bg-secondary)]", className)}>
|
||||
<EmptyHeader>
|
||||
{icon ? <EmptyMedia variant="icon">{icon}</EmptyMedia> : null}
|
||||
<EmptyTitle className="text-[var(--dg-text-primary)]">{title}</EmptyTitle>
|
||||
{description ? <EmptyDescription>{description}</EmptyDescription> : null}
|
||||
</EmptyHeader>
|
||||
{action ? <EmptyContent>{action}</EmptyContent> : null}
|
||||
</Empty>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
import type { ReactNode } from "react"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
type FilterBarProps = {
|
||||
left?: ReactNode
|
||||
right?: ReactNode
|
||||
className?: string
|
||||
}
|
||||
|
||||
export function FilterBar({ left, right, className }: FilterBarProps) {
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"flex flex-col gap-3 rounded-lg border border-[var(--dg-border)] bg-[var(--dg-bg-secondary)] p-3 md:flex-row md:items-center md:justify-between",
|
||||
className,
|
||||
)}
|
||||
>
|
||||
<div className="flex min-w-0 flex-1 flex-wrap items-center gap-2">{left}</div>
|
||||
{right ? <div className="flex shrink-0 flex-wrap items-center gap-2">{right}</div> : null}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
import type { ReactNode } from "react"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
type MetricCardProps = {
|
||||
title: ReactNode
|
||||
value: ReactNode
|
||||
description?: ReactNode
|
||||
icon?: ReactNode
|
||||
trend?: ReactNode
|
||||
className?: string
|
||||
}
|
||||
|
||||
export function MetricCard({ title, value, description, icon, trend, className }: MetricCardProps) {
|
||||
return (
|
||||
<section
|
||||
className={cn(
|
||||
"min-w-0 rounded-lg border border-[var(--dg-border)] bg-[var(--dg-bg-secondary)] p-4 shadow-[var(--shadow-card)]",
|
||||
className,
|
||||
)}
|
||||
>
|
||||
<div className="flex items-start justify-between gap-3">
|
||||
<div className="min-w-0 space-y-1">
|
||||
<div className="truncate text-sm text-[var(--dg-text-secondary)]">{title}</div>
|
||||
<div className="truncate text-2xl font-semibold tracking-normal text-[var(--dg-text-primary)]">{value}</div>
|
||||
</div>
|
||||
{icon ? (
|
||||
<div className="flex size-9 shrink-0 items-center justify-center rounded-md bg-[var(--dg-bg-tertiary)] text-[var(--dg-text-secondary)]">
|
||||
{icon}
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
{(description || trend) ? (
|
||||
<div className="mt-3 flex min-w-0 flex-wrap items-center gap-2 text-xs text-[var(--dg-text-muted)]">
|
||||
{trend ? <span className="shrink-0">{trend}</span> : null}
|
||||
{description ? <span className="truncate">{description}</span> : null}
|
||||
</div>
|
||||
) : null}
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
import type { ReactNode } from "react"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
type PageShellProps = {
|
||||
children: ReactNode
|
||||
className?: string
|
||||
}
|
||||
|
||||
type PageHeaderProps = {
|
||||
title: ReactNode
|
||||
description?: ReactNode
|
||||
actions?: ReactNode
|
||||
className?: string
|
||||
}
|
||||
|
||||
type PageSectionProps = {
|
||||
children: ReactNode
|
||||
title?: ReactNode
|
||||
description?: ReactNode
|
||||
actions?: ReactNode
|
||||
className?: string
|
||||
contentClassName?: string
|
||||
}
|
||||
|
||||
export function PageShell({ children, className }: PageShellProps) {
|
||||
return (
|
||||
<main className={cn("flex min-h-0 w-full flex-col gap-4 p-4 md:p-6", className)}>
|
||||
{children}
|
||||
</main>
|
||||
)
|
||||
}
|
||||
|
||||
export function PageHeader({ title, description, actions, className }: PageHeaderProps) {
|
||||
return (
|
||||
<header className={cn("flex flex-col gap-3 md:flex-row md:items-start md:justify-between", className)}>
|
||||
<div className="min-w-0 space-y-1">
|
||||
<h1 className="truncate text-xl font-semibold tracking-normal text-[var(--dg-text-primary)] md:text-2xl">
|
||||
{title}
|
||||
</h1>
|
||||
{description ? (
|
||||
<p className="max-w-3xl text-sm leading-6 text-[var(--dg-text-secondary)]">{description}</p>
|
||||
) : null}
|
||||
</div>
|
||||
{actions ? <div className="flex shrink-0 flex-wrap items-center gap-2">{actions}</div> : null}
|
||||
</header>
|
||||
)
|
||||
}
|
||||
|
||||
export function PageSection({
|
||||
children,
|
||||
title,
|
||||
description,
|
||||
actions,
|
||||
className,
|
||||
contentClassName,
|
||||
}: PageSectionProps) {
|
||||
const hasHeader = title || description || actions
|
||||
|
||||
return (
|
||||
<section
|
||||
className={cn(
|
||||
"rounded-lg border border-[var(--dg-border)] bg-[var(--dg-bg-secondary)] shadow-[var(--shadow-card)]",
|
||||
className,
|
||||
)}
|
||||
>
|
||||
{hasHeader ? (
|
||||
<div className="flex flex-col gap-3 border-b border-[var(--dg-border)] px-4 py-3 md:flex-row md:items-center md:justify-between">
|
||||
<div className="min-w-0 space-y-1">
|
||||
{title ? <h2 className="truncate text-base font-medium text-[var(--dg-text-primary)]">{title}</h2> : null}
|
||||
{description ? <p className="text-sm text-[var(--dg-text-secondary)]">{description}</p> : null}
|
||||
</div>
|
||||
{actions ? <div className="flex shrink-0 flex-wrap items-center gap-2">{actions}</div> : null}
|
||||
</div>
|
||||
) : null}
|
||||
<div className={cn("min-w-0 p-4", contentClassName)}>{children}</div>
|
||||
</section>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import type { ComponentProps } from "react"
|
||||
|
||||
import { Badge } from "@/components/ui/badge"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
type StatusTone = "success" | "warning" | "danger" | "info" | "neutral" | "running" | "offline"
|
||||
|
||||
const toneClassName: Record<StatusTone, string> = {
|
||||
success: "border-[color-mix(in_srgb,var(--dg-green)_35%,transparent)] bg-[color-mix(in_srgb,var(--dg-green)_14%,transparent)] text-[var(--dg-green)]",
|
||||
warning: "border-[color-mix(in_srgb,var(--dg-yellow)_38%,transparent)] bg-[color-mix(in_srgb,var(--dg-yellow)_15%,transparent)] text-[var(--dg-yellow)]",
|
||||
danger: "border-[color-mix(in_srgb,var(--dg-red)_38%,transparent)] bg-[color-mix(in_srgb,var(--dg-red)_14%,transparent)] text-[var(--dg-red)]",
|
||||
info: "border-[color-mix(in_srgb,var(--dg-blue)_35%,transparent)] bg-[color-mix(in_srgb,var(--dg-blue)_14%,transparent)] text-[var(--dg-blue)]",
|
||||
neutral: "border-[var(--dg-border)] bg-[var(--dg-bg-tertiary)] text-[var(--dg-text-secondary)]",
|
||||
running: "border-[color-mix(in_srgb,var(--dg-cyan)_38%,transparent)] bg-[color-mix(in_srgb,var(--dg-cyan)_14%,transparent)] text-[var(--dg-cyan)]",
|
||||
offline: "border-[var(--dg-border)] bg-[var(--dg-bg-tertiary)] text-[var(--dg-text-muted)]",
|
||||
}
|
||||
|
||||
type StatusBadgeProps = ComponentProps<typeof Badge> & {
|
||||
tone?: StatusTone
|
||||
dot?: boolean
|
||||
}
|
||||
|
||||
export function StatusBadge({ tone = "neutral", dot = false, className, children, ...props }: StatusBadgeProps) {
|
||||
return (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className={cn("gap-1.5 rounded-md px-2 py-0.5 font-normal", toneClassName[tone], className)}
|
||||
{...props}
|
||||
>
|
||||
{dot ? <span className="size-1.5 rounded-full bg-current" /> : null}
|
||||
{children}
|
||||
</Badge>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
import { Loader2 } from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
interface TerminalLoadingOverlayProps {
|
||||
show: boolean;
|
||||
label?: string;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function TerminalLoadingOverlay({ show, label = '连接中...', className }: TerminalLoadingOverlayProps) {
|
||||
if (!show) return null;
|
||||
|
||||
return (
|
||||
<div className={cn('absolute inset-0 z-10 flex items-center justify-center bg-black/35', className)}>
|
||||
<div className="flex flex-col items-center gap-2 text-white/85">
|
||||
<Loader2 className="h-7 w-7 animate-spin" />
|
||||
{label && <span className="text-xs">{label}</span>}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
export * from "./EmptyState"
|
||||
export * from "./FilterBar"
|
||||
export * from "./MetricCard"
|
||||
export * from "./PageShell"
|
||||
export * from "./StatusBadge"
|
||||
Reference in new issue
Block a user