This commit is contained in:
unknown
2026-02-04 20:27:13 +08:00
commit 3b042d1dad
9410 changed files with 1488147 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package trafficstats
import (
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/TeaOSLab/EdgeUser/internal/web/actions/actionutils"
"github.com/iwind/TeaGo/maps"
"github.com/iwind/TeaGo/types"
)
type ServerOptionsAction struct {
actionutils.ParentAction
}
func (this *ServerOptionsAction) RunPost(params struct{}) {
serversResp, err := this.RPC().ServerRPC().FindAllUserServers(this.UserContext(), &pb.FindAllUserServersRequest{UserId: this.UserId()})
if err != nil {
this.ErrorPage(err)
return
}
var serverMaps = []maps.Map{
{"id": 0, "name": "全部网站(" + types.String(len(serversResp.Servers)) + ""},
}
for _, server := range serversResp.Servers {
if len(server.FirstServerName) > 0 {
server.Name = server.FirstServerName
}
serverMaps = append(serverMaps, maps.Map{
"id": server.Id,
"name": server.Name,
})
}
this.Data["servers"] = serverMaps
this.Success()
}