fix a bug on status.html when gateways are not set up

This commit is contained in:
Firmlyzhu 2017-12-08 16:58:32 +08:00
parent 3838a99c93
commit 50f1f5aa32
1 changed files with 8 additions and 0 deletions

View File

@ -295,6 +295,14 @@ function num2human(data)
function update_net_stats(url,index)
{
$.post(url,{},function(data){
if(!data.net_stats.bytes_sent)
{
$("#"+index+"_bytes_sent").html("--");
$("#"+index+"_bytes_recv").html("--");
$("#"+index+"_bytes_total").html("--");
$("#"+index+"_net_billings").html("--");
return;
}
var bytes_sent = parseInt(data.net_stats.bytes_sent);
var bytes_recv = parseInt(data.net_stats.bytes_recv);
$("#"+index+"_bytes_sent").html(num2human(bytes_sent)+"B");