mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Indicated connected network
This commit is contained in:
parent
b353dd77a8
commit
9492330196
@ -16,7 +16,7 @@ function DisplayWPAConfig(){
|
|||||||
|
|
||||||
foreach($known_return as $line) {
|
foreach($known_return as $line) {
|
||||||
if (preg_match('/network\s*=/', $line)) {
|
if (preg_match('/network\s*=/', $line)) {
|
||||||
$network = array('visible' => false, 'configured' => true);
|
$network = array('visible' => false, 'configured' => true, 'connected' => false);
|
||||||
} elseif ($network !== null) {
|
} elseif ($network !== null) {
|
||||||
if (preg_match('/^\s*}\s*$/', $line)) {
|
if (preg_match('/^\s*}\s*$/', $line)) {
|
||||||
$networks[$ssid] = $network;
|
$networks[$ssid] = $network;
|
||||||
@ -126,10 +126,18 @@ function DisplayWPAConfig(){
|
|||||||
'protocol' => ConvertToSecurity($arrNetwork[3]),
|
'protocol' => ConvertToSecurity($arrNetwork[3]),
|
||||||
'channel' => ConvertToChannel($arrNetwork[1]),
|
'channel' => ConvertToChannel($arrNetwork[1]),
|
||||||
'passphrase' => '',
|
'passphrase' => '',
|
||||||
'visible' => true
|
'visible' => true,
|
||||||
|
'connected' => false
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exec( 'iwconfig wlan0', $iwconfig_return );
|
||||||
|
foreach ($iwconfig_return as $line) {
|
||||||
|
if (preg_match( '/ESSID:\"(.+)\"/i',$line,$iwconfig_ssid )) {
|
||||||
|
$networks[$iwconfig_ssid[1]]['connected'] = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -156,11 +164,14 @@ function DisplayWPAConfig(){
|
|||||||
<?php $index = 0; ?>
|
<?php $index = 0; ?>
|
||||||
<?php foreach ($networks as $ssid => $network) { ?>
|
<?php foreach ($networks as $ssid => $network) { ?>
|
||||||
<tr>
|
<tr>
|
||||||
<?php if ($network['configured']) { ?>
|
<td>
|
||||||
<td><i class="fa fa-check-circle fa-fw"></i></td>
|
<?php if ($network['configured']) { ?>
|
||||||
<?php } else { ?>
|
<i class="fa fa-check-circle fa-fw"></i>
|
||||||
<td></td>
|
<?php } ?>
|
||||||
<?php } ?>
|
<?php if ($network['connected']) { ?>
|
||||||
|
<i class="fa fa-exchange fa-fw"></i>
|
||||||
|
<?php } ?>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="hidden" name="ssid<?php echo $index ?>" value="<?php echo $ssid ?>" />
|
<input type="hidden" name="ssid<?php echo $index ?>" value="<?php echo $ssid ?>" />
|
||||||
<?php echo $ssid ?>
|
<?php echo $ssid ?>
|
||||||
|
Loading…
Reference in New Issue
Block a user