From 5d53f1f605650da14d5f3717d973680e29400d37 Mon Sep 17 00:00:00 2001 From: Carlos V <76731844+cvc90@users.noreply.github.com> Date: Sat, 5 Aug 2023 14:03:06 +0200 Subject: [PATCH] Create systeminfo.php Create page for the new "System Information" menu --- front/systeminfo.php | 215 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 215 insertions(+) create mode 100644 front/systeminfo.php diff --git a/front/systeminfo.php b/front/systeminfo.php new file mode 100644 index 00000000..4e6e966c --- /dev/null +++ b/front/systeminfo.php @@ -0,0 +1,215 @@ + + + +
+ + +
+ +

+ +

+
+ + +
+ +format('l, F j, Y H:i:s'); +$formatted_date2 = $date->format('d/m/Y H:i:s'); +$formatted_date3 = $date->format('Y/m/d H:i:s'); +//hdd stat +$hdd_result = shell_exec("df | awk '{print $1}'"); +$hdd_devices = explode("\n", trim($hdd_result)); +$hdd_result = shell_exec("df | awk '{print $2}'"); +$hdd_devices_total = explode("\n", trim($hdd_result)); +$hdd_result = shell_exec("df | awk '{print $3}'"); +$hdd_devices_used = explode("\n", trim($hdd_result)); +$hdd_result = shell_exec("df | awk '{print $4}'"); +$hdd_devices_free = explode("\n", trim($hdd_result)); +$hdd_result = shell_exec("df | awk '{print $5}'"); +$hdd_devices_percent = explode("\n", trim($hdd_result)); +$hdd_result = shell_exec("df | awk '{print $6}'"); +$hdd_devices_mount = explode("\n", trim($hdd_result)); + +// Client ---------------------------------------------------------- +echo '
+
+

This Client

+
+
+
+
User Agent
+
' . $_SERVER['HTTP_USER_AGENT'] . '
+
+
+
Browser Resolution:
+
+
+
+
'; + +// General ---------------------------------------------------------- +echo '
+
+

General

+
+
+
+
Full Date
+
' . $formatted_date . '
+
+
+
Date
+
' . $formatted_date2 . '
+
+
+
Date2
+
' . $formatted_date3 . '
+
+
+
Timezone
+
' . $timeZone . '
+
+
+
Uptime
+
' . $stat['uptime'] . '
+
+
+
Operating System
+
' . $stat['os_version'] . '
+
+
+
CPU Name:
+
' . $stat['cpu_model'] . '
+
+
+
CPU Cores:
+
' . $stat['cpu'] . ' @ ' . $stat['cpu_frequ'] . ' MHz
+
+
+
Memory:
+
' . $stat['mem_used'] . ' MB / ' . $stat['mem_total'] . ' MB
+
+
+
Memory %:
+
' . $memory_usage_percent . ' %
+
+
+
Total memory:
+
' . $total_memory . ' MB
+
+
+
Load AVG:
+
'. $load_average[0] .' '. $load_average[1] .' '. $load_average[2] .'
+
+
+
'; + +echo ''; + +// Storage usage ---------------------------------------------------------- +echo '
+
+

Storage usage

+
+
'; +for ($x = 0; $x < sizeof($hdd_devices); $x++) { + if (stristr($hdd_devices[$x], '/dev/')) { + if ($hdd_devices_total[$x] == 0) {$temp_total = 0;} else { $temp_total = number_format(round(($hdd_devices_total[$x] / 1024 / 1024), 2), 2, ',', '.');} + if ($hdd_devices_used[$x] == 0) {$temp_used = 0;} else { $temp_used = number_format(round(($hdd_devices_used[$x] / 1024 / 1024), 2), 2, ',', '.');} + if ($hdd_devices_free[$x] == 0) {$temp_free = 0;} else { $temp_free = number_format(round(($hdd_devices_free[$x] / 1024 / 1024), 2), 2, ',', '.');} + echo '
'; + echo '
Mount point "' . $hdd_devices_mount[$x] . '"
'; + echo '
Total: ' . $temp_total . ' GB
'; + echo '
Used: ' . $temp_used . ' GB (' . number_format($hdd_devices_percent[$x], 1, ',', '.') . '%)
'; + echo '
Free: ' . $temp_free . ' GB
'; + echo '
'; + } +} +echo '
' . $pia_lang['SysInfo_storage_note']; +echo '
+
'; +?> + +
+ + + + + + + +