mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
fix(DetailChart): NaN on detail chart
This commit is contained in:
parent
adaea14bc9
commit
d6be65e321
18
lib/utils.ts
18
lib/utils.ts
@ -10,16 +10,16 @@ export function formatNezhaInfo(serverInfo: NezhaAPISafe) {
|
|||||||
return {
|
return {
|
||||||
...serverInfo,
|
...serverInfo,
|
||||||
cpu: serverInfo.status.CPU,
|
cpu: serverInfo.status.CPU,
|
||||||
process: serverInfo.status.ProcessCount,
|
process: serverInfo.status.ProcessCount || 0,
|
||||||
up: serverInfo.status.NetOutSpeed / 1024 / 1024,
|
up: serverInfo.status.NetOutSpeed / 1024 / 1024 || 0,
|
||||||
down: serverInfo.status.NetInSpeed / 1024 / 1024,
|
down: serverInfo.status.NetInSpeed / 1024 / 1024 || 0,
|
||||||
online: serverInfo.online_status,
|
online: serverInfo.online_status,
|
||||||
tcp: serverInfo.status.TcpConnCount,
|
tcp: serverInfo.status.TcpConnCount || 0,
|
||||||
udp: serverInfo.status.UdpConnCount,
|
udp: serverInfo.status.UdpConnCount || 0,
|
||||||
mem: (serverInfo.status.MemUsed / serverInfo.host.MemTotal) * 100,
|
mem: (serverInfo.status.MemUsed / serverInfo.host.MemTotal) * 100 || 0,
|
||||||
swap: (serverInfo.status.SwapUsed / serverInfo.host.SwapTotal) * 100,
|
swap: (serverInfo.status.SwapUsed / serverInfo.host.SwapTotal) * 100 || 0,
|
||||||
disk: (serverInfo.status.DiskUsed / serverInfo.host.DiskTotal) * 100,
|
disk: (serverInfo.status.DiskUsed / serverInfo.host.DiskTotal) * 100 || 0,
|
||||||
stg: (serverInfo.status.DiskUsed / serverInfo.host.DiskTotal) * 100,
|
stg: (serverInfo.status.DiskUsed / serverInfo.host.DiskTotal) * 100 || 0,
|
||||||
country_code: serverInfo.host.CountryCode,
|
country_code: serverInfo.host.CountryCode,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,6 @@ const withPWA = withPWAInit({
|
|||||||
/** @type {import('next').NextConfig} */
|
/** @type {import('next').NextConfig} */
|
||||||
const nextConfig = {
|
const nextConfig = {
|
||||||
output: "standalone",
|
output: "standalone",
|
||||||
reactStrictMode: true,
|
|
||||||
logging: {
|
logging: {
|
||||||
fetches: {
|
fetches: {
|
||||||
fullUrl: true,
|
fullUrl: true,
|
||||||
|
Loading…
Reference in New Issue
Block a user