Полная зачистка legacy + закрытие fix24.1/fix24.2 + обновление логотипа
This commit is contained in:
@@ -12,5 +12,4 @@ const (
|
||||
Hysteria2TrafficTime = "HYSTERIA2_TRAFFIC_TIME"
|
||||
Hysteria2ConfigRemark = "HYSTERIA2_CONFIG_REMARK"
|
||||
ResetTrafficCron = "RESET_TRAFFIC_CRON"
|
||||
ClashExtension = "CLASH_EXTENSION"
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package dto
|
||||
|
||||
type AccountPageDto struct {
|
||||
type PeerPageDto struct {
|
||||
BaseDto
|
||||
Username *string `json:"username" form:"username" validate:"omitempty,min=1,max=32"`
|
||||
Deleted *int64 `json:"deleted" form:"deleted" validate:"omitempty,oneof=0 1"`
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
package dto
|
||||
|
||||
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"`
|
||||
}
|
||||
|
||||
@@ -15,11 +15,6 @@ type Hysteria2VersionDto struct {
|
||||
Version *string `json:"version" form:"version" validate:"required,min=1,max=10"`
|
||||
}
|
||||
|
||||
type Hysteria2SubscribeUrlDto struct {
|
||||
AccountId *int64 `json:"accountId" form:"accountId" validate:"required,gt=0"`
|
||||
Protocol *string `json:"protocol" form:"protocol" validate:"required,min=1,max=8"`
|
||||
}
|
||||
|
||||
type Hysteria2UrlDto struct {
|
||||
AccountId *int64 `json:"accountId" form:"accountId" validate:"required,gt=0"`
|
||||
}
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
package entity
|
||||
|
||||
type AdminUser struct {
|
||||
Username *string `gorm:"column:username;default:''" json:"username"`
|
||||
PasswordHash *string `gorm:"column:password_hash;default:''" json:"passwordHash"`
|
||||
Status *int64 `gorm:"column:status;default:1" json:"status"`
|
||||
ForcePasswordChange *int64 `gorm:"column:force_password_change;default:0" json:"forcePasswordChange"`
|
||||
LastLoginAt *int64 `gorm:"column:last_login_at;default:0" json:"lastLoginAt"`
|
||||
PasswordChangedAt *int64 `gorm:"column:password_changed_at;default:0" json:"passwordChangedAt"`
|
||||
TokenVersion *int64 `gorm:"column:token_version;default:1" json:"tokenVersion"`
|
||||
BaseEntity `gorm:"embedded"`
|
||||
}
|
||||
|
||||
func (AdminUser) TableName() string {
|
||||
return "admin_user"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
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"`
|
||||
}
|
||||
|
||||
func (MetricSample) TableName() string {
|
||||
return "metric_sample"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package entity
|
||||
|
||||
type Peer struct {
|
||||
Name *string `gorm:"column:name;default:''" json:"name"`
|
||||
Remark *string `gorm:"column:remark;default:''" json:"remark"`
|
||||
AuthId *string `gorm:"column:auth_id;default:''" json:"authId"`
|
||||
SecretDigest *string `gorm:"column:secret_digest;default:''" json:"secretDigest"`
|
||||
SecretCiphertext *string `gorm:"column:secret_ciphertext;default:''" json:"secretCiphertext"`
|
||||
QuotaBytes *int64 `gorm:"column:quota_bytes;default:0" json:"quotaBytes"`
|
||||
DownloadBytes *int64 `gorm:"column:download_bytes;default:0" json:"downloadBytes"`
|
||||
UploadBytes *int64 `gorm:"column:upload_bytes;default:0" json:"uploadBytes"`
|
||||
ExpiresAt *int64 `gorm:"column:expires_at;default:0" json:"expiresAt"`
|
||||
MaxDevices *int64 `gorm:"column:max_devices;default:3" json:"maxDevices"`
|
||||
Disabled *int64 `gorm:"column:disabled;default:0" json:"disabled"`
|
||||
BannedUntil *int64 `gorm:"column:banned_until;default:0" json:"bannedUntil"`
|
||||
LastConnectionAt *int64 `gorm:"column:last_connection_at;default:0" json:"lastConnectionAt"`
|
||||
BaseEntity `gorm:"embedded"`
|
||||
}
|
||||
|
||||
func (Peer) TableName() string {
|
||||
return "peer"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package entity
|
||||
|
||||
type TrafficAggregateDaily struct {
|
||||
PeerId *int64 `gorm:"column:peer_id;default:0;primaryKey" json:"peerId"`
|
||||
DayStart *int64 `gorm:"column:day_start;default:0;primaryKey" json:"dayStart"`
|
||||
RxBytes *int64 `gorm:"column:rx_bytes;default:0" json:"rxBytes"`
|
||||
TxBytes *int64 `gorm:"column:tx_bytes;default:0" json:"txBytes"`
|
||||
BaseEntity `gorm:"embedded"`
|
||||
}
|
||||
|
||||
func (TrafficAggregateDaily) TableName() string {
|
||||
return "traffic_aggregate_daily"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package entity
|
||||
|
||||
type TrafficAggregateHourly struct {
|
||||
PeerId *int64 `gorm:"column:peer_id;default:0;primaryKey" json:"peerId"`
|
||||
HourStart *int64 `gorm:"column:hour_start;default:0;primaryKey" json:"hourStart"`
|
||||
RxBytes *int64 `gorm:"column:rx_bytes;default:0" json:"rxBytes"`
|
||||
TxBytes *int64 `gorm:"column:tx_bytes;default:0" json:"txBytes"`
|
||||
BaseEntity `gorm:"embedded"`
|
||||
}
|
||||
|
||||
func (TrafficAggregateHourly) TableName() string {
|
||||
return "traffic_aggregate_hourly"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package entity
|
||||
|
||||
type TrafficSample struct {
|
||||
PeerId *int64 `gorm:"column:peer_id;default:0" json:"peerId"`
|
||||
AuthId *string `gorm:"column:auth_id;default:''" json:"authId"`
|
||||
RxBytes *int64 `gorm:"column:rx_bytes;default:0" json:"rxBytes"`
|
||||
TxBytes *int64 `gorm:"column:tx_bytes;default:0" json:"txBytes"`
|
||||
SampledAt *int64 `gorm:"column:sampled_at;default:0" json:"sampledAt"`
|
||||
BaseEntity `gorm:"embedded"`
|
||||
}
|
||||
|
||||
func (TrafficSample) TableName() string {
|
||||
return "traffic_sample"
|
||||
}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
package vo
|
||||
|
||||
type DashboardSummaryVo struct {
|
||||
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"`
|
||||
}
|
||||
|
||||
type DashboardHealthVo struct {
|
||||
Collector DataHealthVo `json:"collector"`
|
||||
Hysteria DataHealthVo `json:"hysteria"`
|
||||
}
|
||||
|
||||
type DataHealthVo struct {
|
||||
Status string `json:"status"`
|
||||
MessageKey string `json:"messageKey,omitempty"`
|
||||
LastSuccessAt int64 `json:"lastSuccessAt,omitempty"`
|
||||
}
|
||||
|
||||
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"`
|
||||
}
|
||||
|
||||
type DashboardHysteriaVo struct {
|
||||
Version string `json:"version"`
|
||||
Running bool `json:"running"`
|
||||
ApiReachable bool `json:"apiReachable"`
|
||||
LastApiError string `json:"lastApiError,omitempty"`
|
||||
}
|
||||
|
||||
type DashboardPeerVo struct {
|
||||
Total int64 `json:"total"`
|
||||
Enabled int64 `json:"enabled"`
|
||||
Disabled int64 `json:"disabled"`
|
||||
Expired int64 `json:"expired"`
|
||||
OnlinePeers int64 `json:"onlinePeers"`
|
||||
OnlineDevices int64 `json:"onlineDevices"`
|
||||
}
|
||||
|
||||
type DashboardTrafficVo struct {
|
||||
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"`
|
||||
}
|
||||
|
||||
type SecurityRiskVo struct {
|
||||
Key string `json:"key"`
|
||||
Severity string `json:"severity"`
|
||||
ActionRoute string `json:"actionRoute,omitempty"`
|
||||
Dismissible bool `json:"dismissible"`
|
||||
}
|
||||
|
||||
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"`
|
||||
}
|
||||
|
||||
type DashboardSeriesPointVo struct {
|
||||
Ts int64 `json:"ts"`
|
||||
Download int64 `json:"download,omitempty"`
|
||||
Upload int64 `json:"upload,omitempty"`
|
||||
Cpu float64 `json:"cpu,omitempty"`
|
||||
Mem float64 `json:"mem,omitempty"`
|
||||
}
|
||||
|
||||
type DashboardTimeseriesVo struct {
|
||||
Range string `json:"range"`
|
||||
Traffic []DashboardSeriesPointVo `json:"traffic"`
|
||||
System []DashboardSeriesPointVo `json:"system"`
|
||||
CollectedAt int64 `json:"collectedAt"`
|
||||
}
|
||||
|
||||
@@ -31,11 +31,6 @@ func Hysteria2AuthBadRequest(c *gin.Context) {
|
||||
})
|
||||
}
|
||||
|
||||
type Hysteria2SubscribeVo struct {
|
||||
Url string `json:"url"`
|
||||
QrCode []byte `json:"qrCode"`
|
||||
}
|
||||
|
||||
type Hysteria2UrlVo struct {
|
||||
Url string `json:"url"`
|
||||
QrCode []byte `json:"qrCode"`
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package vo
|
||||
|
||||
type SystemMonitorVo struct {
|
||||
HUIVersion string `json:"huiVersion"`
|
||||
CpuPercent float64 `json:"cpuPercent"`
|
||||
MemPercent float64 `json:"memPercent"`
|
||||
DiskPercent float64 `json:"diskPercent"`
|
||||
}
|
||||
|
||||
type Hysteria2MonitorVo struct {
|
||||
UserTotal int64 `json:"userTotal"` // Количество пользователей онлайн
|
||||
DeviceTotal int64 `json:"deviceTotal"` // Количество устройств онлайн
|
||||
Version string `json:"version"` // Версия
|
||||
Running bool `json:"running"` // Статус выполнения
|
||||
}
|
||||
Reference in New Issue
Block a user