完善首页以及告警界面
This commit is contained in:
@@ -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'];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user