Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_renderNetworkMetrics(nodeState) {
if (nodeState === null) {
return null;
}
// ugh, is there a way of not doing it globally?
numeral.zeroFormat('0B');
var network = (
<span>
<span>Network IO: </span>
<span>
<i>
<span>{numeral(nodeState.read_bytes_1sec).format("0.0b")} </span>
<i>
<span>{numeral(nodeState.written_bytes_1sec).format("0.0b")}</span>
</i></i></span><i><i>
<span>
<span> (total: </span>
<i>
<span>{numeral(nodeState.read_bytes_total).format("0.0b")} </span></i></span></i></i></span>
_renderNetworkMetrics(nodeState) {
if (nodeState === null) {
return null;
}
// ugh, is there a way of not doing it globally?
numeral.zeroFormat('0B');
var network = (
<span>
<span>Network IO: </span>
<span>
<i></i>
<span>{numeral(nodeState.read_bytes_1sec).format("0.0b")} </span>
<i></i>
<span>{numeral(nodeState.written_bytes_1sec).format("0.0b")}</span>
</span>
<span>
<span> (total: </span>
<i></i>
<span>{numeral(nodeState.read_bytes_total).format("0.0b")} </span></span></span>
<span>{numeral(nodeState.written_bytes_1sec).format("0.0b")}</span>
<span>
<span> (total: </span>
<i></i>
<span>{numeral(nodeState.read_bytes_total).format("0.0b")} </span>
<i></i>
<span>{numeral(nodeState.written_bytes_total).format("0.0b")}</span>
<span> )</span>
</span>
);
// wow this sucks
numeral.zeroFormat(null);
return network;
},
<span>{numeral(nodeState.written_bytes_1sec).format("0.0b")}</span>
<span>
<span> (total: </span>
<i>
<span>{numeral(nodeState.read_bytes_total).format("0.0b")} </span>
<i>
<span>{numeral(nodeState.written_bytes_total).format("0.0b")}</span>
<span> )</span>
</i></i></span><i><i>
);
// wow this sucks
numeral.zeroFormat(null);
return network;
},
</i></i>
formatBytes(number) {
numeral.zeroFormat('0B');
let formattedNumber;
try {
formattedNumber = numeral(this.normalizeNumber(number)).format('0.0ib');
} catch (e) {
formattedNumber = number;
}
numeral.zeroFormat(null);
return formattedNumber;
},
isNumber(possibleNumber) {
formatBytes(number) {
numeral.zeroFormat('0B');
let formattedNumber;
try {
formattedNumber = numeral(this.normalizeNumber(number)).format('0.0ib');
} catch (e) {
formattedNumber = number;
}
numeral.zeroFormat(null);
return formattedNumber;
},
isNumber(possibleNumber) {