From 118bb1862cfca13201d349df8ec23b830921efb5 Mon Sep 17 00:00:00 2001 From: ShevAbam Date: Tue, 14 Jul 2015 15:16:12 +0200 Subject: [PATCH] Disk : add filesystem and option to enable/disable it (disk:show_filesystem) Network usage : center values of receive and transmit --- conf/esm.config.json | 3 ++- index.php | 4 +++- js/esm.js | 9 ++++++--- libs/disk.php | 9 +++++++-- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/conf/esm.config.json b/conf/esm.config.json index af3fe3d..c4bab8c 100644 --- a/conf/esm.config.json +++ b/conf/esm.config.json @@ -10,7 +10,8 @@ "enable_temperature": true }, "disk": { - "show_tmpfs": false + "show_tmpfs": false, + "show_filesystem": true }, "ping": { "hosts": [ diff --git a/index.php b/index.php index 1aa34af..5e8d5e9 100644 --- a/index.php +++ b/index.php @@ -226,7 +226,9 @@ $update = $Config->checkUpdate(); - + get('disk:show_filesystem')): ?> + + diff --git a/js/esm.js b/js/esm.js index ee7d52c..1016440 100644 --- a/js/esm.js +++ b/js/esm.js @@ -152,7 +152,10 @@ esm.getDisk = function() { var html = ''; html += ''; - html += ''; + + if (typeof data[line].filesystem != 'undefined') + html += ''; + html += ''; html += ''; html += ''; @@ -216,8 +219,8 @@ esm.getNetwork = function() { html += ''; html += ''; html += ''; - html += ''; - html += ''; + html += ''; + html += ''; html += ''; $box.append(html); diff --git a/libs/disk.php b/libs/disk.php index ed04934..f2b21cb 100644 --- a/libs/disk.php +++ b/libs/disk.php @@ -18,6 +18,7 @@ if (!(exec('/bin/df -T | awk -v c=`/bin/df -T | grep -bo "Type" | awk -F: \'{pri else { $mounted_points = array(); + $key = 0; foreach ($df as $mounted) { @@ -30,15 +31,19 @@ else { $mounted_points[] = trim($mount); - $datas[] = array( + $datas[$key] = array( 'total' => Misc::getSize($total * 1024), 'used' => Misc::getSize($used * 1024), 'free' => Misc::getSize($free * 1024), 'percent_used' => trim($percent, '%'), 'mount' => $mount, - 'filesystem' => $filesystem, ); + + if ($Config->get('disk:show_filesystem')) + $datas[$key]['filesystem'] = $filesystem; } + + $key++; } }
FilesystemFilesystem Mount Use Free
'+data[line].filesystem+''+data[line].filesystem+''+data[line].mount+'
'+data[line].percent_used+'%
'+data[line].free+'
'+data[line].interface+''+data[line].ip+''+data[line].receive+''+data[line].transmit+''+data[line].receive+''+data[line].transmit+'