mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-04-22 01:16:26 +02:00
add quota to user list
This commit is contained in:
parent
4a39865903
commit
03ae69b82a
3 changed files with 29 additions and 15 deletions
|
@ -53,6 +53,13 @@ class User extends \descartes\Controller
|
|||
public function list_json()
|
||||
{
|
||||
$entities = $this->internal_user->list();
|
||||
|
||||
foreach ($entities as &$entity)
|
||||
{
|
||||
$quota_percentage = $this->internal_quota->get_usage_percentage($entity['id']);
|
||||
$entity['quota_percentage'] = $quota_percentage * 100;
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(['data' => $entities]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue