diff --git a/app/Filament/Admin/Resources/NodeResource/Widgets/NodeStorageChart.php b/app/Filament/Admin/Resources/NodeResource/Widgets/NodeStorageChart.php index c40c3a05f..af5f881b4 100644 --- a/app/Filament/Admin/Resources/NodeResource/Widgets/NodeStorageChart.php +++ b/app/Filament/Admin/Resources/NodeResource/Widgets/NodeStorageChart.php @@ -39,15 +39,18 @@ class NodeStorageChart extends ChartWidget protected function getData(): array { - $total = Number::format(config('panel.use_binary_prefix') + $total = config('panel.use_binary_prefix') ? ($this->node->statistics()['disk_total'] ?? 0) / 1024 / 1024 / 1024 - : ($this->node->statistics()['disk_total'] ?? 0) / 1000 / 1000 / 1000, maxPrecision: 2); - $used = Number::format(config('panel.use_binary_prefix') + : ($this->node->statistics()['disk_total'] ?? 0) / 1000 / 1000 / 1000; + $used = config('panel.use_binary_prefix') ? ($this->node->statistics()['disk_used'] ?? 0) / 1024 / 1024 / 1024 - : ($this->node->statistics()['disk_used'] ?? 0) / 1000 / 1000 / 1000, maxPrecision: 2); + : ($this->node->statistics()['disk_used'] ?? 0) / 1000 / 1000 / 1000; $unused = $total - $used; + $used = Number::format($used, maxPrecision: 2); + $unused = Number::format($unused, maxPrecision: 2); + return [ 'datasets' => [ [