clearly shows files not ready

This commit is contained in:
boyska 2021-08-24 23:48:56 +02:00
parent f8cb5a9bce
commit 775d618315
2 changed files with 11 additions and 4 deletions

View file

@ -44,6 +44,7 @@ class Rec(Base):
"starttime": self.starttime, "starttime": self.starttime,
"endtime": self.endtime, "endtime": self.endtime,
"filename": self.filename, "filename": self.filename,
"ready": self.ready,
} }
def __repr__(self): def __repr__(self):

View file

@ -37,11 +37,17 @@ $(function() {
); );
var duration = $('<td/>').text(delta(rec.endtime, rec.starttime)); var duration = $('<td/>').text(delta(rec.endtime, rec.starttime));
var dl_text = $('<span/>').text(" Scarica").addClass('pure-hidden-phone'); var dl_text = $('<span/>').text(" Scarica").addClass('pure-hidden-phone');
var fn = $("<td/>").append($("<a/>").prop("href", "/output/" + var fn = $("<td/>")
rec.filename).addClass("pure-button pure-button-small") if(rec.ready) {
fn.append($("<a/>").prop("href", "/output/" + rec.filename)
.addClass("pure-button pure-button-small")
.html( $("<i/>").addClass("fa fa-download").css("color", "green")) .html( $("<i/>").addClass("fa fa-download").css("color", "green"))
.append(dl_text)); .append(dl_text));
} else {
fn.html("<small>File not found</small>")
}
var row = $('<tr/>').append(name).append(start).append(duration).append(fn); var row = $('<tr/>').append(name).append(start).append(duration).append(fn);
row.data('id', rec.id)
$('#ongoing-recs-table tbody').append(row); $('#ongoing-recs-table tbody').append(row);
} }
}); });