From e113c3bc226fffed7b1dd4d48c6a1b230254dce2 Mon Sep 17 00:00:00 2001 From: Adam Sutton Date: Wed, 23 Apr 2014 00:41:27 +0100 Subject: [PATCH] webui: added service stream details dialog (fixes #2006) --- src/webui/static/app/idnode.js | 6 +-- src/webui/static/app/mpegts.js | 83 +++++++++++++++++++++++++++++++++- 2 files changed, 85 insertions(+), 4 deletions(-) diff --git a/src/webui/static/app/idnode.js b/src/webui/static/app/idnode.js index 5373b81b..c172ff18 100644 --- a/src/webui/static/app/idnode.js +++ b/src/webui/static/app/idnode.js @@ -650,6 +650,7 @@ tvheadend.idnode_grid = function(panel, conf) var filters = []; var fields = []; var buttons = []; + var plugins = conf.plugins || []; var saveBtn = null; var undoBtn = null; var addBtn = null; @@ -958,6 +959,7 @@ tvheadend.idnode_grid = function(panel, conf) items : [ '-', 'Auto-refresh', auto, '->', '-', 'Per page', count ] }); + plugins.push(filter); var grid = new Ext.grid.EditorGridPanel({ stateful : true, stateId : conf.url, @@ -966,9 +968,7 @@ tvheadend.idnode_grid = function(panel, conf) store : store, cm : model, selModel : select, - plugins : [ - filter - ], + plugins : plugins, viewConfig : { forceFit : true }, diff --git a/src/webui/static/app/mpegts.js b/src/webui/static/app/mpegts.js index 1e5f007c..8e8b7107 100644 --- a/src/webui/static/app/mpegts.js +++ b/src/webui/static/app/mpegts.js @@ -95,6 +95,65 @@ tvheadend.muxes = function(panel) }); } +tvheadend.show_service_streams = function ( data ) { + var i, j; + var html = ''; + + html += ' 0 ? s.index : ' ') + ''; + html += ''; + html += ''; + html += '' + if (s.type == 'CA') { + d = 'CAIDS: '; + for (j = 0; j < s.caids.length; j++) { + d += s.caids[j].caid + ', '; + } + } + html += ''; + html += ''; + } + + var win = new Ext.Window({ + title : 'Service details for ' + data.name, + layout : 'fit', + width : 600, + height : 300, + plain : true, + bodyStyle : 'padding: 5px', + html : html + }); + win.show(); +} + tvheadend.services = function(panel) { var mapButton = new Ext.Toolbar.Button({ @@ -111,6 +170,26 @@ tvheadend.services = function(panel) else mapButton.setText('Map All') } + var actions = new Ext.ux.grid.RowActions({ + header : '', + width : 10, + actions : [ { + iconCls : 'info', + qtip : 'Detailed stream info', + cb : function ( grid, rec, act, row, col ) { + Ext.Ajax.request({ + url : 'api/service/streams', + params : { + uuid : rec.id + }, + success : function (r, o) { + var d = Ext.util.JSON.decode(r.responseText); + tvheadend.show_service_streams(d); + } + }); + } + } ] + }); tvheadend.idnode_grid(panel, { url : 'api/mpegts/service', comet : 'service', @@ -129,8 +208,10 @@ tvheadend.services = function(panel) renderer : function(v, o, r) { return "Play"; } - } + }, + actions ], + plugins : [ actions ], sort : { field : 'svcname', direction : 'ASC'
' + p + '' + s.type + '' + (s.language || ' ') + '' + d + '