域名解析增加CloudFlare DNS支持

This commit is contained in:
GoEdgeLab
2021-04-15 17:02:35 +08:00
parent ddfc80261f
commit f004bb209e
7 changed files with 77 additions and 2 deletions

View File

@@ -55,6 +55,10 @@ func (this *CreatePopupAction) RunPost(params struct {
ParamApiKey string ParamApiKey string
ParamApiSecret string ParamApiSecret string
// CloudFlare
CloudFlareAPIKey string
CloudFlareEmail string
// CustomHTTP // CustomHTTP
ParamCustomHTTPURL string ParamCustomHTTPURL string
ParamCustomHTTPSecret string ParamCustomHTTPSecret string
@@ -97,6 +101,14 @@ func (this *CreatePopupAction) RunPost(params struct {
apiParams["apiKey"] = params.ParamApiKey apiParams["apiKey"] = params.ParamApiKey
apiParams["apiSecret"] = params.ParamApiSecret apiParams["apiSecret"] = params.ParamApiSecret
case "cloudFlare":
params.Must.
Field("cloudFlareAPIKey", params.CloudFlareAPIKey).
Require("请输入API密钥").
Field("cloudFlareEmail", params.CloudFlareEmail).
Email("请输入正确格式的邮箱地址")
apiParams["apiKey"] = params.CloudFlareAPIKey
apiParams["email"] = params.CloudFlareEmail
case "customHTTP": case "customHTTP":
params.Must. params.Must.
Field("paramCustomHTTPURL", params.ParamCustomHTTPURL). Field("paramCustomHTTPURL", params.ParamCustomHTTPURL).

View File

@@ -84,6 +84,10 @@ func (this *UpdatePopupAction) RunPost(params struct {
ParamApiKey string ParamApiKey string
ParamApiSecret string ParamApiSecret string
// CloudFlare
CloudFlareAPIKey string
CloudFlareEmail string
// CustomHTTP // CustomHTTP
ParamCustomHTTPURL string ParamCustomHTTPURL string
ParamCustomHTTPSecret string ParamCustomHTTPSecret string
@@ -128,6 +132,14 @@ func (this *UpdatePopupAction) RunPost(params struct {
apiParams["apiKey"] = params.ParamApiKey apiParams["apiKey"] = params.ParamApiKey
apiParams["apiSecret"] = params.ParamApiSecret apiParams["apiSecret"] = params.ParamApiSecret
case "cloudFlare":
params.Must.
Field("cloudFlareAPIKey", params.CloudFlareAPIKey).
Require("请输入API密钥").
Field("cloudFlareEmail", params.CloudFlareEmail).
Email("请输入正确格式的邮箱地址")
apiParams["apiKey"] = params.CloudFlareAPIKey
apiParams["email"] = params.CloudFlareEmail
case "customHTTP": case "customHTTP":
params.Must. params.Must.
Field("paramCustomHTTPURL", params.ParamCustomHTTPURL). Field("paramCustomHTTPURL", params.ParamCustomHTTPURL).

View File

@@ -22,7 +22,7 @@
<input type="text" name="dnsName" maxlength="64" style="width:10em" v-model="dnsName"/> <input type="text" name="dnsName" maxlength="64" style="width:10em" v-model="dnsName"/>
<span class="ui label">.主域名</span> <span class="ui label">.主域名</span>
</div> </div>
<p class="comment">和主域名一起组成子域名。</p> <p class="comment">当前集群的子域名,和主域名一起组成集群节点的子域名。</p>
</td> </td>
</tr> </tr>
<tr> <tr>

View File

@@ -65,7 +65,7 @@
<input type="text" name="dnsName" maxlength="64" style="width:10em"/> <input type="text" name="dnsName" maxlength="64" style="width:10em"/>
<span class="ui label">.主域名</span> <span class="ui label">.主域名</span>
</div> </div>
<p class="comment">和主域名一起组成子域名。</p> <p class="comment">当前集群的子域名,和主域名一起组成集群节点的子域名。</p>
</td> </td>
</tr> </tr>
</table> </table>

View File

@@ -60,6 +60,24 @@
</tr> </tr>
</tbody> </tbody>
<!-- CloudFlare -->
<tbody v-if="type == 'cloudFlare'">
<tr>
<td>API密钥 *</td>
<td>
<input type="text" name="cloudFlareAPIKey" maxlength="100"/>
<p class="comment">在个人资料中的"API令牌"--"API密钥"--"Global API Key"中获取。</p>
</td>
</tr>
<tr>
<td>账号邮箱 *</td>
<td>
<input type="text" name="cloudFlareEmail" maxlength="100"/>
<p class="comment">登录账号使用的邮箱。</p>
</td>
</tr>
</tbody>
<!-- DNS.COM --> <!-- DNS.COM -->
<tbody v-if="type == 'dnscom'"> <tbody v-if="type == 'dnscom'">
<tr> <tr>

View File

@@ -43,6 +43,20 @@
</tr> </tr>
</tbody> </tbody>
<!-- CloudFlare -->
<tbody v-if="provider.type == 'cloudFlare'">
<tr>
<td>API密钥</td>
<td>
{{provider.apiParams.apiKey}}
</td>
</tr>
<tr>
<td>账号邮箱</td>
<td>{{provider.apiParams.email}}</td>
</tr>
</tbody>
<!-- CustomHTTP --> <!-- CustomHTTP -->
<tbody v-if="provider.type == 'customHTTP'"> <tbody v-if="provider.type == 'customHTTP'">
<tr> <tr>

View File

@@ -60,6 +60,25 @@
</tr> </tr>
</tbody> </tbody>
<!-- CloudFlare -->
<tbody v-if="provider.type == 'cloudFlare'">
<tr>
<td>API密钥 *</td>
<td>
<input type="text" name="cloudFlareAPIKey" maxlength="100" v-model="provider.params.apiKey"/>
<p class="comment">在个人资料中的"API令牌"--"API密钥"--"Global API Key"中获取。</p>
</td>
</tr>
<tr>
<td>账号邮箱 *</td>
<td>
<input type="text" name="cloudFlareEmail" maxlength="100" v-model="provider.params.email"/>
<p class="comment">登录账号使用的邮箱。</p>
</td>
</tr>
</tbody>
<!-- 自定义HTTP--> <!-- 自定义HTTP-->
<tbody v-if="provider.type == 'customHTTP'"> <tbody v-if="provider.type == 'customHTTP'">
<tr> <tr>