mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Merge pull request #541 from Taikuh/connected-devices
List Connected devices in bridged AP mode
This commit is contained in:
commit
06109bf82e
@ -663,6 +663,10 @@ msgstr "Attempting to start TOR"
|
||||
msgid "Attempting to stop TOR"
|
||||
msgstr "Attempting to stop TOR"
|
||||
|
||||
#: template/dashboard.php
|
||||
msgid "Bridged AP mode is enabled. For Hostname and IP, see your router's admin page."
|
||||
msgstr "Bridged AP mode is enabled. For Hostname and IP, see your router's admin page."
|
||||
|
||||
#: common form controls
|
||||
msgid "Save settings"
|
||||
msgstr "Save settings"
|
||||
|
@ -5,7 +5,14 @@ if ($arrHostapdConf['WifiAPEnable'] == 1) {
|
||||
} else {
|
||||
$client_iface = RASPI_WIFI_CLIENT_INTERFACE;
|
||||
}
|
||||
exec('cat '.RASPI_DNSMASQ_LEASES.'| grep -E $(arp -i '.$client_iface.' -n | grep -oE "(([0-9]|[a-f]|[A-F]){2}:){5}([0-9]|[a-f]|[A-F]){2}" | tr "\n" "\|" | sed "s/.$//")', $clients);
|
||||
$MACPattern = '"([[:xdigit:]]{2}:){5}[[:xdigit:]]{2}"';
|
||||
if ($arrHostapdConf['BridgedEnable'] == 1) {
|
||||
$moreLink = "index.php?page=hostapd_conf";
|
||||
exec('iw dev '.$client_iface.' station dump | grep -oE '.$MACPattern, $clients);
|
||||
} else {
|
||||
$moreLink = "index.php?page=dhcpd_conf";
|
||||
exec('cat '.RASPI_DNSMASQ_LEASES.'| grep -E $(iw dev '.$client_iface.' station dump | grep -oE '.$MACPattern.' | paste -sd "|")', $clients);
|
||||
}
|
||||
$ifaceStatus = $wlan0up ? "up" : "down";
|
||||
?>
|
||||
<div class="row">
|
||||
@ -71,25 +78,38 @@ $ifaceStatus = $wlan0up ? "up" : "down";
|
||||
<table class="table table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php if ($arrHostapdConf['BridgedEnable'] == 1) : ?>
|
||||
<th><?php echo _("MAC Address"); ?></th>
|
||||
<?php else : ?>
|
||||
<th><?php echo _("Host name"); ?></th>
|
||||
<th><?php echo _("IP Address"); ?></th>
|
||||
<th><?php echo _("MAC Address"); ?></th>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach (array_slice($clients,0, 2) as $client) : ?>
|
||||
<?php $props = explode(' ', $client) ?>
|
||||
<?php if ($arrHostapdConf['BridgedEnable'] == 1) : ?>
|
||||
<tr>
|
||||
<td><small class="text-muted"><?php echo _("Bridged AP mode is enabled. For Hostname and IP, see your router's admin page.");?></small></td>
|
||||
</tr>
|
||||
<?php endif; ?>
|
||||
<?php foreach (array_slice($clients,0, 2) as $client) : ?>
|
||||
<tr>
|
||||
<?php if ($arrHostapdConf['BridgedEnable'] == 1): ?>
|
||||
<td><?php echo htmlspecialchars($client, ENT_QUOTES) ?></td>
|
||||
<?php else : ?>
|
||||
<?php $props = explode(' ', $client) ?>
|
||||
<td><?php echo htmlspecialchars($props[3], ENT_QUOTES) ?></td>
|
||||
<td><?php echo htmlspecialchars($props[2], ENT_QUOTES) ?></td>
|
||||
<td><?php echo htmlspecialchars($props[1], ENT_QUOTES) ?></td>
|
||||
<?php endif; ?>
|
||||
</tr>
|
||||
<?php endforeach ?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php if (sizeof($clients) >2) : ?>
|
||||
<div class="col-lg-12 float-right">
|
||||
<a class="btn btn-outline-info" role="button" href="index.php?page=dhcpd_conf"><?php echo _("More");?> <i class="fas fa-chevron-right"></i></a>
|
||||
<a class="btn btn-outline-info" role="button" href="<?php echo $moreLink ?>"><?php echo _("More");?> <i class="fas fa-chevron-right"></i></a>
|
||||
</div>
|
||||
<?php elseif (sizeof($clients) ==0) : ?>
|
||||
<div class="col-lg-12 mt-3"><?php echo _("No connected devices");?></div>
|
||||
|
Loading…
Reference in New Issue
Block a user