Correct internet device GUI and udev config

This commit is contained in:
Christian Zeitnitz
2021-03-10 23:45:04 +01:00
parent e8d0fab463
commit 76e2eecaec
9 changed files with 46 additions and 35 deletions

View File

@@ -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";

View File

@@ -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;
}
}
?>

View File

@@ -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;

View File

@@ -157,3 +157,4 @@ function getWifiInterface()
}
}
?>