mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-29 10:54:46 +02:00
convert chart data from bytes to GiB
This commit is contained in:
parent
4e3f919d8e
commit
5f13c15c70
@ -40,8 +40,8 @@ class NodeMemoryChart extends ChartWidget
|
|||||||
/** @var Node $node */
|
/** @var Node $node */
|
||||||
$node = $this->record;
|
$node = $this->record;
|
||||||
|
|
||||||
$total = $node->statistics()['memory_total'] ?? 0;
|
$total = ($node->statistics()['memory_total'] ?? 0) / 1024 / 1024 / 1024;
|
||||||
$used = $node->statistics()['memory_used'] ?? 0;
|
$used = ($node->statistics()['memory_used'] ?? 0) / 1024 / 1024 / 1024;
|
||||||
$unused = $total - $used;
|
$unused = $total - $used;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
@ -40,8 +40,8 @@ class NodeStorageChart extends ChartWidget
|
|||||||
/** @var Node $node */
|
/** @var Node $node */
|
||||||
$node = $this->record;
|
$node = $this->record;
|
||||||
|
|
||||||
$total = $node->statistics()['disk_total'] ?? 0;
|
$total = ($node->statistics()['disk_total'] ?? 0) / 1024 / 1024 / 1024;
|
||||||
$used = $node->statistics()['disk_used'] ?? 0;
|
$used = ($node->statistics()['disk_used'] ?? 0) / 1024 / 1024 / 1024;
|
||||||
$unused = $total - $used;
|
$unused = $total - $used;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
Loading…
x
Reference in New Issue
Block a user