mirror of
https://github.com/billz/raspap-webgui.git
synced 2025-03-01 10:31:47 +00:00
Transfer template logic to includes, see #749 thx @mp035
This commit is contained in:
@@ -97,5 +97,13 @@ function DisplayWPAConfig()
|
||||
connectedWifiStations($networks);
|
||||
sortNetworksByRSSI($networks);
|
||||
|
||||
echo renderTemplate("configure_client", compact("status"));
|
||||
$clientInterface = $_SESSION['wifi_client_interface'];
|
||||
|
||||
exec('ip a show '.$clientInterface, $stdoutIp);
|
||||
$stdoutIpAllLinesGlued = implode(" ", $stdoutIp);
|
||||
$stdoutIpWRepeatedSpaces = preg_replace('/\s\s+/', ' ', $stdoutIpAllLinesGlued);
|
||||
preg_match('/state (UP|DOWN)/i', $stdoutIpWRepeatedSpaces, $matchesState) || $matchesState[1] = 'unknown';
|
||||
$ifaceStatus = strtolower($matchesState[1]) ? "up" : "down";
|
||||
|
||||
echo renderTemplate("configure_client", compact("status", "clientInterface", "ifaceStatus"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user