mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 00:34:44 +02:00
Fix wrong language formatting in charts (#832)
This commit is contained in:
parent
993e2c4244
commit
02a0c5c3eb
@ -26,8 +26,8 @@ class NodeCpuChart extends ChartWidget
|
|||||||
$cpu = collect(cache()->get("nodes.$node->id.cpu_percent"))
|
$cpu = collect(cache()->get("nodes.$node->id.cpu_percent"))
|
||||||
->slice(-10)
|
->slice(-10)
|
||||||
->map(fn ($value, $key) => [
|
->map(fn ($value, $key) => [
|
||||||
'cpu' => Number::format($value * $threads, maxPrecision: 2, locale: auth()->user()->language),
|
'cpu' => Number::format($value * $threads, maxPrecision: 2),
|
||||||
'timestamp' => Carbon::createFromTimestamp($key, (auth()->user()->timezone ?? 'UTC'))->format('H:i:s'),
|
'timestamp' => Carbon::createFromTimestamp($key, auth()->user()->timezone ?? 'UTC')->format('H:i:s'),
|
||||||
])
|
])
|
||||||
->all();
|
->all();
|
||||||
|
|
||||||
@ -43,6 +43,7 @@ class NodeCpuChart extends ChartWidget
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
'labels' => array_column($cpu, 'timestamp'),
|
'labels' => array_column($cpu, 'timestamp'),
|
||||||
|
'locale' => auth()->user()->language ?? 'en',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,8 +24,8 @@ class NodeMemoryChart extends ChartWidget
|
|||||||
|
|
||||||
$memUsed = collect(cache()->get("nodes.$node->id.memory_used"))->slice(-10)
|
$memUsed = collect(cache()->get("nodes.$node->id.memory_used"))->slice(-10)
|
||||||
->map(fn ($value, $key) => [
|
->map(fn ($value, $key) => [
|
||||||
'memory' => Number::format(config('panel.use_binary_prefix') ? $value / 1024 / 1024 / 1024 : $value / 1000 / 1000 / 1000, maxPrecision: 2, locale: auth()->user()->language),
|
'memory' => Number::format(config('panel.use_binary_prefix') ? $value / 1024 / 1024 / 1024 : $value / 1000 / 1000 / 1000, maxPrecision: 2),
|
||||||
'timestamp' => Carbon::createFromTimestamp($key, (auth()->user()->timezone ?? 'UTC'))->format('H:i:s'),
|
'timestamp' => Carbon::createFromTimestamp($key, auth()->user()->timezone ?? 'UTC')->format('H:i:s'),
|
||||||
])
|
])
|
||||||
->all();
|
->all();
|
||||||
|
|
||||||
@ -41,6 +41,7 @@ class NodeMemoryChart extends ChartWidget
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
'labels' => array_column($memUsed, 'timestamp'),
|
'labels' => array_column($memUsed, 'timestamp'),
|
||||||
|
'locale' => auth()->user()->language ?? 'en',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,8 +21,8 @@ class ServerCpuChart extends ChartWidget
|
|||||||
$cpu = collect(cache()->get("servers.{$this->server->id}.cpu_absolute"))
|
$cpu = collect(cache()->get("servers.{$this->server->id}.cpu_absolute"))
|
||||||
->slice(-10)
|
->slice(-10)
|
||||||
->map(fn ($value, $key) => [
|
->map(fn ($value, $key) => [
|
||||||
'cpu' => Number::format($value, maxPrecision: 2, locale: auth()->user()->language),
|
'cpu' => Number::format($value, maxPrecision: 2),
|
||||||
'timestamp' => Carbon::createFromTimestamp($key, (auth()->user()->timezone ?? 'UTC'))->format('H:i:s'),
|
'timestamp' => Carbon::createFromTimestamp($key, auth()->user()->timezone ?? 'UTC')->format('H:i:s'),
|
||||||
])
|
])
|
||||||
->all();
|
->all();
|
||||||
|
|
||||||
@ -38,6 +38,7 @@ class ServerCpuChart extends ChartWidget
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
'labels' => array_column($cpu, 'timestamp'),
|
'labels' => array_column($cpu, 'timestamp'),
|
||||||
|
'locale' => auth()->user()->language ?? 'en',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,8 +20,8 @@ class ServerMemoryChart extends ChartWidget
|
|||||||
{
|
{
|
||||||
$memUsed = collect(cache()->get("servers.{$this->server->id}.memory_bytes"))->slice(-10)
|
$memUsed = collect(cache()->get("servers.{$this->server->id}.memory_bytes"))->slice(-10)
|
||||||
->map(fn ($value, $key) => [
|
->map(fn ($value, $key) => [
|
||||||
'memory' => Number::format(config('panel.use_binary_prefix') ? $value / 1024 / 1024 / 1024 : $value / 1000 / 1000 / 1000, maxPrecision: 2, locale: auth()->user()->language),
|
'memory' => Number::format(config('panel.use_binary_prefix') ? $value / 1024 / 1024 / 1024 : $value / 1000 / 1000 / 1000, maxPrecision: 2),
|
||||||
'timestamp' => Carbon::createFromTimestamp($key, (auth()->user()->timezone ?? 'UTC'))->format('H:i:s'),
|
'timestamp' => Carbon::createFromTimestamp($key, auth()->user()->timezone ?? 'UTC')->format('H:i:s'),
|
||||||
])
|
])
|
||||||
->all();
|
->all();
|
||||||
|
|
||||||
@ -37,6 +37,7 @@ class ServerMemoryChart extends ChartWidget
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
'labels' => array_column($memUsed, 'timestamp'),
|
'labels' => array_column($memUsed, 'timestamp'),
|
||||||
|
'locale' => auth()->user()->language ?? 'en',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user