diff --git a/config/config.php b/config/config.php index c128f78..d166d10 100644 --- a/config/config.php +++ b/config/config.php @@ -5,4 +5,7 @@ define("LOGPATH","/mnt/ramdisk/"); define("LOGPREFIX","MMDVM"); define("LOGFILE",LOGPATH . LOGPREFIX . "-" . date("Y-m-d") . ".log"); define("REFRESHAFTER","60"); +define("TEMPERATUREALERT",true); +define("TEMPERATUREHIGHLEVEL", 60); +define("SHOWPROGRESSBARS", true); ?> \ No newline at end of file diff --git a/include/functions.php b/include/functions.php index e4f1db3..96cdfff 100644 --- a/include/functions.php +++ b/include/functions.php @@ -3,6 +3,7 @@ // 01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901 // M: 2016-04-29 00:15:00.013 D-Star, received network header from DG9VH /ZEIT to CQCQCQ via DCS002 S // M: 2016-04-29 19:43:21.839 DMR Slot 2, received network voice header from DL1ESZ to TG 9 +// M: 2016-04-30 14:57:43.072 DMR Slot 2, received RF voice header from DG9VH to 5000 function getLastHeard() { $lastHeard = array(); @@ -24,9 +25,13 @@ function getLastHeard() { $id = substr($callsign2, strpos($callsign2,"/") + 1); } $target = substr($logLine, strpos($logLine, "to") + 3); + $source = "RF"; + if (strpos($logLine,"network") > 0 ) { + $source = "Network"; + } if ( strlen($callsign <7) ) { - array_push($heardList, array($timestamp, $mode, $callsign, $id, $target)); + array_push($heardList, array($timestamp, $mode, $callsign, $id, $target, $source)); } //Last-Heard-Liste: Array aufbauen in umgekehrter Richtung des Logs //Zeilen ausblenden, bei denen das Callsign länger als 6 Stellen ist @@ -35,8 +40,8 @@ function getLastHeard() { } array_multisort($heardList,SORT_DESC); foreach ($heardList as $listElem) { - if(!(array_search($listElem[2], $heardCalls) > -1)) { - array_push($heardCalls, $listElem[2]); + if(!(array_search($listElem[2]."#".$listElem[1].$listElem[3], $heardCalls) > -1)) { + array_push($heardCalls, $listElem[2]."#".$listElem[1].$listElem[3]); array_push($lastHeard, $listElem); } } diff --git a/include/lh.php b/include/lh.php index ae53922..f03d143 100644 --- a/include/lh.php +++ b/include/lh.php @@ -16,6 +16,7 @@ $lastHeard = getLastHeard(); Callsign DSTAR-ID Target + Source $listElem[2]"; echo"$listElem[3]"; echo"$listElem[4]"; + echo"$listElem[5]"; echo""; } diff --git a/include/sysinfo.php b/include/sysinfo.php new file mode 100644 index 0000000..8c30249 --- /dev/null +++ b/include/sysinfo.php @@ -0,0 +1,138 @@ + TEMPERATUREHIGHLEVEL) { +?> + +$y) $cpu[$x] = round($y / $total * 100, 1); + $cpuusage = round($cpu['user'] + $cpu['sys'], 2); + + $output = shell_exec('grep -c processor /proc/cpuinfo'); + $cpucores = $output; + + $output = shell_exec('cat /proc/uptime'); + $uptime = format_time(substr($output,0,strpos($output," "))); + $idletime = format_time((substr($output,strpos($output," ")))/$cpucores); + +?> +
+ +
System Info
+
+

In the following table you find some important system information

+
+ + + + + + + + + + + + + + + + + + + + + +
CPU-TemperatureCPU-FrequencySystem-LoadCPU-UsageUptimeIdle
°C MHz % + +
= 30 and $cpuusage < 60) + echo "progress-bar-warning"; + if ($cpuusage >= 60) + echo "progress-bar-danger"; +?>" role="progressbar" aria-valuenow="" aria-valuemin="0" aria-valuemax="100" style="width: %;">%
+ +
+
\ No newline at end of file diff --git a/include/tools.php b/include/tools.php new file mode 100644 index 0000000..f6f858b --- /dev/null +++ b/include/tools.php @@ -0,0 +1,27 @@ + 0) { + $uptimeString .= $days; + $uptimeString .= (($days == 1) ? " day" : " days"); + } + if ($hours > 0) { + $uptimeString .= (($days > 0) ? ", " : "") . $hours; + $uptimeString .= (($hours == 1) ? " hour" : " hours"); + } + if ($mins > 0) { + $uptimeString .= (($days > 0 || $hours > 0) ? ", " : "") . $mins; + $uptimeString .= (($mins == 1) ? " minute" : " minutes"); + } + if ($secs > 0) { + $uptimeString .= (($days > 0 || $hours > 0 || $mins > 0) ? ", " : "") . $secs; + $uptimeString .= (($secs == 1) ? " second" : " seconds"); + } + return $uptimeString; +} +?> \ No newline at end of file diff --git a/index.php b/index.php index 37627ac..c90d5d3 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,6 @@ @@ -24,6 +25,7 @@ include "include/functions.php";

MMDVM-Dashboard by DG9VH Repeater: