mirror of
https://github.com/Awuqing/BackupX.git
synced 2026-05-06 20:02:41 +08:00
Three community-requested features: 1. CLI password reset: `backupx reset-password --username admin --password xxx` Docker users can run via `docker exec`. No full app init needed. 2. Audit logging: async fire-and-forget audit trail for all key operations (login, CRUD on tasks/targets/records, settings changes). New UI page at /audit with category filter and pagination. 3. Multi-source path backup: file backup tasks now support multiple source directories packed into a single tar archive. Backward compatible with existing single sourcePath field.
22 lines
896 B
Go
22 lines
896 B
Go
package model
|
|
|
|
import "time"
|
|
|
|
type AuditLog struct {
|
|
ID uint `gorm:"primaryKey" json:"id"`
|
|
UserID uint `gorm:"column:user_id;index" json:"userId"`
|
|
Username string `gorm:"column:username;size:64;not null" json:"username"`
|
|
Category string `gorm:"column:category;size:32;index;not null" json:"category"`
|
|
Action string `gorm:"column:action;size:64;not null" json:"action"`
|
|
TargetType string `gorm:"column:target_type;size:32" json:"targetType"`
|
|
TargetID string `gorm:"column:target_id;size:64" json:"targetId"`
|
|
TargetName string `gorm:"column:target_name;size:128" json:"targetName"`
|
|
Detail string `gorm:"column:detail;type:text" json:"detail"`
|
|
ClientIP string `gorm:"column:client_ip;size:45" json:"clientIp"`
|
|
CreatedAt time.Time `gorm:"index" json:"createdAt"`
|
|
}
|
|
|
|
func (AuditLog) TableName() string {
|
|
return "audit_logs"
|
|
}
|