🐛 fix(alert): 添加报警规则

This commit is contained in:
naiba
2020-12-21 16:34:21 +08:00
parent 789065cb5f
commit 4ec61d0043
5 changed files with 33 additions and 22 deletions

View File

@@ -1,13 +1,7 @@
/**
* Converts a long string of bytes into a readable format e.g KB, MB, GB, TB, YB
*
* @param {Int} num The number of bytes.
*/
function readableBytes(bytes) {
var i = Math.floor(Math.log(bytes) / Math.log(1024)),
sizes = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
return (bytes / Math.pow(1024, i)).toFixed(2) * 1 + ' ' + sizes[i];
return (bytes / Math.pow(1024, i)).toFixed(0) + ' ' + sizes[i];
}
const confirmBtn = $('.mini.confirm.modal .positive.button')