diff --git a/src/App.tsx b/src/App.tsx index a8610c0..a39a267 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,5 +1,6 @@ import { useQuery } from "@tanstack/react-query" import React, { useCallback } from "react" +import { useTranslation } from "react-i18next" import { Route, BrowserRouter as Router, Routes } from "react-router-dom" import Footer from "./components/Footer" @@ -10,7 +11,6 @@ import ErrorPage from "./pages/ErrorPage" import NotFound from "./pages/NotFound" import Server from "./pages/Server" import ServerDetail from "./pages/ServerDetail" -import { useTranslation } from "react-i18next" const App: React.FC = () => { const { data: settingData, error } = useQuery({ @@ -48,7 +48,7 @@ const App: React.FC = () => { Array.from(tempDiv.childNodes).forEach((node) => { if (node.nodeType === Node.ELEMENT_NODE) { const element = node as HTMLElement - ; (handlers[element.tagName] || handlers.DEFAULT)(element) + ;(handlers[element.tagName] || handlers.DEFAULT)(element) } else if (node.nodeType === Node.TEXT_NODE) { document.body.appendChild(document.createTextNode(node.textContent || "")) } diff --git a/src/components/ServerDetailChart.tsx b/src/components/ServerDetailChart.tsx index 2e14352..4c9f785 100644 --- a/src/components/ServerDetailChart.tsx +++ b/src/components/ServerDetailChart.tsx @@ -138,7 +138,7 @@ function GpuChart({ now, gpuStat, gpuName }: { now: number; gpuStat: number; gpu {gpuName &&
GPU: {gpuName}
}{gpuStat.toFixed(0)}%
+{gpuStat.toFixed(2)}%
CPU
{cpu.toFixed(0)}%
+{cpu.toFixed(2)}%
{mem.toFixed(0)}%
+{mem.toFixed(2)}%
{swap.toFixed(0)}%
+{swap.toFixed(2)}%
{t("serverDetailChart.upload")}
{up.toFixed(2)} M/s
++ {up >= 1024 + ? `${(up / 1024).toFixed(2)}G/s` + : up >= 1 + ? `${up.toFixed(2)}M/s` + : `${(up * 1024).toFixed(2)}K/s`} +
{t("serverDetailChart.download")}
{down.toFixed(2)} M/s
++ {down >= 1024 + ? `${(down / 1024).toFixed(2)}G/s` + : down >= 1 + ? `${down.toFixed(2)}M/s` + : `${(down * 1024).toFixed(2)}K/s`} +