* Fix #489 * Update app/Filament/Resources/NodeResource/Pages/EditNode.php Co-authored-by: Boy132 <Boy132@users.noreply.github.com> * Update app/Filament/Resources/NodeResource/Pages/EditNode.php Co-authored-by: Boy132 <Boy132@users.noreply.github.com> * Update app/Filament/Resources/NodeResource/Pages/EditNode.php Co-authored-by: Boy132 <Boy132@users.noreply.github.com> --------- Co-authored-by: Boy132 <Boy132@users.noreply.github.com>
This commit is contained in:
parent
10806d6d6b
commit
56b4938dc2
@ -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),
|
||||
|
@ -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) . '%';
|
||||
|
Loading…
x
Reference in New Issue
Block a user