完善首页以及告警界面

This commit is contained in:
lai
2024-01-26 14:29:44 +08:00
parent fa96c33972
commit 62bf6be2f1
11 changed files with 594 additions and 326 deletions

View File

@@ -118,3 +118,33 @@ export function parseSizeFromKBs(size: number): string {
}
return (size / Math.pow(num, 3)).toFixed(2) + ' TB/s';
}
/**
* 字节数转换速率
* @param sizeByte 数值大小
* @returns
*/
export function parseSizeFromKbs(sizeByte: number, timeInterval: number): any {
// let realBit:any=((sizeByte * 8) / timeInterval);
// if (realBit >= 0 && realBit < 1000) {
// return [realBit.toFixed(2),' bits/sec'];
// }
// if (realBit >= 1000 && realBit < 1000*1000) {
// return [(realBit/1000).toFixed(2) ,' Kbits/sec'];
// }
// if (realBit >= 1000*1000 && realBit < 1000*1000*1000) {
// return [((realBit/1000)/1000).toFixed(2) ,' Mbits/sec'];
// }
// if (realBit >= 1000*1000*1000) {
// return [((realBit/1000*1000)/1000).toFixed(2) ,' Gbits/sec'];
// }
// return [((realBit/1000*1000*1000)/1000).toFixed(2) ,' TB/sec'];
let realBit: any = (sizeByte * 8) / timeInterval;
return [(realBit / 1000 / 1000).toFixed(2), ' Mbits/sec'];
}