From fe0d16ff8248e9fead7f16be21a16cd500c20f82 Mon Sep 17 00:00:00 2001 From: Ylian Saint-Hilaire Date: Fri, 31 Jul 2020 12:03:35 -0700 Subject: [PATCH] Improved recordings panel. --- views/default.handlebars | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/views/default.handlebars b/views/default.handlebars index d2745760..7b50491f 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -11984,21 +11984,27 @@ var p52recordings = null; function updateRecordings() { // Save the list of currently checked recordings - var checkedRecordings = [], elements = document.getElementsByClassName('RecordingCheckbox'); + var checkedRecordings = [], elements = document.getElementsByClassName('RecordingCheckbox'), x = ''; for (var i=0;i' + nobreak("Start Time") + '' + "Duration" + '' + "Size"; - if (p52recordings != null) { - var recdate = null; - for (var i in p52recordings) { - var rec = p52recordings[i], rect = new Date(rec.time), day = printDate(rect); - if (day != recdate) { recdate = day; x += '' + day; } - x += addRecordingHtml(i, rec); + if (p52recordings == null) { + x += '
' + "Loading..." + "
"; + } else if (p52recordings.length == 0) { + x += '
' + "No recordings." + "
"; + } else { + // Display the users using the sorted list + x += '', addHeader = true; + x += '
' + "Session" + '' + nobreak("Start Time") + '' + "Duration" + '' + "Size"; + if (p52recordings != null) { + var recdate = null; + for (var i in p52recordings) { + var rec = p52recordings[i], rect = new Date(rec.time), day = printDate(rect); + if (day != recdate) { recdate = day; x += '
' + day; } + x += addRecordingHtml(i, rec); + } } + x += '
'; } - x += ''; QH('p52recordings', x); // Re-check recordings