webui: make it possible to map selected services
I probably need to improve the text on the button.
This commit is contained in:
parent
ac83c6f408
commit
a3e036ca9f
3 changed files with 29 additions and 4 deletions
|
@ -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({
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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',
|
||||
|
|
Loading…
Add table
Reference in a new issue