Show error if gpu stats could not be retrieved

This commit is contained in:
Nick Mowen 2022-11-15 08:56:47 -07:00
parent f172e3d851
commit 35947e2761

View File

@ -187,20 +187,27 @@ export default function System() {
<div key={gpu} className="dark:bg-gray-800 shadow-md hover:shadow-lg rounded-lg transition-shadow"> <div key={gpu} className="dark:bg-gray-800 shadow-md hover:shadow-lg rounded-lg transition-shadow">
<div className="text-lg flex justify-between p-4">{gpu}</div> <div className="text-lg flex justify-between p-4">{gpu}</div>
<div className="p-2"> <div className="p-2">
<Table className="w-full"> {gpu_usages[gpu]['gpu'] == -1 ? (
<Thead> <div className="p-4">
<Tr> There was an error getting usage stats. Either your GPU does not support this or frigate does
<Th>Gpu %</Th> not have proper access.
<Th>Memory %</Th> </div>
</Tr> ) : (
</Thead> <Table className="w-full">
<Tbody> <Thead>
<Tr> <Tr>
<Td>{gpu_usages[gpu]['gpu']}</Td> <Th>Gpu %</Th>
<Td>{gpu_usages[gpu]['mem']}</Td> <Th>Memory %</Th>
</Tr> </Tr>
</Tbody> </Thead>
</Table> <Tbody>
<Tr>
<Td>{gpu_usages[gpu]['gpu']}</Td>
<Td>{gpu_usages[gpu]['mem']}</Td>
</Tr>
</Tbody>
</Table>
)}
</div> </div>
</div> </div>
))} ))}