send country code in ws, update profile api (#22)

* send country code in ws

* make ddns_profiles optional field

* update profile api
This commit is contained in:
UUBulb
2024-11-26 21:30:56 +08:00
committed by GitHub
parent 07989705d2
commit e90941f52b
6 changed files with 62 additions and 10 deletions

View File

@@ -108,6 +108,10 @@ func getServerStat(c *gin.Context, withPublicNote bool) ([]byte, error) {
servers := make([]model.StreamServer, 0, len(serverList))
for _, server := range serverList {
var countryCode string
if server.GeoIP != nil {
countryCode = server.GeoIP.CountryCode
}
servers = append(servers, model.StreamServer{
ID: server.ID,
Name: server.Name,
@@ -115,6 +119,7 @@ func getServerStat(c *gin.Context, withPublicNote bool) ([]byte, error) {
DisplayIndex: server.DisplayIndex,
Host: server.Host,
State: server.State,
CountryCode: countryCode,
LastActive: server.LastActive,
})
}