1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Merge with upstream master

This commit is contained in:
billz 2021-04-05 10:06:44 +01:00
commit 594c5dad1c
11 changed files with 50 additions and 26 deletions

View File

@ -45,12 +45,14 @@ if (isset($interface)) {
preg_match('/static\srouters=(.*)/', $matched[0], $static_routers);
preg_match('/static\sdomain_name_server=(.*)/', $matched[0], $static_dns);
preg_match('/fallback\sstatic_'.$interface.'/', $matched[0], $fallback);
preg_match('/(?:no)?gateway/', $matched[0], $gateway);
$dhcpdata['Metric'] = $metric[1];
$dhcpdata['StaticIP'] = strpos($static_ip[1],'/') ? substr($static_ip[1], 0, strpos($static_ip[1],'/')) : $static_ip[1];
$dhcpdata['SubnetMask'] = cidr2mask($static_ip[1]);
$dhcpdata['StaticRouters'] = $static_routers[1];
$dhcpdata['StaticDNS'] = $static_dns[1];
$dhcpdata['FallbackEnabled'] = empty($fallback) ? false: true;
$dhcpdata['DefaultRoute'] = empty($gateway) || $gateway[0] == "gateway";
echo json_encode($dhcpdata);
}

View File

@ -119,8 +119,9 @@ i.fa.fa-bars:hover{
}
.info-item {
width: 10rem;
float: left;
text-transform: uppercase;
font-size: 0.7em;
color: #858796;
}
.info-item-xs {

View File

@ -150,8 +150,9 @@ ul.nav-tabs, .nav-tabs .nav-link {
}
.info-item {
width: 10rem;
float: left;
text-transform: uppercase;
font-size: 0.7em;
color: #858796;
}
.info-item-xs {

View File

@ -249,8 +249,9 @@ hr {
}
.info-item {
width: 12rem;
float: left;
text-transform: uppercase;
font-size: 0.7em;
color: #858796;
}
.info-item-xs {

View File

@ -186,6 +186,7 @@ function loadInterfaceDHCPSelect() {
$('#txtsubnetmask').val(jsonData.SubnetMask);
$('#txtgateway').val(jsonData.StaticRouters);
$('#chkfallback')[0].checked = jsonData.FallbackEnabled;
$('#default-route').prop('checked', jsonData.DefaultRoute);
$('#txtrangestart').val(jsonData.RangeStart);
$('#txtrangeend').val(jsonData.RangeEnd);
$('#txtrangeleasetime').val(jsonData.leaseTime);

View File

@ -3,7 +3,7 @@ server.modules += (
)
$HTTP["url"] =~ "^/REPLACE_ME/(?!(dist|app|ajax|config)).*" {
url.rewrite-once = ( "^/REPLACE_ME/(.*?)(\?.+)?$"=>"/REPLACE_ME/index.php/$1?$2" )
url.rewrite-once = ( "^/REPLACE_ME/(.*?)(\?.+)?$"=>"/REPLACE_ME/index.php/$1$2" )
server.error-handler-404 = "/REPLACE_ME/index.php"
}

View File

@ -247,6 +247,7 @@ function updateDHCPConfig($iface,$status)
$cfg[] = 'profile static_'.$iface;
$cfg[] = 'fallback static_'.$iface;
}
$cfg[] = $_POST['DefaultRoute'] == '1' ? 'gateway' : 'nogateway';
$dhcp_cfg = file_get_contents(RASPI_DHCPCD_CONFIG);
if (!preg_match('/^interface\s'.$iface.'$/m', $dhcp_cfg)) {
$cfg[] = PHP_EOL;

View File

@ -27,6 +27,8 @@ function DisplayHostAPDConfig()
$arrEncType = array('TKIP' => 'TKIP', 'CCMP' => 'CCMP', 'TKIP CCMP' => 'TKIP+CCMP');
$managedModeEnabled = false;
exec("ip -o link show | awk -F': ' '{print $2}'", $interfaces);
sort($interfaces);
exec("iw reg get | awk '/country / { sub(/:/,\"\",$2); print $2 }'", $country_code);
if (!RASPI_MONITOR_ENABLED) {

View File

@ -380,6 +380,9 @@ msgstr "Clients with a particular hardware MAC address can always be allocated t
msgid "This option adds <code>dhcp-host</code> entries to the dnsmasq configuration."
msgstr "This option adds <code>dhcp-host</code> entries to the dnsmasq configuration."
msgid "This toggles the <code>gateway</code>/<code>nogateway</code> option for this interface in the DHCPCD configuration."
msgstr "This toggles the <code>gateway</code>/<code>nogateway</code> option for this interface in the DHCPCD configuration."
#: includes/hostapd.php
msgid "Basic"
msgstr "Basic"

View File

@ -21,7 +21,7 @@
<div class="col-lg-12">
<div class="card mb-3">
<div class="card-body">
<h4><?php echo _("Hourly traffic amount"); ?></h4>
<h4 class="card-title"><?php echo _("Hourly traffic amount"); ?></h4>
<div id="divInterface" class="d-none"><?php echo $apInterface; ?></div>
<div class="col-md-12">
<canvas id="divDBChartBandwidthhourly"></canvas>
@ -33,31 +33,31 @@
<div class="col-sm-6 align-items-stretch">
<div class="card h-100">
<div class="card-body wireless">
<h4><?php echo _("Wireless Client"); ?></h4>
<h4 class="card-title"><?php echo _("Wireless Client"); ?></h4>
<div class="row justify-content-md-center">
<div class="col-md">
<div class="info-item"><?php echo _("Connected To"); ?></div><div><?php echo htmlspecialchars($connectedSSID, ENT_QUOTES); ?></div>
<div class="info-item"><?php echo _("Interface"); ?></div><div><?php echo htmlspecialchars($clientInterface); ?></div>
<div class="info-item"><?php echo _("AP Mac Address"); ?></div><div><?php echo htmlspecialchars($connectedBSSID, ENT_QUOTES); ?></div>
<div class="info-item"><?php echo _("Bitrate"); ?></div><div><?php echo htmlspecialchars($bitrate, ENT_QUOTES); ?></div>
<div class="info-item"><?php echo _("Signal Level"); ?></div><div><?php echo htmlspecialchars($signalLevel, ENT_QUOTES); ?></div>
<div class="info-item"><?php echo _("Transmit Power"); ?></div><div><?php echo htmlspecialchars($txPower, ENT_QUOTES); ?></div>
<div class="info-item"><?php echo _("Frequency"); ?></div><div><?php echo htmlspecialchars($frequency, ENT_QUOTES); ?></div>
<div class="info-item"><?php echo _("Connected To"); ?></div><p><?php echo htmlspecialchars($connectedSSID, ENT_QUOTES); ?></p>
<div class="info-item"><?php echo _("Interface"); ?></div><p><?php echo htmlspecialchars($clientInterface); ?></p>
<div class="info-item"><?php echo _("AP Mac Address"); ?></div><p><?php echo htmlspecialchars($connectedBSSID, ENT_QUOTES); ?></p>
<div class="info-item"><?php echo _("Bitrate"); ?></div><p><?php echo htmlspecialchars($bitrate, ENT_QUOTES); ?></p>
<div class="info-item"><?php echo _("Signal Level"); ?></div><p><?php echo htmlspecialchars($signalLevel, ENT_QUOTES); ?></p>
<div class="info-item"><?php echo _("Transmit Power"); ?></div><p><?php echo htmlspecialchars($txPower, ENT_QUOTES); ?></p>
<div class="info-item"><?php echo _("Frequency"); ?></div><p><?php echo htmlspecialchars($frequency, ENT_QUOTES); ?></p>
</div>
<div class="col-md mt-2 d-flex justify-content-center">
<script>var linkQ = <?php echo json_encode($strLinkQuality); ?>;</script>
<div class="chart-container">
<canvas id="divChartLinkQ"></canvas>
</div>
</div><!--row-->
</div>
</div><!--row-->
</div><!-- /.card-body -->
</div><!-- /.card -->
</div><!-- /.col-md-6 -->
<div class="col-sm-6">
<div class="card h-100 mb-3">
<div class="card-body">
<h4><?php echo _("Connected Devices"); ?></h4>
<h4 class="card-title"><?php echo _("Connected Devices"); ?></h4>
<div class="table-responsive">
<table class="table table-hover">
<thead>

View File

@ -55,6 +55,18 @@
</div>
</div>
<div class="row">
<div class="form-group col-md-6">
<div class="custom-control custom-switch">
<input class="custom-control-input" id="default-route" type="checkbox" name="DefaultRoute" value="1" aria-describedby="default-route-description">
<label class="custom-control-label" for="default-route"><?php echo _("Install a default route for this interface") ?></label>
</div>
<p class="mb-0" id="default-route-description">
<small><?php echo _("This toggles the <code>gateway</code>/<code>nogateway</code> option for this interface in the DHCPCD configuration.") ?></small>
</p>
</div>
</div>
<h5 class="mt-1">DHCP options</h5>
<div class="row">
<div class="form-group col-md-6">