fix: should not show vulkan options in cpu only mode (#5210)

This commit is contained in:
Louis 2025-06-07 00:55:01 +07:00 committed by GitHub
parent c444643294
commit 1fa9f4e731
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -282,6 +282,8 @@ function Hardware() {
title="Usage" title="Usage"
actions={ actions={
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
{hardwareData.cpu?.usage > 0 && (
<>
<Progress <Progress
value={hardwareData.cpu?.usage} value={hardwareData.cpu?.usage}
className="h-2 w-10" className="h-2 w-10"
@ -289,6 +291,8 @@ function Hardware() {
<span className="text-main-view-fg/80"> <span className="text-main-view-fg/80">
{hardwareData.cpu?.usage?.toFixed(2)}% {hardwareData.cpu?.usage?.toFixed(2)}%
</span> </span>
</>
)}
</div> </div>
} }
/> />
@ -316,6 +320,8 @@ function Hardware() {
title="Usage" title="Usage"
actions={ actions={
<div className="flex items-center gap-2"> <div className="flex items-center gap-2">
{hardwareData.ram?.total > 0 && (
<>
<Progress <Progress
value={ value={
((hardwareData.ram?.total - ((hardwareData.ram?.total -
@ -334,12 +340,15 @@ function Hardware() {
).toFixed(2)} ).toFixed(2)}
% %
</span> </span>
</>
)}
</div> </div>
} }
/> />
</Card> </Card>
{/* Vulkan Settings */} {/* Vulkan Settings */}
{hardwareData.gpus.length > 0 && (
<Card title="Vulkan"> <Card title="Vulkan">
<CardItem <CardItem
title="Enable Vulkan" title="Enable Vulkan"
@ -359,6 +368,7 @@ function Hardware() {
} }
/> />
</Card> </Card>
)}
{/* GPU Information */} {/* GPU Information */}
<Card title="GPUs"> <Card title="GPUs">