diff --git a/webui/extjs.c b/webui/extjs.c index 9f40fe1d..0b6f1a04 100644 --- a/webui/extjs.c +++ b/webui/extjs.c @@ -37,6 +37,7 @@ #include "dvb/dvb_support.h" #include "dvb/dvb_preconf.h" #include "transports.h" +#include "serviceprobe.h" extern const char *htsversion; @@ -276,7 +277,8 @@ extjs_dvbtree(http_connection_t *hc, http_reply_t *hr, extjs_dvbtree_node(out, 1, t->tht_identifier, t->tht_svcname, transport_servicetype_txt(t), - "OK", 100, "transport"); + t->tht_ch ? "Mapped" : "Unmapped", + 100, "transport"); } } @@ -342,6 +344,8 @@ extjs_dvbadapter(http_connection_t *hc, http_reply_t *hr, const char *s = http_arg_get(&hc->hc_req_args, "adapterId"); const char *op = http_arg_get(&hc->hc_req_args, "op"); th_dvb_adapter_t *tda = s ? dvb_adapter_find_by_identifier(s) : NULL; + th_dvb_mux_instance_t *tdmi; + th_transport_t *t; htsmsg_t *r, *out; @@ -370,6 +374,20 @@ extjs_dvbadapter(http_connection_t *hc, http_reply_t *hr, out = htsmsg_create(); htsmsg_add_u32(out, "success", 1); + } else if(!strcmp(op, "serviceprobe")) { + + tvhlog(LOG_NOTICE, "web interface", + "Service probe started on \"%s\"", tda->tda_displayname); + + RB_FOREACH(tdmi, &tda->tda_muxes, tdmi_adapter_link) { + LIST_FOREACH(t, &tdmi->tdmi_transports, tht_mux_link) { + serviceprobe_add(t); + } + } + + out = htsmsg_create(); + htsmsg_add_u32(out, "success", 1); + } else { return HTTP_STATUS_BAD_REQUEST; } diff --git a/webui/static/app/dvb.js b/webui/static/app/dvb.js index d186d959..6ffcd529 100644 --- a/webui/static/app/dvb.js +++ b/webui/static/app/dvb.js @@ -142,6 +142,24 @@ tvheadend.dvb_adapterdetails = function(adapterId, adapterName, treenode) { win.show(); } + /** + * + */ + function probeservices() { + Ext.MessageBox.confirm('Message', + 'Probe all DVB services on "' + adapterName + + '" and map to TV-channels in tvheadend', + function(button) { + if(button == 'no') + return; + + Ext.Ajax.request({url: '/dvbadapter', + params: {adapterId: adapterId, + op: 'serviceprobe'} + }) + }); + }; + var panel = new Ext.Panel({ title: adapterName, @@ -151,6 +169,9 @@ tvheadend.dvb_adapterdetails = function(adapterId, adapterName, treenode) { tbar:[{ text: 'Add mux(es)', handler: addmux + },{ + text: 'Probe services', + handler: probeservices }] }); return panel;