diff --git a/www/index.php b/www/index.php index bddbf60..12c3e9a 100644 --- a/www/index.php +++ b/www/index.php @@ -91,15 +91,18 @@ if ($path == '') { if ($format === 'text') { header('Content-Type: text/plain; charset=UTF-8'); - foreach ($clients as $c) - echo "$c\n"; + foreach ($clients as $c) { + $size = intval(exec("du -s .data/$c")); + echo "$c ($size kB)\n"; + } } else if ($format === 'json') { header('Content-Type: application/json; charset=UTF-8'); echo "{\"data\": ["; $first = true; foreach ($clients as $c) { if (!$first) echo ","; - echo "\n {\"name\": \"$c\"}"; + $size = intval(exec("du -s .data/$c")) * 1024; + echo "\n {\"name\": \"$c\", \"used_space\": $size}"; $first = false; } echo "\n]}\n"; @@ -122,10 +125,11 @@ if ($path == '') {
Name | |
---|---|
Name | Used | $c | \n"; + $size = intval(exec("du -s .data/$c")); + echo "
$c | $size kB |