mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-29 07:24:45 +02:00
* 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([
|
->schema([
|
||||||
Placeholder::make('')
|
Placeholder::make('')
|
||||||
->label('Wings Version')
|
->label('Wings Version')
|
||||||
->content(fn (Node $node) => $node->systemInformation()['version']),
|
->content(fn (Node $node) => $node->systemInformation()['version'] ?? 'Unknown'),
|
||||||
Placeholder::make('')
|
Placeholder::make('')
|
||||||
->label('CPU Threads')
|
->label('CPU Threads')
|
||||||
->content(fn (Node $node) => $node->systemInformation()['cpu_count']),
|
->content(fn (Node $node) => $node->systemInformation()['cpu_count'] ?? 0),
|
||||||
Placeholder::make('')
|
Placeholder::make('')
|
||||||
->label('Architecture')
|
->label('Architecture')
|
||||||
->content(fn (Node $node) => $node->systemInformation()['architecture']),
|
->content(fn (Node $node) => $node->systemInformation()['architecture'] ?? 'Unknown'),
|
||||||
Placeholder::make('')
|
Placeholder::make('')
|
||||||
->label('Kernel')
|
->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-cpu-chart')->columnSpan(3),
|
||||||
View::make('filament.components.node-memory-chart')->columnSpan(3),
|
View::make('filament.components.node-memory-chart')->columnSpan(3),
|
||||||
|
@ -19,7 +19,7 @@ class NodeCpuChart extends ChartWidget
|
|||||||
{
|
{
|
||||||
/** @var Node $node */
|
/** @var Node $node */
|
||||||
$node = $this->record;
|
$node = $this->record;
|
||||||
$threads = $node->systemInformation()['cpu_count'];
|
$threads = $node->systemInformation()['cpu_count'] ?? 0;
|
||||||
|
|
||||||
$cpu = collect(cache()->get("nodes.$node->id.cpu_percent"))
|
$cpu = collect(cache()->get("nodes.$node->id.cpu_percent"))
|
||||||
->slice(-10)
|
->slice(-10)
|
||||||
@ -71,7 +71,7 @@ class NodeCpuChart extends ChartWidget
|
|||||||
{
|
{
|
||||||
/** @var Node $node */
|
/** @var Node $node */
|
||||||
$node = $this->record;
|
$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);
|
$cpu = number_format(collect(cache()->get("nodes.$node->id.cpu_percent"))->last() * $threads, 2);
|
||||||
$max = number_format($threads * 100) . '%';
|
$max = number_format($threads * 100) . '%';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user