mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-03 17:55:21 +03:00
Show recording and snapshot storage separately if different sizes
This commit is contained in:
parent
e0a0d129df
commit
2665a05292
@ -18,11 +18,42 @@ export default function Storage() {
|
|||||||
|
|
||||||
const { service } = stats || initialStats || emptyObject;
|
const { service } = stats || initialStats || emptyObject;
|
||||||
|
|
||||||
|
let storage_usage;
|
||||||
|
if (
|
||||||
|
service &&
|
||||||
|
service['storage']['/media/frigate/recordings']['total'] != service['storage']['/media/frigate/recordings']['total']
|
||||||
|
) {
|
||||||
|
storage_usage = (
|
||||||
|
<Fragment>
|
||||||
|
<Tr>
|
||||||
|
<Td>Recordings</Td>
|
||||||
|
<Td>{service['storage']['/media/frigate/recordings']['used']}</Td>
|
||||||
|
<Td>{service['storage']['/media/frigate/recordings']['total']}</Td>
|
||||||
|
</Tr>
|
||||||
|
<Tr>
|
||||||
|
<Td>Snapshots</Td>
|
||||||
|
<Td>{service['storage']['/media/frigate/clips']['used']}</Td>
|
||||||
|
<Td>{service['storage']['/media/frigate/clips']['total']}</Td>
|
||||||
|
</Tr>
|
||||||
|
</Fragment>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
storage_usage = (
|
||||||
|
<Fragment>
|
||||||
|
<Tr>
|
||||||
|
<Td>Recordings & Snapshots</Td>
|
||||||
|
<Td>{service['storage']['/media/frigate/recordings']['used']}</Td>
|
||||||
|
<Td>{service['storage']['/media/frigate/recordings']['total']}</Td>
|
||||||
|
</Tr>
|
||||||
|
</Fragment>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-4 p-2 px-4">
|
<div className="space-y-4 p-2 px-4">
|
||||||
<Heading>Storage</Heading>
|
<Heading>Storage</Heading>
|
||||||
|
|
||||||
{(!service || !storage) ? (
|
{!service || !storage ? (
|
||||||
<div>
|
<div>
|
||||||
<ActivityIndicator />
|
<ActivityIndicator />
|
||||||
</div>
|
</div>
|
||||||
@ -41,13 +72,7 @@ export default function Storage() {
|
|||||||
<Th>Total MB</Th>
|
<Th>Total MB</Th>
|
||||||
</Tr>
|
</Tr>
|
||||||
</Thead>
|
</Thead>
|
||||||
<Tbody>
|
<Tbody>{storage_usage}</Tbody>
|
||||||
<Tr>
|
|
||||||
<Td>Snapshots & Recordings</Td>
|
|
||||||
<Td>{service['storage']['/media/frigate/recordings']['used']}</Td>
|
|
||||||
<Td>{service['storage']['/media/frigate/recordings']['total']}</Td>
|
|
||||||
</Tr>
|
|
||||||
</Tbody>
|
|
||||||
</Table>
|
</Table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -97,7 +122,7 @@ export default function Storage() {
|
|||||||
<Tbody>
|
<Tbody>
|
||||||
<Tr>
|
<Tr>
|
||||||
<Td>{Math.round(camera['usage_percent'] ?? 0)}%</Td>
|
<Td>{Math.round(camera['usage_percent'] ?? 0)}%</Td>
|
||||||
<Td>{camera['bandwidth'] ? camera['bandwidth'] : "Calculating..."} MB/hr</Td>
|
<Td>{camera['bandwidth'] ? camera['bandwidth'] : 'Calculating...'} MB/hr</Td>
|
||||||
</Tr>
|
</Tr>
|
||||||
</Tbody>
|
</Tbody>
|
||||||
</Table>
|
</Table>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user