fix incorrect comment, make minidashboard silent if no data received
diff --git a/planetstack/core/static/page_analytics.js b/planetstack/core/static/page_analytics.js
index 0b1357b..d9e98e1 100644
--- a/planetstack/core/static/page_analytics.js
+++ b/planetstack/core/static/page_analytics.js
@@ -44,6 +44,11 @@
window.pageAnalyticsUrl = summaryData["dataSourceUrl"];
lastRow = summaryData.rows.length-1;
+ if (summaryData.rows.length <= 0) {
+ //console.log("no data received from page analytics ajax")
+ return;
+ }
+
setPageStatInt(".nodesLabel", ".nodesValue", "Node Count", "", summaryData.rows[lastRow]["count_hostname"]);
setPageStatInt(".cpuLabel", ".cpuValue", "Avg Load", "%", summaryData.rows[lastRow]["avg_cpu"]);
@@ -75,6 +80,12 @@
function updatePageBandwidthData(summaryData) {
window.pageBandwidthUrl = summaryData["dataSourceUrl"];
lastRow = summaryData.rows.length-1;
+
+ if (summaryData.rows.length <= 0) {
+ //console.log("no data received from page bandwidth ajax")
+ return;
+ }
+
setPageStatFloat(".bandwidthLabel", ".bandwidthValue", "Bandwidth", " Gbps", summaryData.rows[lastRow]["sum_computed_bytes_sent_div_elapsed"]*8.0/1024/1024/1024,2);
setPageStatFloat("#miniDashBandwidthLabel", "#miniDashBandwidth", "Bandwidth", " Gbps", summaryData.rows[lastRow]["sum_computed_bytes_sent_div_elapsed"]*8.0/1024/1024/1024,2);
}