diff --git a/web/src/routes/Storage.jsx b/web/src/routes/Storage.jsx index ff2602f7d..6dfc9165a 100644 --- a/web/src/routes/Storage.jsx +++ b/web/src/routes/Storage.jsx @@ -18,95 +18,118 @@ export default function Storage() { const { service } = stats || initialStats || emptyObject; + if (!service || !storage) { + return ; + } + + let storage_usage; + if ( + service && + service['storage']['/media/frigate/recordings']['total'] != service['storage']['/media/frigate/clips']['total'] + ) { + storage_usage = ( + + + Recordings + {service['storage']['/media/frigate/recordings']['used']} + {service['storage']['/media/frigate/recordings']['total']} + + + Snapshots + {service['storage']['/media/frigate/clips']['used']} + {service['storage']['/media/frigate/clips']['total']} + + + ); + } else { + storage_usage = ( + + + Recordings & Snapshots + {service['storage']['/media/frigate/recordings']['used']} + {service['storage']['/media/frigate/recordings']['total']} + + + ); + } + return (
Storage - {(!service || !storage) ? ( -
- + + Overview +
+
+
Data
+
+ + + + + + + + + {storage_usage} +
LocationUsed MBTotal MB
+
+
+
+
Memory
+
+ + + + + + + + + + + + + + + + + + + + +
LocationUsed MBTotal MB
/dev/shm{service['storage']['/dev/shm']['used']}{service['storage']['/dev/shm']['total']}
/tmp/cache{service['storage']['/tmp/cache']['used']}{service['storage']['/tmp/cache']['total']}
+
+
- ) : ( - - Overview -
-
-
Data
-
- - - - - - - - - - - - - - - -
LocationUsed MBTotal MB
Snapshots & Recordings{service['storage']['/media/frigate/recordings']['used']}{service['storage']['/media/frigate/recordings']['total']}
-
-
-
-
Memory
-
- - - - - - - - - - - - - - - - - - - - -
LocationUsed MBTotal MB
/dev/shm{service['storage']['/dev/shm']['used']}{service['storage']['/dev/shm']['total']}
/tmp/cache{service['storage']['/tmp/cache']['used']}{service['storage']['/tmp/cache']['total']}
-
-
-
- Cameras -
- {Object.entries(storage).map(([name, camera]) => ( -
-
- {name.replaceAll('_', ' ')} -
-
- - - - - - - - - - - - - -
UsageStream Bandwidth
{Math.round(camera['usage_percent'] ?? 0)}%{camera['bandwidth'] ? camera['bandwidth'] : "Calculating..."} MB/hr
-
+ Cameras +
+ {Object.entries(storage).map(([name, camera]) => ( +
+
+ {name.replaceAll('_', ' ')}
- ))} -
- - )} +
+ + + + + + + + + + + + + +
UsageStream Bandwidth
{Math.round(camera['usage_percent'] ?? 0)}%{camera['bandwidth'] ? camera['bandwidth'] : 'Calculating...'} MB/hr
+
+
+ ))} +
+
); }