DNS服务商账号增加“最小TTL”选项

This commit is contained in:
GoEdgeLab
2024-05-12 09:33:30 +08:00
parent d6fdd9cd16
commit aa7b5c120c
6 changed files with 62 additions and 13 deletions

View File

@@ -84,6 +84,8 @@ func (this *CreatePopupAction) RunPost(params struct {
ParamEdgeDNSAPIAccessKeyId string ParamEdgeDNSAPIAccessKeyId string
ParamEdgeDNSAPIAccessKeySecret string ParamEdgeDNSAPIAccessKeySecret string
MinTTL int32
Must *actions.Must Must *actions.Must
CSRF *actionutils.CSRF CSRF *actionutils.CSRF
}) { }) {
@@ -177,6 +179,7 @@ func (this *CreatePopupAction) RunPost(params struct {
Name: params.Name, Name: params.Name,
Type: params.Type, Type: params.Type,
ApiParamsJSON: apiParams.AsJSON(), ApiParamsJSON: apiParams.AsJSON(),
MinTTL: params.MinTTL,
}) })
if err != nil { if err != nil {
this.ErrorPage(err) this.ErrorPage(err)

View File

@@ -59,6 +59,7 @@ func (this *ProviderAction) RunGet(params struct {
"name": provider.Name, "name": provider.Name,
"type": provider.Type, "type": provider.Type,
"typeName": provider.TypeName, "typeName": provider.TypeName,
"minTTL": provider.MinTTL,
"apiParams": apiParams, "apiParams": apiParams,
"localEdgeDNS": localEdgeDNSMap, "localEdgeDNS": localEdgeDNSMap,
} }

View File

@@ -50,6 +50,7 @@ func (this *UpdatePopupAction) RunGet(params struct {
"name": provider.Name, "name": provider.Name,
"type": provider.Type, "type": provider.Type,
"typeName": provider.TypeName, "typeName": provider.TypeName,
"minTTL": provider.MinTTL,
"params": apiParams, "params": apiParams,
} }
@@ -114,6 +115,8 @@ func (this *UpdatePopupAction) RunPost(params struct {
ParamEdgeDNSAPIAccessKeyId string ParamEdgeDNSAPIAccessKeyId string
ParamEdgeDNSAPIAccessKeySecret string ParamEdgeDNSAPIAccessKeySecret string
MinTTL int32
Must *actions.Must Must *actions.Must
CSRF *actionutils.CSRF CSRF *actionutils.CSRF
}) { }) {
@@ -208,6 +211,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
_, err := this.RPC().DNSProviderRPC().UpdateDNSProvider(this.AdminContext(), &pb.UpdateDNSProviderRequest{ _, err := this.RPC().DNSProviderRPC().UpdateDNSProvider(this.AdminContext(), &pb.UpdateDNSProviderRequest{
DnsProviderId: params.ProviderId, DnsProviderId: params.ProviderId,
Name: params.Name, Name: params.Name,
MinTTL: params.MinTTL,
ApiParamsJSON: apiParams.AsJSON(), ApiParamsJSON: apiParams.AsJSON(),
}) })
if err != nil { if err != nil {

View File

@@ -21,7 +21,7 @@
<p class="comment" v-if="typeDescription.length > 0">{{typeDescription}} 系统会保留原有域名下的域名解析,请放心使用。<span v-if="!teaIsPlus">购买商业版可获得更多厂商支持。</span></p> <p class="comment" v-if="typeDescription.length > 0">{{typeDescription}} 系统会保留原有域名下的域名解析,请放心使用。<span v-if="!teaIsPlus">购买商业版可获得更多厂商支持。</span></p>
</td> </td>
</tr> </tr>
<tr> <tr v-show="type.length > 0">
<td colspan="2">API参数</td> <td colspan="2">API参数</td>
</tr> </tr>
@@ -374,6 +374,24 @@
</td> </td>
</tr> </tr>
</tbody> </tbody>
<!-- 更多选项 -->
<tr>
<td colspan="2"><more-options-indicator></more-options-indicator></td>
</tr>
<tbody v-show="moreOptionsVisible">
<tr>
<td>最小TTL</td>
<td>
<div class="ui right labeled input">
<input type="text" name="minTTL" size="4" maxlength="6" style="width: 6em"/>
<span class="ui label"></span>
</div>
<p class="comment">生成的DNS时可以使用的最小TTL请根据你选择的服务商和你在服务商中的账号等级进行填写不填写或者0表示默认。</p>
</td>
</tr>
</tbody>
</table> </table>
<submit-btn></submit-btn> <submit-btn></submit-btn>

View File

@@ -278,6 +278,11 @@
<td>{{provider.apiParams.secret}}</td> <td>{{provider.apiParams.secret}}</td>
</tr> </tr>
</tbody> </tbody>
<tr v-if="provider.minTTL > 0">
<td>最小TTL</td>
<td>{{provider.minTTL}}秒</td>
</tr>
</table> </table>

View File

@@ -376,6 +376,24 @@
</td> </td>
</tr> </tr>
</tbody> </tbody>
<!-- 更多选项 -->
<tr>
<td colspan="2"><more-options-indicator></more-options-indicator></td>
</tr>
<tbody v-show="moreOptionsVisible">
<tr>
<td>最小TTL</td>
<td>
<div class="ui right labeled input">
<input type="text" name="minTTL" size="4" maxlength="6" style="width: 6em" v-model="provider.minTTL"/>
<span class="ui label"></span>
</div>
<p class="comment">生成的DNS时可以使用的最小TTL请根据你选择的服务商和你在服务商中的账号等级进行填写不填写或者0表示默认。</p>
</td>
</tr>
</tbody>
</table> </table>
<submit-btn></submit-btn> <submit-btn></submit-btn>