From a62bb4772720100765b3abd64c0cea8dfaaa20a3 Mon Sep 17 00:00:00 2001 From: Tomas Cejka <cejkat@cesnet.cz> Date: Wed, 7 Feb 2018 14:15:20 +0100 Subject: [PATCH] graphs: write error message when there is an error --- templates/flowspy/route_details.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/flowspy/route_details.html b/templates/flowspy/route_details.html index e3cb2999..fd0cd6f1 100644 --- a/templates/flowspy/route_details.html +++ b/templates/flowspy/route_details.html @@ -252,8 +252,12 @@ function plotGraph(data) $(document).ready(function() { var statsurl = "{% url routestats route.name %}"; $.get(statsurl).done(function(data) { - $("#traffic-plot-loading").hide(); - plotGraph(data); + if (data["error"]) { + $("#traffic-plot-loading").text("No data, try later"); + } else { + $("#traffic-plot-loading").hide(); + plotGraph(data); + } }); }); </script> -- GitLab