feat: LokiDeploy 初始提交 - 轻量级 K8s Loki 部署平台

Go(Gin) + React(Vite + shadcn/ui + Tailwind) 前后端分离,全中文 UI

- 集群管理:Kubeconfig / Token 双接入,kubectl + helm 部署
- 主机管理:SSH 密钥 / 密码双认证,CPU/内存/磁盘使用率监控,SSH 错误中文友好提示
- 存储配置、部署管理、系统设置
- Docker 镜像内置 kubectl + helm,开箱即用
- run.sh 一键启停(start/stop/restart/status)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Logan.LiandClaude committed 2026-06-29 17:03:57 +08:00
commit 2a93de600d
134 files changed
+19595

No files matched your search

+178
View File
@@ -0,0 +1,178 @@
// API Response
export interface ApiResponse<T> {
code: number;
message: string;
data: T;
}
// User
export interface User {
id: number;
username: string;
nickname: string;
role: string;
}
// Cluster
export interface Cluster {
id: number;
name: string;
description: string;
configType?: string; // kubeconfig | token
apiServer?: string;
hasKubeconfig?: boolean;
context: string;
version: string;
nodesCount: number;
status: string;
lastConnected: string;
createdAt: string;
updatedAt: string;
deployments?: LokiDeployment[];
}
export interface ClusterInfo {
version: string;
nodes: NodeInfo[];
namespaces: string[];
contexts: string[];
currentContext: string;
}
export interface NodeInfo {
name: string;
status: string;
roles: string[];
version: string;
os: string;
arch: string;
internalIP: string;
labels: Record<string, string>;
}
// Host
export interface Host {
id: number;
name: string;
hostIP: string;
port: number;
user: string;
authType: 'password' | 'key';
os: string;
arch: string;
status: string;
labels: string;
createdAt: string;
updatedAt: string;
}
export interface HostInfo {
hostname: string;
os: string;
version: string;
arch: string;
kernel: string;
cpu: string;
memory: string;
disk: string;
uptime: string;
// 资源使用率(百分比)
cpuUsage: number;
memUsage: number;
diskUsage: number;
// 资源已用/总量
memTotal: string;
memUsed: string;
diskTotal: string;
diskUsed: string;
}
// Storage
export interface StorageConfig {
id: number;
name: string;
storageType: 's3' | 'oss' | 'minio' | 'rustfs';
endpoint: string;
bucket: string;
region: string;
pathPrefix: string;
insecure: boolean;
isDefault: boolean;
createdAt: string;
updatedAt: string;
}
// Deployment
export interface LokiDeployment {
id: number;
uuid: string;
name: string;
description: string;
version: string;
mode: 'k8s-helm' | 'k8s-yaml' | 'host-binary';
clusterID?: number;
cluster?: Cluster;
hostID?: number;
host?: Host;
namespace: string;
storageConfigID: number;
storageConfig?: StorageConfig;
authEnabled: boolean;
retentionDays: number;
replicas: number;
resourcesCPU: string;
resourcesMem: string;
storageSize: string;
status: string;
statusMessage: string;
helmValues: string;
endpoint: string;
adminUser: string;
createdAt: string;
updatedAt: string;
}
export interface DeploymentLog {
id: number;
deploymentID: number;
level: string;
message: string;
detail: string;
createdAt: string;
}
export interface CreateDeploymentRequest {
name: string;
description?: string;
version?: string;
mode: 'k8s-helm' | 'k8s-yaml' | 'host-binary';
clusterID?: number;
hostID?: number;
namespace?: string;
storageConfigID?: number;
authEnabled?: boolean;
retentionDays?: number;
replicas?: number;
resourcesCPU?: string;
resourcesMem?: string;
storageSize?: string;
}
// Page Data
export interface PageData<T> {
list: T[];
total: number;
page: number;
pageSize: number;
}
// Dashboard Stats
export interface DashboardStats {
totalDeployments: number;
running: number;
failed: number;
pending: number;
stopped: number;
clusterCount: number;
hostCount: number;
}