From: Scott Baker Date: Thu, 24 Apr 2014 03:21:05 +0000 (-0700) Subject: error and no data messages for historical tab X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=f6856eb2699ac860a5f597d596d0f25a5019b8ce;p=plstackapi.git error and no data messages for historical tab --- 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.