From b258ffd03a293b9a9e5a06bcbc25944c97c5b0d2 Mon Sep 17 00:00:00 2001 From: EA4GKQ Date: Tue, 28 Jun 2016 16:30:19 +0200 Subject: [PATCH 1/3] Create disk.php --- include/disk.php | 87 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 include/disk.php diff --git a/include/disk.php b/include/disk.php new file mode 100644 index 0000000..b5b2277 --- /dev/null +++ b/include/disk.php @@ -0,0 +1,87 @@ +
+ +
Disk use
+ +
+ + + + + + + + + + + + + + + + 'N.A', + 'used' => 'N.A', + 'free' => 'N.A', + 'percent_used' => 0, + 'mount' => 'N.A', + 'filesystem' => 'N.A', + ); +} +else +{ + $mounted_points = array(); + $key = 0; + + foreach ($df as $mounted) + { + list($filesystem, $type, $total, $used, $free, $percent, $mount) = explode(',', $mounted); + + if (strpos($type, 'tmpfs') !== false ) + continue; + + +?> + + + + + + + + + + + + + + + +
FilesystemMountUseFreeUsedTotal
%
+
+
+ + From 4c6862add92cf564d740762faa49cd8f0de2082c Mon Sep 17 00:00:00 2001 From: EA4GKQ Date: Tue, 28 Jun 2016 16:31:59 +0200 Subject: [PATCH 2/3] add disk info section --- index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/index.php b/index.php index 934100e..363c3fe 100644 --- a/index.php +++ b/index.php @@ -50,6 +50,7 @@ include "include/functions.php"; checkSetup(); // Here you can feel free to disable info-sections by commenting out with // before include include "include/sysinfo.php"; +include "include/disk.php"; include "include/repeaterinfo.php"; include "include/modes.php"; include "include/lh.php"; From daa65b272fa29eb6ebcedcef71f4d1e979994a69 Mon Sep 17 00:00:00 2001 From: EA4GKQ Date: Tue, 28 Jun 2016 16:33:17 +0200 Subject: [PATCH 3/3] add getSize function --- include/functions.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/functions.php b/include/functions.php index 711829b..c02c47e 100644 --- a/include/functions.php +++ b/include/functions.php @@ -459,6 +459,21 @@ function getActiveYSFReflectors($logLines) { return $reflectorlist; } + + function getSize($filesize, $precision = 2) + { + $units = array('', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'); + + foreach ($units as $idUnit => $unit) + { + if ($filesize > 1024) + $filesize /= 1024; + else + break; + } + + return round($filesize, $precision).' '.$units[$idUnit].'B'; + } //Some basic inits $mmdvmconfigs = getMMDVMConfig(); $logLinesMMDVM = getMMDVMLog();