mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-25 00:50:29 +00:00
Fix: dashboard interface stop/start button mismatch
This commit is contained in:
parent
b31b1a7773
commit
be1feb22e8
2 changed files with 5 additions and 6 deletions
|
@ -39,7 +39,6 @@ function DisplayDashboard(&$extraFooterScripts)
|
||||||
$address = $inet[1];
|
$address = $inet[1];
|
||||||
$suffix = (int) $inet[2];
|
$suffix = (int) $inet[2];
|
||||||
$netmask = long2ip(-1 << (32 - $suffix));
|
$netmask = long2ip(-1 << (32 - $suffix));
|
||||||
|
|
||||||
$ipv4Addrs .= " $address";
|
$ipv4Addrs .= " $address";
|
||||||
$ipv4Netmasks .= " $netmask";
|
$ipv4Netmasks .= " $netmask";
|
||||||
}
|
}
|
||||||
|
@ -157,7 +156,7 @@ function DisplayDashboard(&$extraFooterScripts)
|
||||||
// Pressed stop button
|
// Pressed stop button
|
||||||
if ($interfaceState === 'UP') {
|
if ($interfaceState === 'UP') {
|
||||||
$status->addMessage(sprintf(_('Interface is going %s.'), _('down')), 'warning');
|
$status->addMessage(sprintf(_('Interface is going %s.'), _('down')), 'warning');
|
||||||
exec('sudo ip link set '.$_SESSION['wifi_client_interface'].' down');
|
exec('sudo ip link set '.$_SESSION['ap_interface'].' down');
|
||||||
$wlan0up = false;
|
$wlan0up = false;
|
||||||
$status->addMessage(sprintf(_('Interface is now %s.'), _('down')), 'success');
|
$status->addMessage(sprintf(_('Interface is now %s.'), _('down')), 'success');
|
||||||
} elseif ($interfaceState === 'unknown') {
|
} elseif ($interfaceState === 'unknown') {
|
||||||
|
@ -169,8 +168,8 @@ function DisplayDashboard(&$extraFooterScripts)
|
||||||
// Pressed start button
|
// Pressed start button
|
||||||
if ($interfaceState === 'DOWN') {
|
if ($interfaceState === 'DOWN') {
|
||||||
$status->addMessage(sprintf(_('Interface is going %s.'), _('up')), 'warning');
|
$status->addMessage(sprintf(_('Interface is going %s.'), _('up')), 'warning');
|
||||||
exec('sudo ip link set ' .$_SESSION['wifi_client_interface']. ' up');
|
exec('sudo ip link set ' .$_SESSION['ap_interface']. ' up');
|
||||||
exec('sudo ip -s a f label ' . $_SESSION['wifi_client_interface']);
|
exec('sudo ip -s a f label ' .$_SESSION['ap_interface']);
|
||||||
$wlan0up = true;
|
$wlan0up = true;
|
||||||
$status->addMessage(sprintf(_('Interface is now %s.'), _('up')), 'success');
|
$status->addMessage(sprintf(_('Interface is now %s.'), _('up')), 'success');
|
||||||
} elseif ($interfaceState === 'unknown') {
|
} elseif ($interfaceState === 'unknown') {
|
||||||
|
|
|
@ -126,9 +126,9 @@
|
||||||
<?php echo CSRFTokenFieldTag() ?>
|
<?php echo CSRFTokenFieldTag() ?>
|
||||||
<?php if (!RASPI_MONITOR_ENABLED) : ?>
|
<?php if (!RASPI_MONITOR_ENABLED) : ?>
|
||||||
<?php if (!$wlan0up) : ?>
|
<?php if (!$wlan0up) : ?>
|
||||||
<input type="submit" class="btn btn-success" value="<?php echo _("Start").' '.$clientInterface ?>" name="ifup_wlan0" />
|
<input type="submit" class="btn btn-success" value="<?php echo _("Start").' '.$apInterface ?>" name="ifup_wlan0" />
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<input type="submit" class="btn btn-warning" value="<?php echo _("Stop").' '.$clientInterface ?>" name="ifdown_wlan0" />
|
<input type="submit" class="btn btn-warning" value="<?php echo _("Stop").' '.$apInterface ?>" name="ifdown_wlan0" />
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<button type="button" onClick="window.location.reload();" class="btn btn-outline btn-primary"><i class="fas fa-sync-alt"></i> <?php echo _("Refresh") ?></a>
|
<button type="button" onClick="window.location.reload();" class="btn btn-outline btn-primary"><i class="fas fa-sync-alt"></i> <?php echo _("Refresh") ?></a>
|
||||||
|
|
Loading…
Reference in a new issue