支持自定义HTTP DNS

This commit is contained in:
GoEdgeLab
2021-01-28 11:29:50 +08:00
parent 8971d939ba
commit 3f656a859d
5 changed files with 78 additions and 1 deletions

View File

@@ -84,6 +84,10 @@ func (this *UpdatePopupAction) RunPost(params struct {
ParamApiKey string
ParamApiSecret string
// CustomHTTP
ParamCustomHTTPURL string
ParamCustomHTTPSecret string
Must *actions.Must
CSRF *actionutils.CSRF
}) {
@@ -124,6 +128,15 @@ func (this *UpdatePopupAction) RunPost(params struct {
apiParams["apiKey"] = params.ParamApiKey
apiParams["apiSecret"] = params.ParamApiSecret
case "customHTTP":
params.Must.
Field("paramCustomHTTPURL", params.ParamCustomHTTPURL).
Require("请输入HTTP URL").
Match("^(?i)(http|https):", "URL必须以http://或者https://开头").
Field("paramCustomHTTPSecret", params.ParamCustomHTTPSecret).
Require("请输入私钥")
apiParams["url"] = params.ParamCustomHTTPURL
apiParams["secret"] = params.ParamCustomHTTPSecret
default:
this.Fail("暂时不支持此服务商'" + params.Type + "'")
}