Files
aiops/backend/model/session_command.go
T
LoganandClaude 76ec9387f0 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>
2026-07-04 01:50:36 +08:00

35 lines
1.4 KiB
Go

package model
import "time"
// SessionCommand 会话命令记录(JumpServer 式命令审计) // Logan.Li
type SessionCommand struct {
ID uint `gorm:"primarykey" json:"id"`
SessionID uint `gorm:"index" json:"session_id"` // 关联终端会话
SessionType string `gorm:"size:32;default:terminal" json:"session_type"` // terminal/rdp,用于区分回放入口 // Logan.Li
UserID *uint `json:"user_id"`
Username string `gorm:"size:64" json:"username"`
ServerID uint `json:"server_id"`
ServerName string `gorm:"size:128" json:"server_name"`
Command string `gorm:"type:text" json:"command"` // 执行的原始命令
OutputSize *int `json:"output_size"` // 下一条命令前累计的终端输出字节数,nil=历史未统计 // Logan.Li
Timestamp time.Time `json:"timestamp"` // 命令执行时间
CreatedAt time.Time `json:"created_at"`
}
func (SessionCommand) TableName() string {
return "sys_session_commands"
}
// SessionCommandQuery 会话命令查询 // Logan.Li
type SessionCommandQuery struct {
SessionID uint `form:"session_id"`
Username string `form:"username"`
ServerID uint `form:"server_id"`
Command string `form:"command"`
StartDate string `form:"start_date"` // YYYY-MM-DD
EndDate string `form:"end_date"`
Page int `form:"page,default=1"`
PageSize int `form:"page_size,default=20"`
}