Revision 6c83f226
Added by Vinicius Coque about 15 years ago
usr/local/www/graph.php | ||
---|---|---|
352 | 352 |
function formatSpeedBits(speed) { |
353 | 353 |
// format speed in bits/sec, input: bytes/sec |
354 | 354 |
if (speed < 125000) |
355 |
return Math.round(speed / 125) + " " + <?=gettext("Kbps"); ?>;
|
|
355 |
return Math.round(speed / 125) + " <?=gettext("Kbps"); ?>";
|
|
356 | 356 |
if (speed < 125000000) |
357 |
return Math.round(speed / 1250)/100 + " " + <?=gettext("Mbps"); ?>;
|
|
357 |
return Math.round(speed / 1250)/100 + " <?=gettext("Mbps"); ?>";
|
|
358 | 358 |
// else |
359 |
return Math.round(speed / 1250000)/100 + " " + <?=gettext("Gbps"); ?>; /* wow! */
|
|
359 |
return Math.round(speed / 1250000)/100 + " <?=gettext("Gbps"); ?>"; /* wow! */
|
|
360 | 360 |
} |
361 | 361 |
|
362 | 362 |
function formatSpeedBytes(speed) { |
363 | 363 |
// format speed in bytes/sec, input: bytes/sec |
364 | 364 |
if (speed < 1048576) |
365 |
return Math.round(speed / 10.24)/100 + " " + <?=gettext("KB/s"); ?>;
|
|
365 |
return Math.round(speed / 10.24)/100 + " <?=gettext("KB/s"); ?>";
|
|
366 | 366 |
if (speed < 1073741824) |
367 |
return Math.round(speed / 10485.76)/100 + " " + <?=gettext("MB/s"); ?>;
|
|
367 |
return Math.round(speed / 10485.76)/100 + " <?=gettext("MB/s"); ?>";
|
|
368 | 368 |
// else |
369 |
return Math.round(speed / 10737418.24)/100 + " " + <?=gettext("GB/s"); ?>; /* wow! */
|
|
369 |
return Math.round(speed / 10737418.24)/100 + " <?=gettext("GB/s"); ?>"; /* wow! */
|
|
370 | 370 |
} |
371 | 371 |
|
372 | 372 |
function LZ(x) { |
Also available in: Unified diff
Fix some javascripts broken on gettext() implementation