diff --git a/web/static/js/plot_monitor.js b/web/static/js/plot_monitor.js index c458056..84c1040 100755 --- a/web/static/js/plot_monitor.js +++ b/web/static/js/plot_monitor.js @@ -205,7 +205,11 @@ function processBasicInfo() $("#con_state").html("
Running
"); $("#con_ip").html(basic_info.IP); } - $("#con_time").html(basic_info.RunningTime+"s"); + var total = parseInt(basic_info.RunningTime); + var hour = Math.floor(total / 3600); + var min = Math.floor(total % 3600 / 60); + var secs = Math.floor(total % 3600 % 60); + $("#con_time").html(hour+"h "+min+"m "+secs+"s") $("#con_billing").html(basic_info.billing+" "); },"json"); } diff --git a/web/templates/monitor/status.html b/web/templates/monitor/status.html index a14fb7d..b4117ac 100644 --- a/web/templates/monitor/status.html +++ b/web/templates/monitor/status.html @@ -136,7 +136,11 @@ var detail = "("+used.toFixed(2)+"MiB/"+total.toFixed(2)+"MiB)"; $("#"+index+"_disk").html(usedp+"%
"+detail); },"json"); - $("#"+index+"_time").html(data.monitor.basic_info.RunningTime+"s") + var total = parseInt(data.monitor.basic_info.RunningTime); + var hour = Math.floor(total / 3600); + var min = Math.floor(total % 3600 / 60); + var secs = Math.floor(total % 3600 % 60); + $("#"+index+"_time").html(hour+"h "+min+"m "+secs+"s") $("#"+index+"_billing").html(data.monitor.basic_info.billing+" ") var state = data.monitor.basic_info.State; @@ -197,6 +201,7 @@ {% endfor %} {% endfor %} } + updateAll() setInterval(updateAll,5000);