fix26.2: полная UI-полировка peer/dashboard и завершение i18n
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
package bo
|
||||
|
||||
import "time"
|
||||
|
||||
type AccountBo struct {
|
||||
Id int64 `json:"id"`
|
||||
Username string `json:"username"`
|
||||
@@ -10,26 +8,6 @@ type AccountBo struct {
|
||||
TokenVersion int64 `json:"tokenVersion"`
|
||||
}
|
||||
|
||||
type AccountExport struct {
|
||||
Id int64 `json:"id"`
|
||||
Username string `json:"username"`
|
||||
Pass string `json:"pass"`
|
||||
ConPass string `json:"conPass"`
|
||||
Quota int64 `json:"quota"`
|
||||
Download int64 `json:"download"`
|
||||
Upload int64 `json:"upload"`
|
||||
ExpireTime int64 `json:"expireTime"`
|
||||
DeviceNo int64 `json:"deviceNo"`
|
||||
KickUtilTime int64 `json:"kickUtilTime"`
|
||||
Role string `json:"role"`
|
||||
Deleted int64 `json:"deleted"`
|
||||
CreateTime time.Time `json:"createTime"`
|
||||
UpdateTime time.Time `json:"updateTime"`
|
||||
LoginAt int64 `json:"loginAt"`
|
||||
ConAt int64 `json:"conAt"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
|
||||
type PeerExport struct {
|
||||
Id int64 `json:"id,omitempty"`
|
||||
AuthId string `json:"authId,omitempty"`
|
||||
|
||||
@@ -4,4 +4,3 @@ type AdminChangePasswordDto struct {
|
||||
OldPassword *string `json:"oldPassword" form:"oldPassword" validate:"required,min=6,max=64"`
|
||||
NewPassword *string `json:"newPassword" form:"newPassword" validate:"required,min=6,max=64"`
|
||||
}
|
||||
|
||||
|
||||
@@ -4,4 +4,3 @@ type LoginDto struct {
|
||||
Username *string `json:"username" form:"username" validate:"required,min=6,max=32,validateStr"`
|
||||
Pass *string `json:"pass" form:"pass" validate:"required,min=6,max=64"`
|
||||
}
|
||||
|
||||
|
||||
@@ -31,4 +31,3 @@ type PeerUpdateDto struct {
|
||||
type PeerKickDto struct {
|
||||
BannedUntil *int64 `json:"bannedUntil" form:"bannedUntil" validate:"required,min=0"`
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package entity
|
||||
|
||||
type Account struct {
|
||||
type LegacyAccount struct {
|
||||
Username *string `gorm:"column:username;default:''" json:"username"`
|
||||
Pass *string `gorm:"column:pass;default:''" json:"pass"`
|
||||
ConPass *string `gorm:"column:con_pass;default:''" json:"conPass"`
|
||||
@@ -19,3 +19,7 @@ type Account struct {
|
||||
Remark *string `gorm:"column:remark;default:''" json:"remark"`
|
||||
ForcePasswordChange *int64 `gorm:"column:force_password_change;default:0" json:"forcePasswordChange"`
|
||||
}
|
||||
|
||||
func (LegacyAccount) TableName() string {
|
||||
return "account"
|
||||
}
|
||||
|
||||
@@ -14,4 +14,3 @@ type AdminUser struct {
|
||||
func (AdminUser) TableName() string {
|
||||
return "admin_user"
|
||||
}
|
||||
|
||||
|
||||
@@ -2,22 +2,21 @@ package entity
|
||||
|
||||
type MetricSample struct {
|
||||
BaseEntity
|
||||
SampledAt *int64 `gorm:"column:sampled_at"`
|
||||
CpuPercent *float64 `gorm:"column:cpu_percent"`
|
||||
Load1 *float64 `gorm:"column:load1"`
|
||||
MemUsedBytes *int64 `gorm:"column:mem_used_bytes"`
|
||||
MemTotalBytes *int64 `gorm:"column:mem_total_bytes"`
|
||||
MemPercent *float64 `gorm:"column:mem_percent"`
|
||||
DiskPath *string `gorm:"column:disk_path"`
|
||||
DiskUsedBytes *int64 `gorm:"column:disk_used_bytes"`
|
||||
DiskTotalBytes *int64 `gorm:"column:disk_total_bytes"`
|
||||
DiskPercent *float64 `gorm:"column:disk_percent"`
|
||||
HysteriaRunning *int64 `gorm:"column:hysteria_running"`
|
||||
OnlinePeers *int64 `gorm:"column:online_peers"`
|
||||
OnlineDevices *int64 `gorm:"column:online_devices"`
|
||||
SampledAt *int64 `gorm:"column:sampled_at"`
|
||||
CpuPercent *float64 `gorm:"column:cpu_percent"`
|
||||
Load1 *float64 `gorm:"column:load1"`
|
||||
MemUsedBytes *int64 `gorm:"column:mem_used_bytes"`
|
||||
MemTotalBytes *int64 `gorm:"column:mem_total_bytes"`
|
||||
MemPercent *float64 `gorm:"column:mem_percent"`
|
||||
DiskPath *string `gorm:"column:disk_path"`
|
||||
DiskUsedBytes *int64 `gorm:"column:disk_used_bytes"`
|
||||
DiskTotalBytes *int64 `gorm:"column:disk_total_bytes"`
|
||||
DiskPercent *float64 `gorm:"column:disk_percent"`
|
||||
HysteriaRunning *int64 `gorm:"column:hysteria_running"`
|
||||
OnlinePeers *int64 `gorm:"column:online_peers"`
|
||||
OnlineDevices *int64 `gorm:"column:online_devices"`
|
||||
}
|
||||
|
||||
func (MetricSample) TableName() string {
|
||||
return "metric_sample"
|
||||
}
|
||||
|
||||
|
||||
@@ -20,4 +20,3 @@ type Peer struct {
|
||||
func (Peer) TableName() string {
|
||||
return "peer"
|
||||
}
|
||||
|
||||
|
||||
@@ -11,4 +11,3 @@ type TrafficAggregateDaily struct {
|
||||
func (TrafficAggregateDaily) TableName() string {
|
||||
return "traffic_aggregate_daily"
|
||||
}
|
||||
|
||||
|
||||
@@ -11,4 +11,3 @@ type TrafficAggregateHourly struct {
|
||||
func (TrafficAggregateHourly) TableName() string {
|
||||
return "traffic_aggregate_hourly"
|
||||
}
|
||||
|
||||
|
||||
@@ -12,4 +12,3 @@ type TrafficSample struct {
|
||||
func (TrafficSample) TableName() string {
|
||||
return "traffic_sample"
|
||||
}
|
||||
|
||||
|
||||
@@ -6,4 +6,3 @@ type AdminInfoVo struct {
|
||||
Roles []string `json:"roles"`
|
||||
ForcePasswordChange bool `json:"forcePasswordChange"`
|
||||
}
|
||||
|
||||
|
||||
+28
-29
@@ -1,13 +1,13 @@
|
||||
package vo
|
||||
|
||||
type DashboardSummaryVo struct {
|
||||
CollectedAt int64 `json:"collectedAt"`
|
||||
System DashboardSystemVo `json:"system"`
|
||||
CollectedAt int64 `json:"collectedAt"`
|
||||
System DashboardSystemVo `json:"system"`
|
||||
Hysteria DashboardHysteriaVo `json:"hysteria"`
|
||||
Peers DashboardPeerVo `json:"peers"`
|
||||
Traffic DashboardTrafficVo `json:"traffic"`
|
||||
Health DashboardHealthVo `json:"health"`
|
||||
SecurityRisks []SecurityRiskVo `json:"securityRisks"`
|
||||
Peers DashboardPeerVo `json:"peers"`
|
||||
Traffic DashboardTrafficVo `json:"traffic"`
|
||||
Health DashboardHealthVo `json:"health"`
|
||||
SecurityRisks []SecurityRiskVo `json:"securityRisks"`
|
||||
}
|
||||
|
||||
type DashboardHealthVo struct {
|
||||
@@ -22,13 +22,13 @@ type DataHealthVo struct {
|
||||
}
|
||||
|
||||
type DashboardSystemVo struct {
|
||||
CpuPercent float64 `json:"cpuPercent"`
|
||||
MemUsedBytes uint64 `json:"memUsedBytes"`
|
||||
MemTotalBytes uint64 `json:"memTotalBytes"`
|
||||
MemPercent float64 `json:"memPercent"`
|
||||
DiskUsedBytes uint64 `json:"diskUsedBytes"`
|
||||
DiskTotalBytes uint64 `json:"diskTotalBytes"`
|
||||
DiskPercent float64 `json:"diskPercent"`
|
||||
CpuPercent float64 `json:"cpuPercent"`
|
||||
MemUsedBytes uint64 `json:"memUsedBytes"`
|
||||
MemTotalBytes uint64 `json:"memTotalBytes"`
|
||||
MemPercent float64 `json:"memPercent"`
|
||||
DiskUsedBytes uint64 `json:"diskUsedBytes"`
|
||||
DiskTotalBytes uint64 `json:"diskTotalBytes"`
|
||||
DiskPercent float64 `json:"diskPercent"`
|
||||
}
|
||||
|
||||
type DashboardHysteriaVo struct {
|
||||
@@ -48,11 +48,11 @@ type DashboardPeerVo struct {
|
||||
}
|
||||
|
||||
type DashboardTrafficVo struct {
|
||||
DownloadBytes int64 `json:"downloadBytes"`
|
||||
UploadBytes int64 `json:"uploadBytes"`
|
||||
TotalBytes int64 `json:"totalBytes"`
|
||||
TodayDownloadBytes int64 `json:"todayDownloadBytes"`
|
||||
TodayUploadBytes int64 `json:"todayUploadBytes"`
|
||||
DownloadBytes int64 `json:"downloadBytes"`
|
||||
UploadBytes int64 `json:"uploadBytes"`
|
||||
TotalBytes int64 `json:"totalBytes"`
|
||||
TodayDownloadBytes int64 `json:"todayDownloadBytes"`
|
||||
TodayUploadBytes int64 `json:"todayUploadBytes"`
|
||||
SinceResetDownloadBytes int64 `json:"sinceResetDownloadBytes"`
|
||||
SinceResetUploadBytes int64 `json:"sinceResetUploadBytes"`
|
||||
}
|
||||
@@ -65,12 +65,12 @@ type SecurityRiskVo struct {
|
||||
}
|
||||
|
||||
type DashboardTopPeerVo struct {
|
||||
PeerId int64 `json:"peerId"`
|
||||
Name string `json:"name"`
|
||||
Remark string `json:"remark"`
|
||||
Download int64 `json:"download"`
|
||||
Upload int64 `json:"upload"`
|
||||
Total int64 `json:"total"`
|
||||
PeerId int64 `json:"peerId"`
|
||||
Name string `json:"name"`
|
||||
Remark string `json:"remark"`
|
||||
Download int64 `json:"download"`
|
||||
Upload int64 `json:"upload"`
|
||||
Total int64 `json:"total"`
|
||||
}
|
||||
|
||||
type DashboardSeriesPointVo struct {
|
||||
@@ -82,9 +82,8 @@ type DashboardSeriesPointVo struct {
|
||||
}
|
||||
|
||||
type DashboardTimeseriesVo struct {
|
||||
Range string `json:"range"`
|
||||
Traffic []DashboardSeriesPointVo `json:"traffic"`
|
||||
System []DashboardSeriesPointVo `json:"system"`
|
||||
CollectedAt int64 `json:"collectedAt"`
|
||||
Range string `json:"range"`
|
||||
Traffic []DashboardSeriesPointVo `json:"traffic"`
|
||||
System []DashboardSeriesPointVo `json:"system"`
|
||||
CollectedAt int64 `json:"collectedAt"`
|
||||
}
|
||||
|
||||
|
||||
@@ -27,4 +27,3 @@ type PeerClientConfigVo struct {
|
||||
Url string `json:"url"`
|
||||
QrCode []byte `json:"qrCode"`
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user