🐛fix: prevent render error when additional information missing from hardware (#5413)
This commit is contained in:
parent
ec2602307d
commit
0518fea2a2
@ -39,13 +39,7 @@ export const Route = createFileRoute(route.settings.hardware as any)({
|
|||||||
component: Hardware,
|
component: Hardware,
|
||||||
})
|
})
|
||||||
|
|
||||||
function SortableGPUItem({
|
function SortableGPUItem({ gpu, index }: { gpu: GPU; index: number }) {
|
||||||
gpu,
|
|
||||||
index,
|
|
||||||
}: {
|
|
||||||
gpu: GPU
|
|
||||||
index: number
|
|
||||||
}) {
|
|
||||||
const {
|
const {
|
||||||
attributes,
|
attributes,
|
||||||
listeners,
|
listeners,
|
||||||
@ -105,7 +99,7 @@ function SortableGPUItem({
|
|||||||
title={t('settings:hardware.driverVersion')}
|
title={t('settings:hardware.driverVersion')}
|
||||||
actions={
|
actions={
|
||||||
<span className="text-main-view-fg/80">
|
<span className="text-main-view-fg/80">
|
||||||
{gpu.additional_information?.driver_version}
|
{gpu.additional_information?.driver_version || '-'}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
@ -113,7 +107,7 @@ function SortableGPUItem({
|
|||||||
title={t('settings:hardware.computeCapability')}
|
title={t('settings:hardware.computeCapability')}
|
||||||
actions={
|
actions={
|
||||||
<span className="text-main-view-fg/80">
|
<span className="text-main-view-fg/80">
|
||||||
{gpu.additional_information?.compute_cap}
|
{gpu.additional_information?.compute_cap || '-'}
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
@ -164,7 +158,7 @@ function Hardware() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (pollingPaused) return;
|
if (pollingPaused) return
|
||||||
const intervalId = setInterval(() => {
|
const intervalId = setInterval(() => {
|
||||||
getHardwareInfo().then((data) => {
|
getHardwareInfo().then((data) => {
|
||||||
updateCPUUsage(data.cpu.usage)
|
updateCPUUsage(data.cpu.usage)
|
||||||
|
|||||||
@ -252,7 +252,7 @@ function SystemMonitor() {
|
|||||||
{t('system-monitor:driverVersion')}
|
{t('system-monitor:driverVersion')}
|
||||||
</span>
|
</span>
|
||||||
<span className="text-main-view-fg">
|
<span className="text-main-view-fg">
|
||||||
{gpu.additional_information.driver_version}
|
{gpu.additional_information?.driver_version || '-'}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex justify-between items-center">
|
<div className="flex justify-between items-center">
|
||||||
@ -260,7 +260,7 @@ function SystemMonitor() {
|
|||||||
{t('system-monitor:computeCapability')}
|
{t('system-monitor:computeCapability')}
|
||||||
</span>
|
</span>
|
||||||
<span className="text-main-view-fg">
|
<span className="text-main-view-fg">
|
||||||
{gpu.additional_information.compute_cap}
|
{gpu.additional_information?.compute_cap || '-'}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="mt-2">
|
<div className="mt-2">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user