Polish device traffic charts and bump Harbor client versions
This commit is contained in:
@@ -51,6 +51,13 @@ export function trafficSampleMetrics(gatewayValue, proxyValue, maxValue, scale =
|
||||
};
|
||||
}
|
||||
|
||||
export function trafficAxisMid(maxValue, scale = 'linear') {
|
||||
const max = byteString(maxValue);
|
||||
if (!max) return 0n;
|
||||
if (scale !== 'log') return max / 2n;
|
||||
return BigInt(Math.max(1, Math.round(Math.expm1(Math.log1p(Number(max)) / 2))));
|
||||
}
|
||||
|
||||
export function sortDevicesByTraffic(devices, direction = 'desc') {
|
||||
const factor = direction === 'asc' ? 1 : -1;
|
||||
return (Array.isArray(devices) ? devices : [])
|
||||
|
||||
Reference in New Issue
Block a user