Skip to content

Commit

Permalink
Fix: GPU情報取得失敗時の表示を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
shm11C3 committed Nov 3, 2024
1 parent 6c145ed commit 46df43d
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions src/template/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,26 +147,24 @@ const MemoryInfo = () => {
};

const Dashboard = () => {
return (
<>
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 ">
<DataArea>
<CPUInfo />
</DataArea>
<DataArea>
<GPUInfo />
</DataArea>
</div>
const { hardwareInfo } = useHardwareInfoAtom();

<div className="grid grid-cols-1 md:grid-cols-2 gap-4 ">
<DataArea>
<MemoryInfo />
</DataArea>
<DataArea>
<ProcessesTable defaultItemLength={6} />
</DataArea>
</div>
</>
const hardwareInfoList: { key: string; component: JSX.Element }[] = [
hardwareInfo.cpu && { key: "cpuInfo", component: <CPUInfo /> },
hardwareInfo.gpus && { key: "gpuInfo", component: <GPUInfo /> },
hardwareInfo.memory && { key: "memoryInfo", component: <MemoryInfo /> },
{
key: "processesTable",
component: <ProcessesTable defaultItemLength={6} />,
},
].filter((x) => x != null);

return (
<div className="grid grid-cols-1 md:grid-cols-2 gap-4">
{hardwareInfoList.map(({ key, component }) => (
<DataArea key={key}>{component}</DataArea>
))}
</div>
);
};

Expand Down

0 comments on commit 46df43d

Please sign in to comment.