mirror of
https://github.com/woodchen-ink/nezha-dash-v1.git
synced 2025-07-18 09:31:55 +08:00
fix(overview): text display
This commit is contained in:
parent
8515674d72
commit
8010b69d79
@ -221,15 +221,17 @@ export default function ServerDetailOverview({
|
||||
</section>
|
||||
</CardContent>
|
||||
</Card>
|
||||
{server?.state.temperatures && server?.state.temperatures.length > 0 && (
|
||||
{server?.state.temperatures &&
|
||||
server?.state.temperatures.length > 0 && (
|
||||
<Card className="rounded-[10px] bg-transparent border-none shadow-none">
|
||||
<CardContent className="px-1.5 py-1">
|
||||
<section className="flex flex-col items-start gap-0.5">
|
||||
<p className="text-xs text-muted-foreground">{"温度"}</p>
|
||||
<section className="flex items-start gap-2">
|
||||
{server?.state.temperatures.map((item,index) => (
|
||||
{server?.state.temperatures.map((item, index) => (
|
||||
<div className="text-xs flex items-center" key={index}>
|
||||
<p className=" font-semibold">{item.Name}</p>: {item.Temperature.toFixed(2)} °C
|
||||
<p className=" font-semibold">{item.Name}</p>:{" "}
|
||||
{item.Temperature.toFixed(2)} °C
|
||||
</div>
|
||||
))}
|
||||
</section>
|
||||
|
@ -2,7 +2,10 @@ import { Card, CardContent } from "@/components/ui/card";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { formatBytes } from "@/lib/format";
|
||||
import { Separator } from "./ui/separator";
|
||||
import {
|
||||
ArrowDownCircleIcon,
|
||||
ArrowUpCircleIcon,
|
||||
} from "@heroicons/react/20/solid";
|
||||
|
||||
type ServerOverviewProps = {
|
||||
online: number;
|
||||
@ -90,20 +93,12 @@ export default function ServerOverview({
|
||||
)}
|
||||
>
|
||||
<CardContent className="flex h-full items-center relative px-6 py-3">
|
||||
<section className="flex flex-col gap-1">
|
||||
<div className="flex items-center gap-1">
|
||||
<section className="flex flex-col gap-1 w-full">
|
||||
<div className="flex items-center w-full justify-between">
|
||||
<p className="text-sm font-medium md:text-base">
|
||||
{t("serverOverview.totalBandwidth")}
|
||||
{t("serverOverview.network")}
|
||||
</p>
|
||||
<Separator
|
||||
orientation="vertical"
|
||||
className="h-4 w-[1px]"
|
||||
/>
|
||||
<p className="text-sm font-medium md:text-base">
|
||||
{t("serverOverview.speed")}
|
||||
</p>
|
||||
</div>
|
||||
<section className="flex flex-row sm:items-center items-start gap-1">
|
||||
<section className="flex flex-row z-[999] sm:items-center items-start pr-2 sm:pr-0 gap-1 ml-auto">
|
||||
<p className="sm:text-[12px] text-[10px] text-nowrap font-semibold">
|
||||
↑{formatBytes(up)}
|
||||
</p>
|
||||
@ -111,12 +106,17 @@ export default function ServerOverview({
|
||||
↓{formatBytes(down)}
|
||||
</p>
|
||||
</section>
|
||||
<section className="flex flex-row sm:items-center items-start gap-1">
|
||||
<p className="sm:text-[12px] text-[10px] text-nowrap font-semibold">
|
||||
↑{formatBytes(upSpeed)}/s
|
||||
</div>
|
||||
<section className="flex flex-row mt-1.5 -mr-1 sm:items-center items-start gap-1">
|
||||
<p className="sm:text-[12px] flex items-center text-[10px] text-nowrap font-bold">
|
||||
<ArrowUpCircleIcon className="size-3 mr-0.5 sm:mb-[1.1px]" />
|
||||
{formatBytes(
|
||||
upSpeed,
|
||||
)}/s
|
||||
</p>
|
||||
<p className="sm:text-[12px] text-[10px] text-nowrap font-semibold">
|
||||
↓{formatBytes(downSpeed)}/s
|
||||
<p className="sm:text-[12px] flex items-center text-[10px] text-nowrap font-bold">
|
||||
<ArrowDownCircleIcon className="size-3 mr-0.5" />↓
|
||||
{formatBytes(downSpeed)}/s
|
||||
</p>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -15,7 +15,8 @@
|
||||
"onlineServers": "Online Servers",
|
||||
"offlineServers": "Offline Servers",
|
||||
"totalBandwidth": "Total Bandwidth",
|
||||
"speed": "Speed"
|
||||
"speed": "Speed",
|
||||
"network": "Network"
|
||||
},
|
||||
"serverCard": {
|
||||
"mem": "MEM",
|
||||
|
@ -15,7 +15,8 @@
|
||||
"onlineServers": "在线服务器",
|
||||
"offlineServers": "离线服务器",
|
||||
"totalBandwidth": "总流量",
|
||||
"speed": "速率"
|
||||
"speed": "速率",
|
||||
"network": "网络"
|
||||
},
|
||||
"serverCard": {
|
||||
"mem": "内存",
|
||||
|
@ -15,7 +15,8 @@
|
||||
"onlineServers": "線上服務器",
|
||||
"offlineServers": "離線服務器",
|
||||
"totalBandwidth": "總帶寬",
|
||||
"speed": "速率"
|
||||
"speed": "速率",
|
||||
"network": "網路"
|
||||
},
|
||||
"serverCard": {
|
||||
"mem": "內存",
|
||||
|
@ -62,7 +62,7 @@ export default defineConfig({
|
||||
server: {
|
||||
proxy: {
|
||||
"/api/v1/ws/server": {
|
||||
target: "ws://localhost:8080",
|
||||
target: "ws://localhost:8008",
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user