Add Loki status to dashboard

pull/10/head
necro-nemesis 6 years ago
parent f9ed4d9a30
commit fb597ecc66

@ -60,7 +60,7 @@ function DisplayDashboard(){
preg_match('/state (UP|DOWN)/i', $stdoutIpWRepeatedSpaces, $matchesState ) || $matchesState[1] = 'unknown';
$interfaceState = $matchesState[1];
// Because of table layout used in the ip output we get the interface statistics directly from
// Because of table layout used in the ip output we get the interface statistics directly from
// the system. One advantage of this is that it could work when interface is disable.
exec('cat /sys/class/net/'.RASPI_WIFI_CLIENT_INTERFACE.'/statistics/rx_packets ', $stdoutCatRxPackets);
$strRxPackets = _('No data');
@ -126,7 +126,7 @@ function DisplayDashboard(){
preg_match('/txpower ([0-9\.]+ dBm)/i', $stdoutIpInfoWRepSpaces, $matchesTxPower ) || $matchesTxPower[1] = '';
$txPower = $matchesTxPower[1];
// iw does not have the "Link Quality". This is a is an aggregate value,
// iw does not have the "Link Quality". This is a is an aggregate value,
// and depends on the driver and hardware.
// Display link quality as signal quality for now.
$strLinkQuality = 0;
@ -174,6 +174,15 @@ function DisplayDashboard(){
} else {
$status->addMessage(sprintf(_('Interface is %s.'), strtolower($interfaceState)), $classMsgDevicestatus);
}
exec( 'pidof lokinet | wc -l', $lokinetstatus);
if( $lokinetstatus[0] == 0 ) {
$status = '<div class="alert alert-warning alert-dismissable">Lokinet daemon is not running
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>';
} else {
$status = '<div class="alert alert-success alert-dismissable">Lokinet is running
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button></div>';
}
?>
<div class="row">
<div class="col-lg-12">
@ -274,4 +283,3 @@ function getHumanReadableDatasize($numbytes, $precision = 2)
return $humanDatasize;
}

Loading…
Cancel
Save