Skip to content

Commit

Permalink
chore: update calculate ram and vram
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur committed Jan 16, 2025
1 parent d773717 commit 404edc8
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions web/screens/Settings/Hardware/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,17 +127,17 @@ const Hardware = () => {
<div className="flex items-center gap-3">
<Progress
value={Math.round(
(Number(hardware?.ram.available) /
Number(hardware?.ram.total)) *
(Number(hardware?.ram.total) -
Number(hardware?.ram.available)) *
100
)}
size="small"
className="w-full"
/>
<span className="font-medium">
{Math.round(
(Number(hardware?.ram.available) /
Number(hardware?.ram.total)) *
(Number(hardware?.ram.total) -
Number(hardware?.ram.available)) *
100
).toFixed()}
%
Expand All @@ -164,7 +164,7 @@ const Hardware = () => {
</div>
</div>
{/* GPUs */}
{!isMac && gpus.length > 1 && (
{!isMac && gpus.length > 0 && (
<div className="flex w-full flex-col items-start justify-between gap-4 border-b border-[hsla(var(--app-border))] py-4 first:pt-0 last:border-none sm:flex-row">
<div className="w-full flex-shrink-0">
<div className="flex gap-x-2">
Expand Down Expand Up @@ -220,17 +220,17 @@ const Hardware = () => {
<div className="flex w-40 items-center gap-3">
<Progress
value={Math.round(
(Number(item.free_vram) /
Number(item.total_vram)) *
(Number(item.total_vram) -
Number(item.free_vram)) *
100
)}
size="small"
className="w-full"
/>
<span className="font-medium">
{Math.round(
(Number(item.free_vram) /
Number(item.total_vram)) *
(Number(item.total_vram) -
Number(item.free_vram)) *
100
).toFixed()}
%
Expand Down

0 comments on commit 404edc8

Please sign in to comment.