From 408d738127fda171b330519d25cc73dee65c9b28 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 2 Apr 2021 10:45:59 +0200 Subject: geotrain: show likelihood, distinguish between no track / no trains --- public/static/js/geotrain.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'public/static/js/geotrain.js') diff --git a/public/static/js/geotrain.js b/public/static/js/geotrain.js index 2291a72..9a937d1 100644 --- a/public/static/js/geotrain.js +++ b/public/static/js/geotrain.js @@ -31,8 +31,10 @@ $(function() { removeStatus(); if (data.error) { showError('Backend-Fehler:', data.error, null); - } else if (data.trains.length == 0) { + } else if (data.evas.length == 0) { showError('Keine Bahnstrecke gefunden', '', null); + } else if (data.trains.length == 0) { + showError('Keine Züge auf der Strecke gefunden', '', null); } else { $.each(data.trains, function(i, train) { @@ -48,7 +50,7 @@ $(function() { var distancenode = $(document.createElement('div')); distancenode.attr('class', 'traininfo'); - distancenode.html(prev_time + ' ' + prev + '
' + next_time + ' ' + next); + distancenode.html(train.likelihood + '%
' + prev_time + ' ' + prev + '
' + next_time + ' ' + next); stationlink.append(distancenode); $('div.candidatelist').append(stationlink); -- cgit v1.2.3