feat(client): ネットワークウィジェットの単位に秒追加

This commit is contained in:
NoriDev 2023-06-01 20:08:30 +09:00
parent 36ac2f2e28
commit af9712f006

View file

@ -1,6 +1,6 @@
export default (v) => {
if (v == null) return '?';
const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
const sizes = ['B/s', 'KB/s', 'MB/s', 'GB/s', 'TB/s'];
if (v === 0) return sizes[0];
const i = Math.floor(Math.log(v) / Math.log(1024));
return sizes[i];