Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[webui] render a progress bar for currently running programmes
  • Loading branch information
Jalle19 authored and perexg committed Aug 13, 2014
1 parent 2563ab4 commit 767a75d
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/webui/static/app/epg.js
Expand Up @@ -276,7 +276,27 @@ tvheadend.epg = function() {
return '' + value;
}

var epgCm = new Ext.grid.ColumnModel([actions, {
var epgCm = new Ext.grid.ColumnModel([actions,
new Ext.ux.grid.ProgressColumn({
width: 100,
header: "Progress",
dataIndex: 'progress',
colored: false,
ceiling: 100,
tvh_renderer: function(value, meta, record, rowIndex, colIndex, store) {
var entry = record.data;
var start = entry.start;
var end = entry.end;
var duration = entry.duration; // seconds
var now = new Date();

// Only render a progress bar for currently running programmes
if (now <= end && now >= start)
return (now - start) / 1000 / duration * 100;
else
return "";
}
}), {
width: 250,
id: 'title',
header: "Title",
Expand Down

0 comments on commit 767a75d

Please sign in to comment.