Browse Source

Add flag for client configuration

pull/1087/head
Christian Zeitnitz 2 years ago
parent
commit
6eb51a2d63
  1. 7
      includes/dashboard.php
  2. 4
      templates/dashboard.php

7
includes/dashboard.php

@ -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);

4
templates/dashboard.php

@ -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);

Loading…
Cancel
Save