{/* 系统信息 */}
系统信息
系统: {formatSystemInfo()}
{computerInfo.CsName && (
主机名: {computerInfo.CsName}
)}
{!computerInfo.CsName && allSysData?.hostname && (
主机名: {allSysData.hostname}
)}
{/* CPU 信息 */}
处理器
型号: {allSysData?.cpus?.[0]?.brand || "未知"}
{averageCpuFrequency !== null && (
频率: {averageCpuFrequency.toFixed(2)} GHz
)}
核心数: {allSysData?.cpu_count || "未知"}
{/* 内存信息 */}
{allSysData?.total_memory && (
内存
{/* 第一行:总容量和已用内存 */}
总容量: {formatBytes(allSysData.total_memory)}
{allSysData.used_memory !== undefined && (
已用: {formatBytes(allSysData.used_memory)}
{memoryUsagePercent !== null && (
({memoryUsagePercent}%)
)}
)}
{/* 每个内存条的详细信息 */}
{memoryInfo.length > 0 && (
{memoryInfo.map((mem, index) => (
{mem.capacity && (
容量: {formatBytes(mem.capacity)}
)}
{mem.manufacturer && (
制造商: {mem.manufacturer}
)}
{mem.speed && (
频率: {mem.speed} MHz
{mem.default_speed && (
({mem.default_speed} MHz)
)}
)}
))}
)}
)}
{/* GPU 信息 */}
{gpuInfo ? (
显卡
型号: {gpuInfo.model}
总显存: {formatBytes(gpuInfo.total_vram)}
已用显存: {formatBytes(gpuInfo.used_vram)}
温度: {gpuInfo.temperature.toFixed(2)}°C
) : (
allSysData?.components &&
allSysData.components.length > 0 &&
(() => {
const gpuComponents = allSysData.components.filter(
(comp) =>
comp.label?.toLowerCase().includes("gpu") ||
comp.label?.toLowerCase().includes("graphics") ||
comp.label?.toLowerCase().includes("显卡")
)
if (gpuComponents.length === 0) return null
return (
显卡
{gpuComponents.map((gpu, index) => (
GPU{index > 0 ? ` ${index + 1}` : ""}:{" "}
{gpu.label || "未知"}
{gpu.temperature !== undefined && (
({gpu.temperature}°C{gpu.max !== undefined ? ` / ${gpu.max}°C` : ""})
)}
))}
)
})()
)}
{/* 主板信息 */}
{(motherboardInfo?.model ||
motherboardInfo?.manufacturer ||
motherboardInfo?.version ||
computerInfo.BiosSMBIOSBIOSVersion) && (
主板
{motherboardInfo?.model && (
型号: {motherboardInfo.model}
)}
{motherboardInfo?.manufacturer && (
品牌: {motherboardInfo.manufacturer}
)}
{motherboardInfo?.version && (
版本: {motherboardInfo.version}
)}
{computerInfo.BiosSMBIOSBIOSVersion && (
BIOS版本: {computerInfo.BiosSMBIOSBIOSVersion}
)}
)}
{/* 显示器信息 */}
{monitorInfo.length > 0 && monitorInfo.some((m) => m.refresh_rate) && (
显示器
{monitorInfo.map(
(monitor, index) =>
monitor.refresh_rate && (
刷新率{monitorInfo.length > 1 ? ` ${index + 1}` : ""}:
{" "}
{monitor.refresh_rate} Hz
)
)}
)}
{/* 电池信息 */}
{allSysData?.batteries && allSysData.batteries.length > 0 && (
电池
{allSysData.batteries.map((battery, index) => (
电池{index > 0 ? ` ${index + 1}` : ""}:
{battery.state && `${battery.state} `}
{battery.state_of_charge !== undefined && `${battery.state_of_charge}% `}
{battery.energy_full !== undefined && battery.energy !== undefined && (
({formatBytes(battery.energy)} / {formatBytes(battery.energy_full)})
)}
))}
)}
)
}