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

Merge branch 'master' into feature/wireguard

This commit is contained in:
Bill Zimmerman 2020-10-15 11:40:45 +02:00
commit 0ba767c387
9 changed files with 80 additions and 54 deletions

View File

@ -80,7 +80,7 @@ By default RaspAP configures a routed AP for your clients to connect to. A bridg
More information on Bridged AP mode is provided [on our wiki](https://github.com/billz/raspap-webgui/wiki/Bridged-AP-mode).
## Simultaneous AP and Wifi client
RaspAP lets you create an AP with a Wifi client configuration, often called AP-STA mode. With your system configured in managed mode, enable the AP from the **Advanced** tab of **Configure hotspot** by sliding the **Wifi client AP mode** toggle. Save settings and start the hotspot. The managed mode AP is functional without restart.
RaspAP lets you create an AP with a Wifi client configuration, often called [AP-STA mode](https://github.com/billz/raspap-webgui/wiki/RPi-Zero-W-AP-STA-mode). With your system configured in managed mode, enable the AP from the **Advanced** tab of **Configure hotspot** by sliding the **Wifi client AP mode** toggle. Save settings and start the hotspot. The managed mode AP is functional without restart.
**Note:** This option is disabled until you configure your system as a wireless client. For a device operating in [managed mode](https://github.com/billz/raspap-webgui/wiki/FAQs#how-do-i-prepare-the-sd-card-to-connect-to-wifi-in-headless-mode) without an `eth0` connection, this configuration must be enabled [_before_ a reboot](https://github.com/billz/raspap-webgui/wiki/RPi-Zero-W-AP-STA-mode).

View File

@ -90,7 +90,7 @@ function DisplayDashboard(&$extraFooterScripts)
define('SSIDMAXLEN', 32);
// Warning iw comes with: "Do NOT screenscrape this tool, we don't consider its output stable."
exec('iw dev ' .$_SESSION['wifi_client_interface']. ' link ', $stdoutIw);
$stdoutIwAllLinesGlued = implode(' ', $stdoutIw);
$stdoutIwAllLinesGlued = implode('+', $stdoutIw); // Break lines with character illegal in SSID and MAC addr
$stdoutIwWRepSpaces = preg_replace('/\s\s+/', ' ', $stdoutIwAllLinesGlued);
preg_match('/Connected to (([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2}))/', $stdoutIwWRepSpaces, $matchesBSSID) || $matchesBSSID[1] = '';
@ -102,7 +102,7 @@ function DisplayDashboard(&$extraFooterScripts)
$wlanHasLink = true;
}
if (!preg_match('/SSID: ([^ ]{1,'.SSIDMAXLEN.'})/', $stdoutIwWRepSpaces, $matchesSSID)) {
if (!preg_match('/SSID: ([^+]{1,'.SSIDMAXLEN.'})/', $stdoutIwWRepSpaces, $matchesSSID)) {
$wlanHasLink = false;
$matchesSSID[1] = 'None';
}

Binary file not shown.

View File

@ -35,10 +35,10 @@ msgid "Hotspot"
msgstr "Hotspot"
msgid "Memory Use"
msgstr ""
msgstr "Usage mémoire"
msgid "CPU Temp"
msgstr ""
msgstr "T°C CPU"
msgid "Networking"
msgstr "Réseau"
@ -127,7 +127,7 @@ msgid "Rescan"
msgstr "Actualiser"
msgid "Update"
msgstr "Mettre à jour"
msgstr "Mise à jour"
msgid "Add"
msgstr "Ajouter"
@ -182,7 +182,7 @@ msgid "Transferred Bytes"
msgstr "Octets transférés"
msgid "Wireless Client"
msgstr ""
msgstr "Client WIFI"
msgid "Connected To"
msgstr "Connecté à"
@ -230,13 +230,13 @@ msgid "Interface is down"
msgstr "L'interface est arrêté"
msgid "Interface already down"
msgstr "Interface déjà arrêté"
msgstr "Interface déjà arrêtée"
msgid "Start wlan0"
msgstr "Démarrer wlan0"
msgid "Stop wlan0"
msgstr "Arrêtez wlan0"
msgstr "Arrêter wlan0"
msgid "Connected Devices"
msgstr "Appareils connectés"
@ -276,7 +276,7 @@ msgid "Active DHCP leases"
msgstr "Baux DHCP actifs"
msgid "Expire time"
msgstr "Temps d'expiration"
msgstr "Temps avant expiration"
msgid "MAC Address"
msgstr "Adresse Mac"
@ -291,7 +291,7 @@ msgid "Information provided by Dnsmasq"
msgstr "Informations fournies par Dnsmasq"
msgid "Stop dnsmasq"
msgstr "Arrêtez dnsmasq"
msgstr "Arrêter dnsmasq"
msgid "Start dnsmasq"
msgstr "Démarrer dnsmasq"
@ -324,7 +324,7 @@ msgid "Dnsmasq is not running"
msgstr "Dnsmasq n'est pas en fonctionnement"
msgid "Upstream DNS servers"
msgstr "Serveurs DNS amont"
msgstr "Serveurs DNS en amont"
msgid "Only ever query DNS servers configured below"
msgstr "Uniquement les serveurs DNS de requête configurés ci-dessous"
@ -336,7 +336,7 @@ msgid "This option adds <code>no-resolv</code> to the dnsmasq configuration."
msgstr "Cette option ajoute <code>no-resolv</code> à la configuration dnsmasq."
msgid "Add upstream DNS server"
msgstr "Ajouter un serveur DNS amont"
msgstr "Ajouter un serveur DNS en amont"
msgid "Format"
msgstr "Format"
@ -418,7 +418,7 @@ msgid "Start hotspot"
msgstr "Démarrer le point d'accès"
msgid "Stop hotspot"
msgstr "Arrêté le point d'accès"
msgstr "Arrêter le point d'accès"
msgid "Restart hotspot"
msgstr "Redémarrer le point d'accès"
@ -495,7 +495,7 @@ msgid "Select a language"
msgstr "Sélectionnez une langue"
msgid "Language setting saved"
msgstr "Paramètre de langue enregistré"
msgstr "Paramètre de langue enregistrée"
msgid "Console"
msgstr "Console"
@ -687,10 +687,10 @@ msgid "Remove"
msgstr "arrêté"
msgid "up"
msgstr "vers le haut"
msgstr "activé"
msgid "down"
msgstr "vers le bas"
msgstr "désactivé"
msgid "adblock"
msgstr "AdBlock"
@ -720,10 +720,10 @@ msgid "Choose a blocklist provider"
msgstr "Choisir un fournisseur de liste noire"
msgid "Hostnames blocklist last updated"
msgstr ""
msgstr "Dernière mise à jour de la liste de blocage des noms d'hôtes"
msgid "Domains blocklist last updated"
msgstr ""
msgstr "Dernière mise à jour de la liste de blocage des domaines"
msgid "Update now"
msgstr "Mettre à jour"

Binary file not shown.

Binary file not shown.

View File

@ -1,3 +1,16 @@
<?php
$arrHostapdConf = parse_ini_file(RASPI_CONFIG.'/hostapd.ini');
if ($arrHostapdConf['WifiAPEnable'] == 1) {
$client_interface = 'uap0';
} else {
$client_interface = $_SESSION['wifi_client_interface'];
}
exec('ip a show '.$client_interface, $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";
?>
<div class="row">
<div class="col-lg-12">
<div class="card">
@ -6,6 +19,12 @@
<div class="col">
<i class="fas fa-wifi mr-2"></i><?php echo _("WiFi client"); ?>
</div>
<div class="col">
<button class="btn btn-light btn-icon-split btn-sm service-status float-right">
<span class="icon"><i class="fas fa-circle service-status-<?php echo $ifaceStatus ?>"></i></span>
<span class="text service-status"><?php echo strtolower($client_interface) .' '. _($ifaceStatus) ?></span>
</button>
</div>
</div><!-- /.row -->
</div><!-- /.card-header -->
<div class="card-body">
@ -21,7 +40,7 @@
<form method="POST" action="?page=wpa_conf" name="wpa_conf_form" class="row">
<?php echo CSRFTokenFieldTag() ?>
<input type="hidden" name="client_settings" ?>
<div class="js-wifi-stations loading-spinner"></div>
<div class="row js-wifi-stations w-100 loading-spinner"></div>
</form>
</div><!-- ./ card-body -->
<div class="card-footer"><?php echo _("<strong>Note:</strong> WEP access points appear as 'Open'. RaspAP does not currently support connecting to WEP"); ?></div>

View File

@ -55,6 +55,7 @@ $ifaceStatus = $wlan0up ? "up" : "down";
<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($_SESSION['wifi_client_interface']); ?></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>

View File

@ -1,22 +1,27 @@
<?php if (empty($networks)) : ?>
<?php if (empty($networks)) { ?>
<p class="lead text-center"><?php echo _('No Wifi stations found') ?></p>
<p class="text-center"><?php echo _('Click "Rescan" to search for nearby Wifi stations.') ?></p>
<?php endif ?>
<?php } elseif (count($networks) == 1) {
$prop_col = "col-sm-12";
$prop_w = "w-50";
} else {
$prop_col = "col-sm-6";
$prop_w = "w-100";
}
?>
<?php $index = 0; ?>
<div class="row ml-1 mr-1">
<?php foreach ($networks as $ssid => $network) : ?>
<div class="col-sm-6 align-items-stretch mb-3">
<div class="card h-100">
<div class="row ml-1 mr-1 w-100">
<?php foreach ($networks as $ssid => $network) : ?>
<div class="<?php echo $prop_col; ?> align-items-stretch mb-3">
<div class="card h-100 <?php echo $prop_w; ?>">
<div class="card-body">
<input type="hidden" name="ssid<?php echo $index ?>" value="<?php echo htmlentities($ssid, ENT_QUOTES) ?>" />
<?php if (strlen($ssid) == 0) {
$ssid = "(unknown)";
} ?>
<h5 class="card-title"><?php echo htmlspecialchars($ssid, ENT_QUOTES); ?></h5>
<div class="info-item-wifi"><?php echo _("Status"); ?></div>
<div class="info-item-wifi"><?php echo _("Status"); ?></div>
<div>
<?php if ($network['configured']) { ?>
<i class="fas fa-check-circle"></i>
@ -29,7 +34,7 @@
} ?>
</div>
<div class="info-item-wifi"><?php echo _("Channel"); ?></div>
<div class="info-item-wifi"><?php echo _("Channel"); ?></div>
<div>
<?php if ($network['visible']) { ?>
<?php echo htmlspecialchars($network['channel'], ENT_QUOTES) ?>
@ -38,7 +43,7 @@
<?php } ?>
</div>
<div class="info-item-wifi"><?php echo _("RSSI"); ?></div>
<div class="info-item-wifi"><?php echo _("RSSI"); ?></div>
<div>
<?php
if (isset($network['RSSI']) && $network['RSSI'] >= -200) {
@ -63,35 +68,36 @@
<?php } ?>
<input type="hidden" name="protocol<?php echo $index ?>" value="<?php echo htmlspecialchars($network['protocol'], ENT_QUOTES); ?>" />
<div class="info-item-wifi"><?php echo _("Security"); ?></div>
<div class="info-item-wifi"><?php echo _("Security"); ?></div>
<div><?php echo $network['protocol'] ?></div>
<div class="form-group">
<div class="info-item-wifi"><?php echo _("Passphrase"); ?></div>
<div class="input-group">
<?php if ($network['protocol'] === 'Open') { ?>
<input type="password" disabled class="form-control" aria-describedby="passphrase" name="passphrase<?php echo $index ?>" value="" />
<?php } else { ?>
<input type="password" class="form-control js-validate-psk" aria-describedby="passphrase" name="passphrase<?php echo $index ?>" value="<?php echo $network['passphrase'] ?>" data-target="#update<?php echo $index ?>" data-colors="#ffd0d0,#d0ffd0">
<div class="input-group-append">
<button class="btn btn-outline-secondary js-toggle-password" type="button" data-target="[name=passphrase<?php echo $index ?>]" data-toggle-with="<?php echo _("Hide") ?>">Show</button>
<div class="form-group">
<div class="info-item-wifi"><?php echo _("Passphrase"); ?></div>
<div class="input-group">
<?php if ($network['protocol'] === 'Open') { ?>
<input type="password" disabled class="form-control" aria-describedby="passphrase" name="passphrase<?php echo $index ?>" value="" />
<?php } else { ?>
<input type="password" class="form-control js-validate-psk" aria-describedby="passphrase" name="passphrase<?php echo $index ?>" value="<?php echo $network['passphrase'] ?>" data-target="#update<?php echo $index ?>" data-colors="#ffd0d0,#d0ffd0">
<div class="input-group-append">
<button class="btn btn-outline-secondary js-toggle-password" type="button" data-target="[name=passphrase<?php echo $index ?>]" data-toggle-with="<?php echo _("Hide") ?>">Show</button>
</div>
<?php } ?>
</div>
<?php } ?>
</div>
</div>
</div>
<div class="btn-group btn-block ">
<?php if ($network['configured']) { ?>
<input type="submit" class="col-xs-4 col-md-4 btn btn-warning" value="<?php echo _("Update"); ?>" id="update<?php echo $index ?>" name="update<?php echo $index ?>"<?php echo ($network['protocol'] === 'Open' ? ' disabled' : '')?> />
<button type="submit" class="col-xs-4 col-md-4 btn btn-info" value="<?php echo $index?>" name="connect"><?php echo _("Connect"); ?></button>
<?php } else { ?>
<input type="submit" class="col-xs-4 col-md-4 btn btn-info" value="<?php echo _("Add"); ?>" id="update<?php echo $index ?>" name="update<?php echo $index ?>" <?php echo ($network['protocol'] === 'Open' ? '' : ' disabled')?> />
<?php } ?>
<input type="submit" class="col-xs-4 col-md-4 btn btn-danger" value="<?php echo _("Delete"); ?>" name="delete<?php echo $index ?>"<?php echo ($network['configured'] ? '' : ' disabled')?> />
</div><!-- /.btn-group -->
<div class="btn-group btn-block ">
<?php if ($network['configured']) { ?>
<input type="submit" class="col-xs-4 col-md-4 btn btn-warning" value="<?php echo _("Update"); ?>" id="update<?php echo $index ?>" name="update<?php echo $index ?>"<?php echo ($network['protocol'] === 'Open' ? ' disabled' : '')?> />
<button type="submit" class="col-xs-4 col-md-4 btn btn-info" value="<?php echo $index?>" name="connect"><?php echo _("Connect"); ?></button>
<?php } else { ?>
<input type="submit" class="col-xs-4 col-md-4 btn btn-info" value="<?php echo _("Add"); ?>" id="update<?php echo $index ?>" name="update<?php echo $index ?>" <?php echo ($network['protocol'] === 'Open' ? '' : ' disabled')?> />
<?php } ?>
<input type="submit" class="col-xs-4 col-md-4 btn btn-danger" value="<?php echo _("Delete"); ?>" name="delete<?php echo $index ?>"<?php echo ($network['configured'] ? '' : ' disabled')?> />
</div><!-- /.btn-group -->
</div><!-- /.card-body -->
</div><!-- /.card -->
</div><!-- /.col-sm -->
<?php $index += 1; ?>
<?php $index += 1; ?>
<?php endforeach ?>
</div><!-- /.row -->