1
0
Fork 0
mirror of https://github.com/iNavFlight/inav-configurator.git synced 2025-07-15 04:15:28 +03:00

loggin polish, sample counter bugfix

This commit is contained in:
cTn 2014-06-25 09:18:01 +02:00
parent c36293000a
commit 1e459d1af8
4 changed files with 71 additions and 67 deletions

10
main.js
View file

@ -236,6 +236,16 @@ function millitime() {
return now;
}
function bytesToSize(bytes) {
var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
var k = 1024;
if (bytes == 0) return '0 Bytes';
var i = Math.floor(Math.log(bytes) / Math.log(k));
return (bytes / Math.pow(k, i)).toPrecision(3) + ' ' + sizes[i];
}
/*
function add_custom_spinners() {
var spinner_element = '<div class="spinner"><div class="up"></div><div class="down"></div></div>';