Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WEBUI: add possibility to override column width for grid
- also improve the ACL edit window
  • Loading branch information
perexg committed Sep 8, 2014
1 parent 7fdf5f1 commit 0506aac
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
17 changes: 17 additions & 0 deletions src/webui/static/app/acleditor.js
Expand Up @@ -21,7 +21,24 @@ tvheadend.acleditor = function(panel)
comet: 'acl_entries',
titleS: 'Access Entry',
titleP: 'Access Entries',
columns: {
username: { width: 250 },
password: { width: 250 },
prefix: { width: 350 },
streaming: { width: 100 },
adv_streaming: { width: 100 },
dvr: { width: 100 },
webui: { width: 100 },
admin: { width: 100 },
channel_min: { width: 100 },
channel_max: { width: 100 },
},
tabIndex: 0,
edit: {
params: {
list: list,
},
},
add: {
url: 'api/access/entry',
params: {
Expand Down
20 changes: 12 additions & 8 deletions src/webui/static/app/idnode.js
Expand Up @@ -133,7 +133,7 @@ tvheadend.IdNodeField = function(conf)
* Methods
*/

this.column = function()
this.column = function(conf)
{
var w = 300;
var ftype = 'string';
Expand All @@ -155,6 +155,11 @@ 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,
dataIndex: this.id,
Expand Down Expand Up @@ -840,7 +845,7 @@ tvheadend.idnode_grid = function(panel, conf)
var idnode = new tvheadend.IdNode(d);
for (var i = 0; i < idnode.length(); i++) {
var f = idnode.field(i);
var c = f.column();
var c = f.column(conf.columns);
fields.push(f.id);
columns.push(c);
if (c.filter)
Expand Down Expand Up @@ -1075,12 +1080,11 @@ tvheadend.idnode_grid = function(panel, conf)
});
w.show();
} else {
var params = {
uuid: r.id,
meta: 1
};
if (conf.listEdit)
params['list'] = conf.listEdit;
var params = {};
if (conf.edit && conf.edit.params)
params = conf.edit.params;
params['uuid'] = r.id;
params['meta'] = 1;
tvheadend.Ajax({
url: 'api/idnode/load',
params: params,
Expand Down

0 comments on commit 0506aac

Please sign in to comment.