diff --git a/app/[locale]/(main)/ClientComponents/ServerDetailChartClient.tsx b/app/[locale]/(main)/ClientComponents/ServerDetailChartClient.tsx index 4afc4b0cb..4edf4b7e4 100644 --- a/app/[locale]/(main)/ClientComponents/ServerDetailChartClient.tsx +++ b/app/[locale]/(main)/ClientComponents/ServerDetailChartClient.tsx @@ -104,7 +104,10 @@ function CpuChart({ data }: { data: NezhaAPISafe }) { const timestamp = Date.now().toString(); let newData = [] as cpuChartData[]; if (cpuChartData.length === 0) { - newData = [{ timeStamp: timestamp, cpu: cpu }, { timeStamp: timestamp, cpu: cpu }]; + newData = [ + { timeStamp: timestamp, cpu: cpu }, + { timeStamp: timestamp, cpu: cpu }, + ]; } else { newData = [...cpuChartData, { timeStamp: timestamp, cpu: cpu }]; } @@ -201,9 +204,15 @@ function ProcessChart({ data }: { data: NezhaAPISafe }) { const timestamp = Date.now().toString(); let newData = [] as processChartData[]; if (processChartData.length === 0) { - newData = [{ timeStamp: timestamp, process: process }, { timeStamp: timestamp, process: process }]; + newData = [ + { timeStamp: timestamp, process: process }, + { timeStamp: timestamp, process: process }, + ]; } else { - newData = [...processChartData, { timeStamp: timestamp, process: process }]; + newData = [ + ...processChartData, + { timeStamp: timestamp, process: process }, + ]; } if (newData.length > 30) { newData.shift(); @@ -285,9 +294,15 @@ function MemChart({ data }: { data: NezhaAPISafe }) { const timestamp = Date.now().toString(); let newData = [] as memChartData[]; if (memChartData.length === 0) { - newData = [{ timeStamp: timestamp, mem: mem, swap: swap }, { timeStamp: timestamp, mem: mem, swap: swap }]; + newData = [ + { timeStamp: timestamp, mem: mem, swap: swap }, + { timeStamp: timestamp, mem: mem, swap: swap }, + ]; } else { - newData = [...memChartData, { timeStamp: timestamp, mem: mem, swap: swap }]; + newData = [ + ...memChartData, + { timeStamp: timestamp, mem: mem, swap: swap }, + ]; } if (newData.length > 30) { newData.shift(); @@ -406,7 +421,10 @@ function DiskChart({ data }: { data: NezhaAPISafe }) { const timestamp = Date.now().toString(); let newData = [] as diskChartData[]; if (diskChartData.length === 0) { - newData = [{ timeStamp: timestamp, disk: disk }, { timeStamp: timestamp, disk: disk }]; + newData = [ + { timeStamp: timestamp, disk: disk }, + { timeStamp: timestamp, disk: disk }, + ]; } else { newData = [...diskChartData, { timeStamp: timestamp, disk: disk }]; } @@ -503,9 +521,15 @@ function NetworkChart({ data }: { data: NezhaAPISafe }) { const timestamp = Date.now().toString(); let newData = [] as networkChartData[]; if (networkChartData.length === 0) { - newData = [{ timeStamp: timestamp, upload: up, download: down }, { timeStamp: timestamp, upload: up, download: down }]; + newData = [ + { timeStamp: timestamp, upload: up, download: down }, + { timeStamp: timestamp, upload: up, download: down }, + ]; } else { - newData = [...networkChartData, { timeStamp: timestamp, upload: up, download: down }]; + newData = [ + ...networkChartData, + { timeStamp: timestamp, upload: up, download: down }, + ]; } if (newData.length > 30) { newData.shift(); @@ -623,9 +647,15 @@ function ConnectChart({ data }: { data: NezhaAPISafe }) { const timestamp = Date.now().toString(); let newData = [] as connectChartData[]; if (connectChartData.length === 0) { - newData = [{ timeStamp: timestamp, tcp: tcp, udp: udp }, { timeStamp: timestamp, tcp: tcp, udp: udp }]; + newData = [ + { timeStamp: timestamp, tcp: tcp, udp: udp }, + { timeStamp: timestamp, tcp: tcp, udp: udp }, + ]; } else { - newData = [...connectChartData, { timeStamp: timestamp, tcp: tcp, udp: udp }]; + newData = [ + ...connectChartData, + { timeStamp: timestamp, tcp: tcp, udp: udp }, + ]; } if (newData.length > 30) { newData.shift();