Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WEBUI JS: DVR - fix the date filters, fix the file size rendering
  • Loading branch information
perexg committed Sep 8, 2014
1 parent 17a8c50 commit 4a60cb8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
11 changes: 11 additions & 0 deletions src/webui/static/app/dvr.js
Expand Up @@ -212,6 +212,17 @@ tvheadend.dvr_finished = function(panel, index) {
list: 'disp_title,episode,start_real,stop_real,' +
'duration,filesize,channelname,creator,' +
'sched_status,url',
columns: {
filesize: {
renderer: function() {
return function(v) {
if (v == null)
return '';
return parseInt(v / 1000000) + ' MB';
}
}
}
},
sort: {
field: 'start',
direction: 'DESC'
Expand Down
11 changes: 4 additions & 7 deletions src/webui/static/app/idnode.js
Expand Up @@ -135,6 +135,7 @@ tvheadend.IdNodeField = function(conf)

this.column = function(conf)
{
var cfg = conf && this.id in conf ? conf[this.id] : {};
var w = 300;
var ftype = 'string';
if (this.type === 'int' || this.type === 'u32' ||
Expand All @@ -144,6 +145,7 @@ tvheadend.IdNodeField = function(conf)
w = 80;
} else if (this.type === 'time') {
w = 120;
ftype = 'date';
if (this.durations) {
ftype = 'numeric';
w = 80;
Expand All @@ -155,17 +157,12 @@ tvheadend.IdNodeField = function(conf)
if (this.enum || this.list)
w = 300;

if (conf && this.id in conf) {
if (conf[this.id].width)
w = conf[this.id].width;
}

var props = {
width: w,
width: cfg.width || w,
dataIndex: this.id,
header: this.text,
editor: this.editor({create: false}),
renderer: this.renderer(),
renderer: cfg.renderer ? cfg.renderer() : this.renderer(),
editable: !this.rdonly,
hidden: this.hidden,
filter: {
Expand Down

0 comments on commit 4a60cb8

Please sign in to comment.