diff --git a/files/app/main/status/e/network.ut b/files/app/main/status/e/network.ut
index b4a72cae..16f0d0b1 100755
--- a/files/app/main/status/e/network.ut
+++ b/files/app/main/status/e/network.ut
@@ -240,7 +240,7 @@ const gateway_altnet = dmz_mode === 1 ? dhcp.gateway : "";
Gateway IP address for this LAN network
-
+
@@ -249,7 +249,7 @@ const gateway_altnet = dmz_mode === 1 ? dhcp.gateway : "";
Netmask for this LAN network
-
+
@@ -258,7 +258,7 @@ const gateway_altnet = dmz_mode === 1 ? dhcp.gateway : "";
Start offset from base for allocating DHCP addresses
-
+
@@ -267,7 +267,7 @@ const gateway_altnet = dmz_mode === 1 ? dhcp.gateway : "";
End offset from base for allocating DHCP addresses
-
+
@@ -278,7 +278,7 @@ const gateway_altnet = dmz_mode === 1 ? dhcp.gateway : "";
Gateway IP address for 44Net LAN network
-
+
@@ -287,7 +287,7 @@ const gateway_altnet = dmz_mode === 1 ? dhcp.gateway : "";
Netmask for 44Net LAN network
-
+
@@ -296,7 +296,7 @@ const gateway_altnet = dmz_mode === 1 ? dhcp.gateway : "";
Start offset from base for allocating DHCP addresses
-
+
@@ -305,7 +305,7 @@ const gateway_altnet = dmz_mode === 1 ? dhcp.gateway : "";
End offset from base for allocating DHCP addresses
-
+
@@ -521,11 +521,45 @@ const gateway_altnet = dmz_mode === 1 ? dhcp.gateway : "";
}
function validateLANRange()
{
- validateRange(htmx.find("input[name=lan_dhcp_ip]"), htmx.find("input[name=lan_dhcp_netmask]"), htmx.find("input[name=lan_dhcp_start]"), htmx.find("input[name=lan_dhcp_end]"), htmx.find("#lan_dhcp_start_m"), htmx.find("#lan_dhcp_end_m"));
+ const ip = htmx.find("input[name=lan_dhcp_ip]");
+ const netmask = htmx.find("input[name=lan_dhcp_netmask]");
+ const start = htmx.find("input[name=lan_dhcp_start]");
+ const end = htmx.find("input[name=lan_dhcp_end]");
+ const startm = htmx.find("#lan_dhcp_start_m");
+ const endm = htmx.find("#lan_dhcp_end_m");
+ validateRange(ip, netmask, start, end, startm, endm);
+ if (ip.validity.valid && netmask.validity.valid && start.validity.valid && end.validity.valid) {
+ htmx.ajax("PUT", "{{request.env.REQUEST_URI}}", {
+ values: {
+ lan_dhcp_ip: ip.value,
+ lan_dhcp_netmask: netmask.value,
+ lan_dhcp_start: start.value,
+ lan_dhcp_end: end.value
+ },
+ swap: "none"
+ });
+ }
}
function validateLAN44Range()
{
- validateRange(htmx.find("input[name=lan44_dhcp_ip]"), htmx.find("input[name=lan44_dhcp_netmask]"), htmx.find("input[name=lan44_dhcp_start]"), htmx.find("input[name=lan44_dhcp_end]"), htmx.find("#lan44_dhcp_start_m"), htmx.find("#lan44_dhcp_end_m"));
+ const ip = htmx.find("input[name=lan44_dhcp_ip]");
+ const netmask = htmx.find("input[name=lan44_dhcp_netmask]");
+ const start = htmx.find("input[name=lan44_dhcp_start]");
+ const end = htmx.find("input[name=lan44_dhcp_end]");
+ const startm = htmx.find("#lan44_dhcp_start_m");
+ const endm = htmx.find("#lan44_dhcp_end_m");
+ validateRange(ip, netmask, start, end, startm, endm);
+ if (ip.validity.valid && netmask.validity.valid && start.validity.valid && end.validity.valid) {
+ htmx.ajax("PUT", "{{request.env.REQUEST_URI}}", {
+ values: {
+ lan44_dhcp_ip: ip.value,
+ lan44_dhcp_netmask: netmask.value,
+ lan44_dhcp_start: start.value,
+ lan44_dhcp_end: end.value
+ },
+ swap: "none"
+ });
+ }
}
htmx.on("input[name=lan_dhcp_ip]", "input", validateLANRange);
htmx.on("input[name=lan_dhcp_netmask]", "input", validateLANRange);