前端页面

This commit is contained in:
robin
2026-02-24 22:43:49 +08:00
parent 2eb32b9f1f
commit 4d275c921d
18 changed files with 611 additions and 485 deletions

View File

@@ -6,6 +6,7 @@ import (
"strconv"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/default/httpdns/policies"
"github.com/iwind/TeaGo/maps"
)
@@ -14,10 +15,11 @@ type TestAction struct {
}
func (this *TestAction) RunPost(params struct {
AppId string
Domain string
ClientIp string
Qtype string
AppId string
ClusterId int64
Domain string
ClientIp string
Qtype string
}) {
if len(params.ClientIp) == 0 {
params.ClientIp = "203.0.113.100"
@@ -40,7 +42,11 @@ func (this *TestAction) RunPost(params struct {
query.Set("dn", params.Domain)
query.Set("cip", params.ClientIp)
query.Set("qtype", params.Qtype)
requestURL := "https://api.httpdns.example.com/resolve?" + query.Encode()
clusterServiceDomain := policies.LoadClusterGatewayByID(params.ClusterId)
if len(clusterServiceDomain) == 0 {
clusterServiceDomain = "gw.httpdns.example.com"
}
requestURL := "https://" + clusterServiceDomain + "/resolve?" + query.Encode()
this.Data["result"] = maps.Map{
"code": 0,