diff --git a/src/webui/static/app/chconf.js b/src/webui/static/app/chconf.js index 8f2b75cb..3acde808 100644 --- a/src/webui/static/app/chconf.js +++ b/src/webui/static/app/chconf.js @@ -21,7 +21,7 @@ tvheadend.comet.on('channeltags', function(m) { /* * Service mapping */ -tvheadend.mapServices = function() +tvheadend.mapServices = function(t, e, store, select) { var panel = null; var win = null; @@ -63,11 +63,22 @@ tvheadend.mapServices = function() text : 'Map', tooltip : 'Begin mapping', handler : function () { + p = null; + if (select) { + var r = select.getSelections(); + if (r.length > 0) { + var uuids = []; + for (var i = 0; i < r.length; i++) + uuids.push(r[i].id); + p = { uuids: Ext.encode(uuids) }; + } + } panel.getForm().submit({ url : 'api/service/mapper/start', - waitMessage : 'Mapping services...' + waitMessage : 'Mapping services...', + params : p }); - } + } }); panel = new Ext.FormPanel({ diff --git a/src/webui/static/app/idnode.js b/src/webui/static/app/idnode.js index 34d20fbe..50989a44 100644 --- a/src/webui/static/app/idnode.js +++ b/src/webui/static/app/idnode.js @@ -748,8 +748,14 @@ tvheadend.idnode_grid = function(panel, conf) /* Extra buttons */ if (conf.tbar) { buttons.push('-') - for (i = 0; i < conf.tbar.length; i++) + for (i = 0; i < conf.tbar.length; i++) { + if (conf.tbar[i].callback) { + conf.tbar[i].handler = function (b, e) { + this.callback(this, e, store, select); + } + } buttons.push(conf.tbar[i]) + } } /* Help */ diff --git a/src/webui/static/app/mpegts.js b/src/webui/static/app/mpegts.js index cf6d392b..ff823f23 100644 --- a/src/webui/static/app/mpegts.js +++ b/src/webui/static/app/mpegts.js @@ -85,6 +85,13 @@ tvheadend.muxes = function(panel) tvheadend.services = function(panel) { + var mapButton = new Ext.Toolbar.Button({ + tooltip : 'Map services to channels', + iconCls : '', + text : 'Map Services', + callback: tvheadend.mapServices, + disabled : false, + }); tvheadend.idnode_grid(panel, { url : 'api/mpegts/service', comet : 'service', @@ -92,6 +99,7 @@ tvheadend.services = function(panel) titleP : 'Services', add : false, del : false, + tbar : [ mapButton ], lcol : [ { header : 'Play',