mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Correct internet device GUI and udev config
This commit is contained in:
@@ -96,12 +96,12 @@ function DisplayDashboard(&$extraFooterScripts)
|
||||
$clientinfo=array("name"=>"none","type"=>-1,"connected"=>"n");
|
||||
$raspi_client=$_SESSION['wifi_client_interface'];
|
||||
load_client_config();
|
||||
$clients = getClients(false);
|
||||
if(!empty($clients)) {
|
||||
$ncl=$clients["clients"];
|
||||
$client_devs = getClients(false);
|
||||
if(!empty($client_devs)) {
|
||||
$ncl=$client_devs["clients"];
|
||||
if($ncl > 0) {
|
||||
$ty=-1;
|
||||
foreach($clients["device"] as $dev) {
|
||||
foreach($client_devs["device"] as $dev) {
|
||||
if(($id=array_search($dev["type"],$_SESSION["net-device-types"])) > $ty && !$dev["isAP"]) {
|
||||
$ty=$id;
|
||||
$clientinfo=$dev;
|
||||
@@ -162,6 +162,7 @@ function DisplayDashboard(&$extraFooterScripts)
|
||||
$client_interface = $clientinfo["name"];
|
||||
}
|
||||
$apInterface = $_SESSION['ap_interface'];
|
||||
$clientInterface = $raspi_client;
|
||||
$MACPattern = '"([[:xdigit:]]{2}:){5}[[:xdigit:]]{2}"';
|
||||
if (getBridgedState()) {
|
||||
$moreLink = "hostapd_conf";
|
||||
|
@@ -728,6 +728,8 @@ function getNightmode(){
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// search array for matching string and return only first matching group
|
||||
function preg_only_match($pat,$haystack) {
|
||||
$match = "";
|
||||
@@ -738,5 +740,6 @@ function preg_only_match($pat,$haystack) {
|
||||
}
|
||||
return $match;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
@@ -137,6 +137,10 @@ function getClients($simple=true) {
|
||||
break;
|
||||
default:
|
||||
}
|
||||
if (!isset($cl["device"][$i]["signal"])){
|
||||
$cl["device"][$i]["signal"]= $cl["device"][$i]["connected"] == "n" ? "-100 dB (0%)": "0 dB (100%)";;
|
||||
}
|
||||
if (!isset($cl["device"][$i]["isAP"])) $cl["device"][$i]["isAP"]=false;
|
||||
}
|
||||
}
|
||||
return $cl;
|
||||
|
@@ -157,3 +157,4 @@ function getWifiInterface()
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user