mirror of
https://github.com/bjdgyc/anylink.git
synced 2025-08-08 11:10:14 +08:00
优化审计日志的UI + 增加客户端的系统型号
This commit is contained in:
@@ -41,17 +41,19 @@ type User struct {
|
||||
}
|
||||
|
||||
type UserActLog struct {
|
||||
Id int `json:"id" xorm:"pk autoincr not null"`
|
||||
Username string `json:"username" xorm:"varchar(60)"`
|
||||
GroupName string `json:"group_name" xorm:"varchar(60)"`
|
||||
IpAddr string `json:"ip_addr" xorm:"varchar(32)"`
|
||||
RemoteAddr string `json:"remote_addr" xorm:"varchar(32)"`
|
||||
Os uint8 `json:"os" xorm:"not null default 0 Int"`
|
||||
Client uint8 `json:"client" xorm:"not null default 0 Int"`
|
||||
Version string `json:"version" xorm:"varchar(15)"`
|
||||
Status uint8 `json:"status" xorm:"not null default 0 Int"`
|
||||
Info string `json:"info" xorm:"varchar(255) not null default ''"` // 详情
|
||||
CreatedAt time.Time `json:"created_at" xorm:"DateTime created"`
|
||||
Id int `json:"id" xorm:"pk autoincr not null"`
|
||||
Username string `json:"username" xorm:"varchar(60)"`
|
||||
GroupName string `json:"group_name" xorm:"varchar(60)"`
|
||||
IpAddr string `json:"ip_addr" xorm:"varchar(32)"`
|
||||
RemoteAddr string `json:"remote_addr" xorm:"varchar(32)"`
|
||||
Os uint8 `json:"os" xorm:"not null default 0 Int"`
|
||||
Client uint8 `json:"client" xorm:"not null default 0 Int"`
|
||||
Version string `json:"version" xorm:"varchar(15)"`
|
||||
DeviceType string `json:"device_type" xorm:"varchar(60) not null default ''"`
|
||||
PlatformVersion string `json:"platform_version" xorm:"varchar(15) not null default ''"`
|
||||
Status uint8 `json:"status" xorm:"not null default 0 Int"`
|
||||
Info string `json:"info" xorm:"varchar(255) not null default ''"` // 详情
|
||||
CreatedAt time.Time `json:"created_at" xorm:"DateTime created"`
|
||||
}
|
||||
|
||||
type IpMap struct {
|
||||
|
@@ -55,7 +55,7 @@ var (
|
||||
},
|
||||
InfoOps: []string{ // 信息
|
||||
UserLogoutLose: "用户掉线",
|
||||
UserLogoutBanner: "用户取消弹窗",
|
||||
UserLogoutBanner: "用户取消弹窗/客户端发起的logout",
|
||||
UserLogoutClient: "用户/客户端主动断开",
|
||||
UserLogoutTimeout: "Session过期被踢下线",
|
||||
UserLogoutAdmin: "账号被管理员踢下线",
|
||||
@@ -121,8 +121,8 @@ func (ua *UserActLogProcess) ParseUserAgent(userAgent string) (os_idx, client_id
|
||||
if len(userAgent) == 0 {
|
||||
return 5, 2, ""
|
||||
}
|
||||
// os
|
||||
os_idx = 2
|
||||
// OS
|
||||
os_idx = 5
|
||||
if strings.Contains(userAgent, "windows") {
|
||||
os_idx = 0
|
||||
} else if strings.Contains(userAgent, "mac os") || strings.Contains(userAgent, "darwin_i386") {
|
||||
@@ -131,15 +131,17 @@ func (ua *UserActLogProcess) ParseUserAgent(userAgent string) (os_idx, client_id
|
||||
os_idx = 4
|
||||
} else if strings.Contains(userAgent, "android") {
|
||||
os_idx = 3
|
||||
} else if strings.Contains(userAgent, "linux") {
|
||||
os_idx = 2
|
||||
}
|
||||
// client
|
||||
// Client
|
||||
client_idx = 2
|
||||
if strings.Contains(userAgent, "anyconnect") {
|
||||
client_idx = 0
|
||||
} else if strings.Contains(userAgent, "openconnect") {
|
||||
client_idx = 1
|
||||
}
|
||||
// ver
|
||||
// Verion
|
||||
uaSlice := strings.Split(userAgent, " ")
|
||||
ver = uaSlice[len(uaSlice)-1]
|
||||
if ver[0] == 'v' {
|
||||
|
Reference in New Issue
Block a user