mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-18 14:23:44 +02:00
Include resource total allocations; closes #1518
This commit is contained in:
@@ -44,6 +44,13 @@ class NodeTransformer extends BaseTransformer
|
||||
$response[$node->getUpdatedAtColumn()] = $this->formatTimestamp($node->updated_at);
|
||||
$response[$node->getCreatedAtColumn()] = $this->formatTimestamp($node->created_at);
|
||||
|
||||
$resources = $node->servers()->select(['memory', 'disk'])->get();
|
||||
|
||||
$response['allocated_resources'] = [
|
||||
'memory' => $resources->sum('memory'),
|
||||
'disk' => $resources->sum('disk'),
|
||||
];
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user