Enhance device traffic feedback and totals
This commit is contained in:
@@ -31,6 +31,12 @@ export function formatByteString(value) {
|
||||
return `${tenths / 10n},${tenths % 10n} ${units[unit]}`;
|
||||
}
|
||||
|
||||
export function positiveByteDelta(previous, current) {
|
||||
const before = byteString(previous);
|
||||
const after = byteString(current);
|
||||
return after > before ? formatByteString((after - before).toString()) : '';
|
||||
}
|
||||
|
||||
export function sortDevicesByTraffic(devices, direction = 'desc') {
|
||||
const factor = direction === 'asc' ? 1 : -1;
|
||||
return (Array.isArray(devices) ? devices : [])
|
||||
|
||||
Reference in New Issue
Block a user