WEBUI: add possibility to override column width for grid
- also improve the ACL edit window
This commit is contained in:
parent
7fdf5f1f12
commit
0506aac6c1
2 changed files with 29 additions and 8 deletions
|
@ -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: {
|
||||
|
|
|
@ -133,7 +133,7 @@ tvheadend.IdNodeField = function(conf)
|
|||
* Methods
|
||||
*/
|
||||
|
||||
this.column = function()
|
||||
this.column = function(conf)
|
||||
{
|
||||
var w = 300;
|
||||
var ftype = 'string';
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue