dns/ddclient: fix rendering template when if but no interface

Use a validation in this case as it seems to be a hard requirement.
Also shuffle the dialog a little to move the fields into a more
logical sequence.
This commit is contained in:
Franco Fichtner
2023-04-13 09:02:12 +02:00
parent db794e2bf3
commit 0f0e8c3531
3 changed files with 24 additions and 11 deletions
@@ -5,6 +5,11 @@
<type>checkbox</type>
<help>Enable this virtual server</help>
</field>
<field>
<id>account.description</id>
<label>Description</label>
<type>text</type>
</field>
<field>
<id>account.service</id>
<label>Service</label>
@@ -71,6 +76,11 @@
<type>dropdown</type>
<help>How to determine the address to use for this host</help>
</field>
<field>
<id>account.interface</id>
<label>Interface to monitor</label>
<type>dropdown</type>
</field>
<field>
<id>account.checkip_timeout</id>
<label>Check ip timeout</label>
@@ -84,14 +94,4 @@
<help>Force update using HTTPS, please note setting this option will enforce https updates on all accounts
as ddclient only supports SSL=yes on a global level (the check ip service may still use HTTP on other services)</help>
</field>
<field>
<id>account.interface</id>
<label>Interface to monitor</label>
<type>dropdown</type>
</field>
<field>
<id>account.description</id>
<label>Description</label>
<type>text</type>
</field>
</form>
@@ -153,6 +153,11 @@
<web_zoneedit>zoneedit</web_zoneedit>
<if>Interface</if>
</OptionValues>
<Constraints>
<check001>
<reference>interface.check001</reference>
</check001>
</Constraints>
</checkip>
<checkip_timeout type="IntegerField">
<default>10</default>
@@ -167,6 +172,14 @@
<interface type="InterfaceField">
<Required>N</Required>
<multiple>N</multiple>
<Constraints>
<check001>
<ValidationMessage>An interface is required for the selected check method</ValidationMessage>
<type>SetIfConstraint</type>
<field>checkip</field>
<check>if</check>
</check001>
</Constraints>
</interface>
<description type="TextField">
<Required>N</Required>
@@ -172,4 +172,4 @@ class Cloudflare(BaseAccount):
)
return False
return False