fix: gpu selector issues

This commit is contained in:
jialin
2025-10-28 11:17:29 +08:00
parent 697f1f9c25
commit a86bed294e
7 changed files with 52 additions and 30 deletions
+10 -4
View File
@@ -21,6 +21,12 @@ const Header = styled.div`
width: 100%;
`;
const ItemInfo = styled.div`
display: flex;
flex-wrap: wrap;
white-space: break-spaces;
`;
const Description = styled.div`
display: flex;
flex-direction: column;
@@ -60,7 +66,7 @@ const GPUCard: React.FC<{
description={
info || (
<>
<span>
<ItemInfo>
{intl.formatMessage({ id: 'resources.table.vram' })}(
{intl.formatMessage({ id: 'resources.table.used' })}/
{intl.formatMessage({ id: 'resources.table.total' })}):{' '}
@@ -70,8 +76,8 @@ const GPUCard: React.FC<{
)}{' '}
/ {convertFileSize(data?.memory?.total || 0)}
</span>
</span>
<span>
</ItemInfo>
<ItemInfo>
<span>
{intl.formatMessage({ id: 'resources.table.gpuutilization' })}
:{' '}
@@ -80,7 +86,7 @@ const GPUCard: React.FC<{
? _.round(data?.memory?.utilization_rate || 0, 2)
: _.round(data.memory?.allocated / data.memory?.total, 2) * 100}
%
</span>
</ItemInfo>
</>
)
}