From df429064c6d76dc228faa4b13fcb5e7b8b6648ed Mon Sep 17 00:00:00 2001 From: glaszig Date: Mon, 19 Aug 2019 01:06:44 +0100 Subject: [PATCH] fixed up dhcp template --- includes/dhcp.php | 6 +++++- templates/dhcp.php | 50 +++++++++++++++++----------------------------- 2 files changed, 23 insertions(+), 33 deletions(-) diff --git a/includes/dhcp.php b/includes/dhcp.php index a70cdb13..7536cca0 100755 --- a/includes/dhcp.php +++ b/includes/dhcp.php @@ -132,12 +132,16 @@ function DisplayDHCPConfig() } } + exec("ip -o link show | awk -F': ' '{print $2}'", $interfaces); + exec('cat ' . RASPI_DNSMASQ_LEASES, $leases); + echo renderTemplate("dhcp", compact( "status", "serviceStatus", "RangeStart", "RangeEnd", "arrRangeLeaseTime", "mselected", "hselected", "dselected", "infiniteselected", - "dnsmasq_state", "conf", "dhcpHost" + "dnsmasq_state", "conf", "dhcpHost", + "interfaces", "leases" )); } diff --git a/templates/dhcp.php b/templates/dhcp.php index acfcba75..228691e6 100644 --- a/templates/dhcp.php +++ b/templates/dhcp.php @@ -26,19 +26,11 @@
@@ -68,19 +60,17 @@ $select.'>'.htmlspecialchars($inet, ENT_QUOTES).'' , PHP_EOL; - + " name="savedhcpdsettings" /> -'; -} else { - echo''; -} -?> + + " name="stopdhcpd" /> + + " name="startdhcpd" /> +
@@ -103,17 +93,13 @@ if ($dnsmasq_state) { -'.PHP_EOL; -$lease_items = explode(' ', $lease); -foreach ($lease_items as $lease_item) { - echo ' '.htmlspecialchars($lease_item, ENT_QUOTES).''.PHP_EOL; -} -echo ' '.PHP_EOL; -}; -?> + + + + + + +