mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-25 00:50:29 +00:00
Bugfix: Parse dhcp-host entries
This commit is contained in:
parent
871d5353a5
commit
1eec097b80
2 changed files with 6 additions and 3 deletions
|
@ -45,12 +45,15 @@ function DisplayDHCPConfig()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getWifiInterface();
|
getWifiInterface();
|
||||||
|
$ap_iface = $_SESSION['ap_interface'];
|
||||||
$serviceStatus = $dnsmasq_state ? "up" : "down";
|
$serviceStatus = $dnsmasq_state ? "up" : "down";
|
||||||
exec('cat '. RASPI_DNSMASQ_PREFIX.'raspap.conf', $return);
|
exec('cat '. RASPI_DNSMASQ_PREFIX.'raspap.conf', $return);
|
||||||
$conf = ParseConfig($return);
|
$conf = ParseConfig($return);
|
||||||
|
exec('cat '. RASPI_DNSMASQ_PREFIX.$ap_iface.'.conf', $return);
|
||||||
|
$conf = array_merge(ParseConfig($return));
|
||||||
|
$hosts = (array)$conf['dhcp-host'];
|
||||||
exec("ip -o link show | awk -F': ' '{print $2}'", $interfaces);
|
exec("ip -o link show | awk -F': ' '{print $2}'", $interfaces);
|
||||||
exec('cat ' . RASPI_DNSMASQ_LEASES, $leases);
|
exec('cat ' . RASPI_DNSMASQ_LEASES, $leases);
|
||||||
$ap_iface = $_SESSION['ap_interface'];
|
|
||||||
|
|
||||||
echo renderTemplate(
|
echo renderTemplate(
|
||||||
"dhcp", compact(
|
"dhcp", compact(
|
||||||
|
@ -59,7 +62,7 @@ function DisplayDHCPConfig()
|
||||||
"dnsmasq_state",
|
"dnsmasq_state",
|
||||||
"ap_iface",
|
"ap_iface",
|
||||||
"conf",
|
"conf",
|
||||||
"dhcpHost",
|
"hosts",
|
||||||
"interfaces",
|
"interfaces",
|
||||||
"leases"
|
"leases"
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<h4 class="mt-3 mb-3"><?php echo _("Static leases") ?></h4>
|
<h4 class="mt-3 mb-3"><?php echo _("Static leases") ?></h4>
|
||||||
|
|
||||||
<div class="dhcp-static-leases js-dhcp-static-lease-container">
|
<div class="dhcp-static-leases js-dhcp-static-lease-container">
|
||||||
<?php foreach ($dhcpHost as $host) : ?>
|
<?php foreach ($hosts as $host) : ?>
|
||||||
<?php list($mac, $ip) = array_map("trim", explode(",", $host)); ?>
|
<?php list($mac, $ip) = array_map("trim", explode(",", $host)); ?>
|
||||||
<div class="row dhcp-static-lease-row js-dhcp-static-lease-row">
|
<div class="row dhcp-static-lease-row js-dhcp-static-lease-row">
|
||||||
<div class="col-md-5 col-xs-5">
|
<div class="col-md-5 col-xs-5">
|
||||||
|
|
Loading…
Reference in a new issue