diff --git a/app/Filament/Resources/NodeResource/Pages/EditNode.php b/app/Filament/Resources/NodeResource/Pages/EditNode.php index c6fd0e451..d72435fd2 100644 --- a/app/Filament/Resources/NodeResource/Pages/EditNode.php +++ b/app/Filament/Resources/NodeResource/Pages/EditNode.php @@ -52,16 +52,16 @@ class EditNode extends EditRecord ->schema([ Placeholder::make('') ->label('Wings Version') - ->content(fn (Node $node) => $node->systemInformation()['version']), + ->content(fn (Node $node) => $node->systemInformation()['version'] ?? 'Unknown'), Placeholder::make('') ->label('CPU Threads') - ->content(fn (Node $node) => $node->systemInformation()['cpu_count']), + ->content(fn (Node $node) => $node->systemInformation()['cpu_count'] ?? 0), Placeholder::make('') ->label('Architecture') - ->content(fn (Node $node) => $node->systemInformation()['architecture']), + ->content(fn (Node $node) => $node->systemInformation()['architecture'] ?? 'Unknown'), Placeholder::make('') ->label('Kernel') - ->content(fn (Node $node) => $node->systemInformation()['kernel_version']), + ->content(fn (Node $node) => $node->systemInformation()['kernel_version'] ?? 'Unknown'), ]), View::make('filament.components.node-cpu-chart')->columnSpan(3), View::make('filament.components.node-memory-chart')->columnSpan(3), diff --git a/app/Filament/Resources/NodeResource/Widgets/NodeCpuChart.php b/app/Filament/Resources/NodeResource/Widgets/NodeCpuChart.php index ecc6bc592..45d18fc90 100644 --- a/app/Filament/Resources/NodeResource/Widgets/NodeCpuChart.php +++ b/app/Filament/Resources/NodeResource/Widgets/NodeCpuChart.php @@ -19,7 +19,7 @@ class NodeCpuChart extends ChartWidget { /** @var Node $node */ $node = $this->record; - $threads = $node->systemInformation()['cpu_count']; + $threads = $node->systemInformation()['cpu_count'] ?? 0; $cpu = collect(cache()->get("nodes.$node->id.cpu_percent")) ->slice(-10) @@ -71,7 +71,7 @@ class NodeCpuChart extends ChartWidget { /** @var Node $node */ $node = $this->record; - $threads = $node->systemInformation()['cpu_count']; + $threads = $node->systemInformation()['cpu_count'] ?? 0; $cpu = number_format(collect(cache()->get("nodes.$node->id.cpu_percent"))->last() * $threads, 2); $max = number_format($threads * 100) . '%';