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

Add flag for client configuration

This commit is contained in:
Christian Zeitnitz 2021-03-28 14:44:05 +02:00
parent 1715237529
commit 6eb51a2d63
2 changed files with 7 additions and 4 deletions

View File

@ -152,6 +152,7 @@ function DisplayDashboard(&$extraFooterScripts)
exec('cat ' . RASPI_DNSMASQ_LEASES . '| grep -E $(iw dev ' . $apInterface . ' station dump | grep -oE ' . $MACPattern . ' | paste -sd "|")', $clients);
}
$ifaceStatus = $clientinfo["connected"]=="y" ? "up" : "down";
$isClientConfigured = true;
switch($clientinfo["type"]) {
case "eth":
case "usb":
@ -174,7 +175,8 @@ function DisplayDashboard(&$extraFooterScripts)
default:
$client_title = "No information available";
$type_name = "Not configured";
$ifaceStatus = "warn";
$ifaceStatus = "warn";
$isClientConfigured = false;
}
echo renderTemplate(
@ -197,7 +199,8 @@ function DisplayDashboard(&$extraFooterScripts)
"strTxPackets",
"strTxBytes",
"txPower",
"clientinfo"
"clientinfo",
"isClientConfigured"
)
);
$extraFooterScripts[] = array('src'=>'app/js/dashboardchart.js', 'defer'=>false);

View File

@ -9,7 +9,7 @@
<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 $type_name; if ($isConfigured=($ifaceStatus!="warn")) echo ' '. _($ifaceStatus); ?></span>
<span class="text service-status"><?php echo $type_name; if ( $isClientConfigured ) echo ' '. _($ifaceStatus); ?></span>
</button>
</div>
</div><!-- /.row -->
@ -69,7 +69,7 @@
<div class=""><?php echo _("No Client device or not yet configured"); ?></div>
<?php endif; ?>
</div>
<?php if ($isConfigured) : ?>
<?php if ($isClientConfigured) : ?>
<div class="col-md mt-2 d-flex justify-content-center">
<?php
preg_match("/.*\((\s*\d*)\s*%\s*\)/",$clientinfo["signal"],$match);