diff options
author | ShevAbam <shevabam@gmail.com> | 2015-07-14 15:16:12 +0200 |
---|---|---|
committer | ShevAbam <shevabam@gmail.com> | 2015-07-14 15:16:12 +0200 |
commit | 118bb1862cfca13201d349df8ec23b830921efb5 (patch) | |
tree | 068eba472ca5bf77f26e2fa3c408811eb821f9ad | |
parent | b330d193bbd0170b6caabd604d30fc64c7b1d2d3 (diff) |
Disk : add filesystem and option to enable/disable it (disk:show_filesystem)
Network usage : center values of receive and transmit
-rw-r--r-- | conf/esm.config.json | 3 | ||||
-rw-r--r-- | index.php | 4 | ||||
-rw-r--r-- | js/esm.js | 9 | ||||
-rw-r--r-- | 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": [ @@ -226,7 +226,9 @@ $update = $Config->checkUpdate(); <table> <thead> <tr> - <th class="w10p">Filesystem</th> + <?php if ($Config->get('disk:show_filesystem')): ?> + <th class="w10p">Filesystem</th> + <?php endif; ?> <th class="w20p">Mount</th> <th>Use</th> <th class="w15p">Free</th> @@ -152,7 +152,10 @@ esm.getDisk = function() { var html = ''; html += '<tr>'; - html += '<td>'+data[line].filesystem+'</td>'; + + if (typeof data[line].filesystem != 'undefined') + html += '<td>'+data[line].filesystem+'</td>'; + html += '<td>'+data[line].mount+'</td>'; html += '<td><div class="progressbar-wrap"><div class="progressbar '+bar_class+'" style="width: '+data[line].percent_used+'%;">'+data[line].percent_used+'%</div></div></td>'; html += '<td class="t-center">'+data[line].free+'</td>'; @@ -216,8 +219,8 @@ esm.getNetwork = function() { html += '<tr>'; html += '<td>'+data[line].interface+'</td>'; html += '<td>'+data[line].ip+'</td>'; - html += '<td class="t-right">'+data[line].receive+'</td>'; - html += '<td class="t-right">'+data[line].transmit+'</td>'; + html += '<td class="t-center">'+data[line].receive+'</td>'; + html += '<td class="t-center">'+data[line].transmit+'</td>'; html += '</tr>'; $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++; } } |