- Agent CLI: 多轮对话、SSH 长连接、流式推理、Evolver 按用户隔离、历史侧栏 - 终端审计: 回放播放器、命令书签、筛选分页导出、命令输出统计、录制落盘修复 - 修复 session_commands 表迁移、Kill 竞态导致录制丢失、无录制会话回放提示 - 审计历史页只读(移除删除),移除回放弹框录制搜索
34 lines
1.3 KiB
Go
34 lines
1.3 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"` // 关联终端会话
|
|
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"`
|
|
}
|