diff --git a/web/src/routes/Storage.jsx b/web/src/routes/Storage.jsx index b32071205..ac21b0bb4 100644 --- a/web/src/routes/Storage.jsx +++ b/web/src/routes/Storage.jsx @@ -18,6 +18,10 @@ export default function Storage() { const { service } = stats || initialStats || emptyObject; + if (!service || !storage) { + return ; + } + let storage_usage; if ( service && @@ -53,85 +57,79 @@ export default function Storage() {
Storage - {!service || !storage ? ( -
- -
- ) : ( - - Overview -
-
-
Data
-
- - - - - - - - - {storage_usage} -
LocationUsed MBTotal MB
-
+ + Overview +
+
+
Data
+
+ + + + + + + + + {storage_usage} +
LocationUsed MBTotal MB
-
-
Memory
+
+
+
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('_', ' ')} +
- - - + + - - - - - - - - + +
LocationUsed MBTotal MBUsageStream Bandwidth
/dev/shm{service['storage']['/dev/shm']['used']}{service['storage']['/dev/shm']['total']}
/tmp/cache{service['storage']['/tmp/cache']['used']}{service['storage']['/tmp/cache']['total']}{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
-
-
- ))} -
- - )} + ))} +
+
); }