ddns: Add ability to update IPv4 or IPv6 only (#342)

* ddns: Add ability to resolve IPv4 or IPv6 only

* Fix bugs

* cdn cache
This commit is contained in:
UUBulb
2024-03-30 11:00:55 +08:00
committed by GitHub
parent 506c87dbd8
commit f647a5f8e6
12 changed files with 61 additions and 5 deletions

View File

@@ -619,6 +619,12 @@ other = "Enable Show in Service"
[EnableDDNS]
other = "Enable DDNS"
[EnableIPv4]
other = "Enable DDNS IPv4"
[EnableIpv6]
other = "Enable DDNS IPv6"
[DDNSDomain]
other = "DDNS Domain"

View File

@@ -619,6 +619,12 @@ other = "Mostrar en servicio"
[EnableDDNS]
other = "Habilitar DDNS"
[EnableIPv4]
other = "Habilitar DDNS IPv4"
[EnableIpv6]
other = "Habilitar DDNS IPv6"
[DDNSDomain]
other = "Dominio DDNS"

View File

@@ -619,6 +619,12 @@ other = "在服务中显示"
[EnableDDNS]
other = "启用DDNS"
[EnableIPv4]
other = "启用DDNS IPv4"
[EnableIpv6]
other = "启用DDNS IPv6"
[DDNSDomain]
other = "DDNS域名"

View File

@@ -619,6 +619,12 @@ other = "在服務中顯示"
[EnableDDNS]
other = "啟用DDNS"
[EnableIPv4]
other = "啟用DDNS IPv4"
[EnableIpv6]
other = "啟用DDNS IPv6"
[DDNSDomain]
other = "DDNS網域"

View File

@@ -327,6 +327,16 @@ function addOrEditServer(server, conf) {
} else {
modal.find(".ui.enableddns.checkbox").checkbox("set unchecked");
}
if (server && server.EnableIPv4) {
modal.find(".ui.enableipv4.checkbox").checkbox("set checked");
} else {
modal.find(".ui.enableipv4.checkbox").checkbox("set unchecked");
}
if (server && server.EnableIpv6) {
modal.find(".ui.enableipv6.checkbox").checkbox("set checked");
} else {
modal.find(".ui.enableipv6.checkbox").checkbox("set unchecked");
}
showFormModal(".server.modal", "#serverForm", "/api/server");
}

View File

@@ -10,7 +10,7 @@
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/semantic-ui/2.4.1/semantic.min.js"></script>
<script src="/static/semantic-ui-alerts.min.js"></script>
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/vue/2.6.14/vue.min.js"></script>
<script src="/static/main.js?v20240224"></script>
<script src="/static/main.js?v20240330"></script>
<script>
(function () {
updateLang({{.LANG }});

View File

@@ -32,6 +32,18 @@
<label>{{tr "EnableDDNS"}}</label>
</div>
</div>
<div class="field">
<div class="ui enableipv4 checkbox">
<input name="EnableIPv4" type="checkbox" tabindex="0" />
<label>{{tr "EnableIPv4"}}</label>
</div>
</div>
<div class="field">
<div class="ui enableipv6 checkbox">
<input name="EnableIpv6" type="checkbox" tabindex="0" />
<label>{{tr "EnableIpv6"}}</label>
</div>
</div>
<div class="field">
<label>{{tr "DDNSDomain"}}</label>
<input type="text" name="DDNSDomain" placeholder="{{tr "DDNSDomain"}}">

View File

@@ -30,6 +30,8 @@
<th>{{tr "VersionNumber"}}</th>
<th>{{tr "HideForGuest"}}</th>
<th>{{tr "EnableDDNS"}}</th>
<th>{{tr "EnableIPv4"}}</th>
<th>{{tr "EnableIpv6"}}</th>
<th>{{tr "DDNSDomain"}}</th>
<th>{{tr "Secret"}}</th>
<th>{{tr "OneKeyInstall"}}</th>
@@ -48,6 +50,8 @@
<td>{{$server.Host.Version}}</td>
<td>{{$server.HideForGuest}}</td>
<td>{{$server.EnableDDNS}}</td>
<td>{{$server.EnableIPv4}}</td>
<td>{{$server.EnableIpv6}}</td>
<td>{{$server.DDNSDomain}}</td>
<td>
<button class="ui icon green mini button" data-clipboard-text="{{$server.Secret}}" data-tooltip="{{tr "ClickToCopy"}}">

View File

@@ -13,7 +13,7 @@
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/semantic-ui/2.4.1/semantic.min.js"></script>
<script src="/static/semantic-ui-alerts.min.js"></script>
<script src="https://lf6-cdn-tos.bytecdntp.com/cdn/expire-1-y/vue/2.6.14/vue.min.js"></script>
<script src="/static/main.js?v20240224"></script>
<script src="/static/main.js?v20240330"></script>
<script src="/static/theme-default/js/mixin.js?v20240302"></script>
<script>
(function () {