feat(api): enhance server status handling with protocol support and refactor related logic

This commit is contained in:
Chang lue Tsen
2025-09-01 04:17:33 -04:00
parent 6dc1bee14c
commit 3012a68339
18 changed files with 261 additions and 1428 deletions
+17 -16
View File
@@ -1662,18 +1662,18 @@ type SendSmsCodeRequest struct {
}
type Server struct {
Id int64 `json:"id"`
Name string `json:"name"`
Country string `json:"country"`
City string `json:"city"`
Ratio float32 `json:"ratio"`
Address string `json:"address"`
Sort int `json:"sort"`
Protocols []Protocol `json:"protocols"`
LastReportedAt int64 `json:"last_reported_at"`
Status ServerStatus `json:"status"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
Id int64 `json:"id"`
Name string `json:"name"`
Country string `json:"country"`
City string `json:"city"`
Ratio float32 `json:"ratio"`
Address string `json:"address"`
Sort int `json:"sort"`
Protocols []Protocol `json:"protocols"`
LastReportedAt int64 `json:"last_reported_at"`
Status []ServerStatus `json:"status"`
CreatedAt int64 `json:"created_at"`
UpdatedAt int64 `json:"updated_at"`
}
type ServerBasic struct {
@@ -1731,10 +1731,11 @@ type ServerRuleGroup struct {
}
type ServerStatus struct {
Online []ServerOnlineUser `json:"online"`
Cpu float64 `json:"cpu"`
Mem float64 `json:"mem"`
Disk float64 `json:"disk"`
Cpu float64 `json:"cpu"`
Mem float64 `json:"mem"`
Disk float64 `json:"disk"`
Protocol string `json:"protocol"`
Online []ServerOnlineUser `json:"online"`
}
type ServerTotalDataResponse struct {