From f6856eb2699ac860a5f597d596d0f25a5019b8ce Mon Sep 17 00:00:00 2001 From: Scott Baker Date: Wed, 23 Apr 2014 20:21:05 -0700 Subject: [PATCH] error and no data messages for historical tab --- .../templates/admin/dashboard/hpc_historical.html | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/planetstack/templates/admin/dashboard/hpc_historical.html b/planetstack/templates/admin/dashboard/hpc_historical.html index e312ee9..2e3b85e 100644 --- a/planetstack/templates/admin/dashboard/hpc_historical.html +++ b/planetstack/templates/admin/dashboard/hpc_historical.html @@ -21,11 +21,10 @@ function updateDataSourceUrl() { var sliceName = $("#historical_slicename :selected").text(); var queryString = "/analytics/bigquery/?timeBucket=600&maxAge=86400&sum=@bytes_sent&avg=@cpu&groupBy=Time,city,@hostname,@site&slice=" + sliceName; - var loadingDiv = '
Loading ...
'; $( "#control1").html(""); $( "#control2").html(""); - $( "#chart-site-agg" ).html(loadingDiv); + $( "#chart-site-agg" ).html("
Loading ...
"); $( "#chart-site-time" ).html(""); $( "#chart-geo" ).html(""); @@ -191,6 +190,16 @@ var format0dp = new google.visualization.NumberFormat({fractionDigits:0}); var format2dp = new google.visualization.NumberFormat({fractionDigits:2}); + if (response.isError()) { + $( "#chart-site-agg" ).html("
Error while fetching data.
"); + return; + } + + if (response.getDataTable().getNumberOfRows() == 0) { + $( "#chart-site-agg" ).html("
No data for this slice.
"); + return; + } + // Create a group for charts that will have a horizontal axis that is // time. -- 2.43.0