mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Correct internet device GUI and udev config
This commit is contained in:
parent
e8d0fab463
commit
76e2eecaec
@ -88,7 +88,7 @@ if (isset($_POST['interface'])) {
|
|||||||
$cfg['static'] = $_POST[$int.'-static'];
|
$cfg['static'] = $_POST[$int.'-static'];
|
||||||
$cfg['failover'] = $_POST[$int.'-failover'];
|
$cfg['failover'] = $_POST[$int.'-failover'];
|
||||||
}
|
}
|
||||||
if (write_php_ini($cfg, RASPI_CONFIG_NETWORKING.'/'.$file)) {
|
if (write_php_ini($cfg, RASPI_CONFIG.'/networking/'.$file)) {
|
||||||
$jsonData = ['return'=>0,'output'=>['Successfully Updated Network Configuration']];
|
$jsonData = ['return'=>0,'output'=>['Successfully Updated Network Configuration']];
|
||||||
} else {
|
} else {
|
||||||
$jsonData = ['return'=>1,'output'=>['Error saving network configuration to file']];
|
$jsonData = ['return'=>1,'output'=>['Error saving network configuration to file']];
|
||||||
|
@ -130,8 +130,8 @@ function setupBtns() {
|
|||||||
$('#btnSummaryRefresh').click(function(){getAllInterfaces();});
|
$('#btnSummaryRefresh').click(function(){getAllInterfaces();});
|
||||||
$('.intsave').click(function(){
|
$('.intsave').click(function(){
|
||||||
var int = $(this).data('int');
|
var int = $(this).data('int');
|
||||||
saveNetDeviceSettings(int);
|
var opts = $(this).data('opts');
|
||||||
saveNetworkSettings(int);
|
saveNetDeviceSettings(int,opts);
|
||||||
});
|
});
|
||||||
$('.intapply').click(function(){
|
$('.intapply').click(function(){
|
||||||
applyNetworkSettings();
|
applyNetworkSettings();
|
||||||
|
@ -25,6 +25,8 @@ define('RASPI_TORPROXY_CONFIG', '/etc/tor/torrc');
|
|||||||
define('RASPI_LIGHTTPD_CONFIG', '/etc/lighttpd/lighttpd.conf');
|
define('RASPI_LIGHTTPD_CONFIG', '/etc/lighttpd/lighttpd.conf');
|
||||||
define('RASPI_ACCESS_CHECK_IP', '1.1.1.1');
|
define('RASPI_ACCESS_CHECK_IP', '1.1.1.1');
|
||||||
define('RASPI_ACCESS_CHECK_DNS', 'one.one.one.one');
|
define('RASPI_ACCESS_CHECK_DNS', 'one.one.one.one');
|
||||||
|
define('RASPI_CLIENT_CONFIG_PATH', '/etc/raspap/networking/client_udev_prototypes.json');
|
||||||
|
define('RASPI_CLIENT_SCRIPT_PATH', '/usr/local/sbin');
|
||||||
|
|
||||||
// Constant for the 5GHz wireless regulatory domain
|
// Constant for the 5GHz wireless regulatory domain
|
||||||
define('RASPI_5GHZ_ISO_ALPHA2', array('NL','US'));
|
define('RASPI_5GHZ_ISO_ALPHA2', array('NL','US'));
|
||||||
|
@ -96,12 +96,12 @@ function DisplayDashboard(&$extraFooterScripts)
|
|||||||
$clientinfo=array("name"=>"none","type"=>-1,"connected"=>"n");
|
$clientinfo=array("name"=>"none","type"=>-1,"connected"=>"n");
|
||||||
$raspi_client=$_SESSION['wifi_client_interface'];
|
$raspi_client=$_SESSION['wifi_client_interface'];
|
||||||
load_client_config();
|
load_client_config();
|
||||||
$clients = getClients(false);
|
$client_devs = getClients(false);
|
||||||
if(!empty($clients)) {
|
if(!empty($client_devs)) {
|
||||||
$ncl=$clients["clients"];
|
$ncl=$client_devs["clients"];
|
||||||
if($ncl > 0) {
|
if($ncl > 0) {
|
||||||
$ty=-1;
|
$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"]) {
|
if(($id=array_search($dev["type"],$_SESSION["net-device-types"])) > $ty && !$dev["isAP"]) {
|
||||||
$ty=$id;
|
$ty=$id;
|
||||||
$clientinfo=$dev;
|
$clientinfo=$dev;
|
||||||
@ -162,6 +162,7 @@ function DisplayDashboard(&$extraFooterScripts)
|
|||||||
$client_interface = $clientinfo["name"];
|
$client_interface = $clientinfo["name"];
|
||||||
}
|
}
|
||||||
$apInterface = $_SESSION['ap_interface'];
|
$apInterface = $_SESSION['ap_interface'];
|
||||||
|
$clientInterface = $raspi_client;
|
||||||
$MACPattern = '"([[:xdigit:]]{2}:){5}[[:xdigit:]]{2}"';
|
$MACPattern = '"([[:xdigit:]]{2}:){5}[[:xdigit:]]{2}"';
|
||||||
if (getBridgedState()) {
|
if (getBridgedState()) {
|
||||||
$moreLink = "hostapd_conf";
|
$moreLink = "hostapd_conf";
|
||||||
|
@ -728,6 +728,8 @@ function getNightmode(){
|
|||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// search array for matching string and return only first matching group
|
// search array for matching string and return only first matching group
|
||||||
function preg_only_match($pat,$haystack) {
|
function preg_only_match($pat,$haystack) {
|
||||||
$match = "";
|
$match = "";
|
||||||
@ -738,5 +740,6 @@ function preg_only_match($pat,$haystack) {
|
|||||||
}
|
}
|
||||||
return $match;
|
return $match;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
?>
|
||||||
|
|
||||||
|
@ -137,6 +137,10 @@ function getClients($simple=true) {
|
|||||||
break;
|
break;
|
||||||
default:
|
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;
|
return $cl;
|
||||||
|
@ -157,3 +157,4 @@ function getWifiInterface()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
?>
|
@ -107,7 +107,7 @@
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php foreach (array_slice($clients,0, 2) as $client) : ?>
|
<?php foreach (array_slice($clients,0, 2) as $client) : ?>
|
||||||
<tr>
|
<tr>
|
||||||
<?php if ($arrHostapdConf['BridgedEnable'] == 1): ?>
|
<?php if ($bridgedEnable == 1): ?>
|
||||||
<td><?php echo htmlspecialchars($client, ENT_QUOTES) ?></td>
|
<td><?php echo htmlspecialchars($client, ENT_QUOTES) ?></td>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<?php $props = explode(' ', $client) ?>
|
<?php $props = explode(' ', $client) ?>
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li role="presentation" class="nav-item"><a class="nav-link active" href="#summary" aria-controls="summary" role="tab" data-toggle="tab"><?php echo _("Summary"); ?></a></li>
|
<li role="presentation" class="nav-item"><a class="nav-link active" href="#summary" aria-controls="summary" role="tab" data-toggle="tab"><?php echo _("Summary"); ?></a></li>
|
||||||
<?php if (!$bridgedEnabled) : // no interface details when bridged ?>
|
<?php if (!$bridgedEnabled) : // no interface details when bridged ?>
|
||||||
<li role="presentation" class="nav-item"><a class="nav-link" href="#mobiledata" aria-controls="mobiledata" role="tab" data-toggle="tab">Mobile Data Settings</a></li>
|
|
||||||
<li role="presentation" class="nav-item"><a class="nav-link" href="#netdevices" aria-controls="netdevices" role="tab" data-toggle="tab">Network Devices</a></li>
|
<li role="presentation" class="nav-item"><a class="nav-link" href="#netdevices" aria-controls="netdevices" role="tab" data-toggle="tab">Network Devices</a></li>
|
||||||
|
<li role="presentation" class="nav-item"><a class="nav-link" href="#mobiledata" aria-controls="mobiledata" role="tab" data-toggle="tab">Mobile Data Settings</a></li>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
@ -84,31 +84,6 @@
|
|||||||
<?php $arrMD = parse_ini_file('/etc/raspap/networking/mobiledata.ini');
|
<?php $arrMD = parse_ini_file('/etc/raspap/networking/mobiledata.ini');
|
||||||
if ($arrMD==false) { $arrMD=[]; $arrMD["pin"]=$arrMD["apn"]=$arrMD["apn_user"]=$arrMD["apn_pw"]=$arrMD["router_user"]=$arrMD["router_pw"]=""; }
|
if ($arrMD==false) { $arrMD=[]; $arrMD["pin"]=$arrMD["apn"]=$arrMD["apn_user"]=$arrMD["apn_pw"]=$arrMD["router_user"]=$arrMD["router_pw"]=""; }
|
||||||
?>
|
?>
|
||||||
<div role="tabpanel" class="tab-pane fade in" id="mobiledata">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-lg-6">
|
|
||||||
<h4 class="mt-3"><?php echo _("Settings for Mobile Data Devices") ?></h4>
|
|
||||||
<hr />
|
|
||||||
<form id="frm-mobiledata">
|
|
||||||
<?php echo CSRFTokenFieldTag() ?>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="pin-mobile"><?php echo _("PIN of SIM card") ?></label>
|
|
||||||
<input type="number" class="form-control" id="pin-mobile" placeholder="1234" value="<?php echo $arrMD["pin"]?>" >
|
|
||||||
</div>
|
|
||||||
<h4 class="mt-3"><?php echo _("APN Settings (Modem device ppp0)") ?></h4>
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="apn-mobile"><?php echo _("Access Point Name (APN)") ?></label>
|
|
||||||
<input type="text" class="form-control" id="apn-mobile" placeholder="web.myprovider.com" value="<?php echo $arrMD["apn"]?>" >
|
|
||||||
<label for="apn-user-mobile"><?php echo _("Username") ?></label>
|
|
||||||
<input type="text" class="form-control" id="apn-user-mobile" value="<?php echo $arrMD["apn_user"]?>" >
|
|
||||||
<label for="apn-pw-mobile"><?php echo _("Password") ?></label>
|
|
||||||
<input type="text" class="form-control" id="apn-pw-mobile" value="<?php echo $arrMD["apn_pw"]?>" >
|
|
||||||
</div>
|
|
||||||
<a href="#" class="btn btn-outline btn-primary intsave" data-int="mobiledata"><?php echo _("Save settings") ?></a>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div><!-- /.tab-panel -->
|
|
||||||
<div role="tabpanel" class="tab-pane fade in" id="netdevices">
|
<div role="tabpanel" class="tab-pane fade in" id="netdevices">
|
||||||
<h4 class="mt-3"><?php echo _("Properties of network devices") ?></h4>
|
<h4 class="mt-3"><?php echo _("Properties of network devices") ?></h4>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@ -194,6 +169,31 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.tab-panel -->
|
</div><!-- /.tab-panel -->
|
||||||
|
<div role="tabpanel" class="tab-pane fade in" id="mobiledata">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-lg-6">
|
||||||
|
<h4 class="mt-3"><?php echo _("Settings for Mobile Data Devices") ?></h4>
|
||||||
|
<hr />
|
||||||
|
<form id="frm-mobiledata">
|
||||||
|
<?php echo CSRFTokenFieldTag() ?>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="pin-mobile"><?php echo _("PIN of SIM card") ?></label>
|
||||||
|
<input type="number" class="form-control" id="pin-mobile" placeholder="1234" value="<?php echo $arrMD["pin"]?>" >
|
||||||
|
</div>
|
||||||
|
<h4 class="mt-3"><?php echo _("APN Settings (Modem device ppp0)") ?></h4>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="apn-mobile"><?php echo _("Access Point Name (APN)") ?></label>
|
||||||
|
<input type="text" class="form-control" id="apn-mobile" placeholder="web.myprovider.com" value="<?php echo $arrMD["apn"]?>" >
|
||||||
|
<label for="apn-user-mobile"><?php echo _("Username") ?></label>
|
||||||
|
<input type="text" class="form-control" id="apn-user-mobile" value="<?php echo $arrMD["apn_user"]?>" >
|
||||||
|
<label for="apn-pw-mobile"><?php echo _("Password") ?></label>
|
||||||
|
<input type="text" class="form-control" id="apn-pw-mobile" value="<?php echo $arrMD["apn_pw"]?>" >
|
||||||
|
</div>
|
||||||
|
<a href="#" class="btn btn-outline btn-primary intsave" data-int="mobiledata"><?php echo _("Save settings") ?></a>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- /.tab-panel -->
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.card-body -->
|
</div><!-- /.card-body -->
|
||||||
<div class="card-footer"><?php echo _("Information provided by /sys/class/net"); ?></div>
|
<div class="card-footer"><?php echo _("Information provided by /sys/class/net"); ?></div>
|
||||||
|
Loading…
Reference in New Issue
Block a user