return 0;
}
+/**
+ * Capability check
+ */
+static int
+extjs_capabilities(http_connection_t *hc, const char *remain, void *opaque)
+{
+ htsbuf_queue_t *hq = &hc->hc_reply;
+ htsmsg_t *l;
+ int i = 0;
+ l = htsmsg_create_list();
+ while (tvheadend_capabilities[i]) {
+ htsmsg_add_str(l, NULL, tvheadend_capabilities[i]);
+ i++;
+ }
+ htsmsg_json_serialize(l, hq, 0);
+ htsmsg_destroy(l);
+ http_output_content(hc, "text/x-json; charset=UTF-8");
+ return 0;
+}
+
/**
* WEB user interface
*/
{
http_path_add("/about.html", NULL, page_about, ACCESS_WEB_INTERFACE);
http_path_add("/extjs.html", NULL, extjs_root, ACCESS_WEB_INTERFACE);
+ http_path_add("/capabilities", NULL, extjs_capabilities, ACCESS_WEB_INTERFACE);
http_path_add("/tablemgr", NULL, extjs_tablemgr, ACCESS_WEB_INTERFACE);
http_path_add("/channels", NULL, extjs_channels, ACCESS_WEB_INTERFACE);
http_path_add("/epggrab", NULL, extjs_epggrab, ACCESS_WEB_INTERFACE);
+tvheadend.accessupdate = null;
+tvheadend.capabilties = null;
+
/**
* Displays a help popup window
*/
});
}
+/*
+ * General capabilities
+ */
+Ext.Ajax.request({
+ url: '/capabilities',
+ success: function(d)
+ {
+ if (d && d.responseText)
+ tvheadend.capabilities = Ext.util.JSON.decode(d.responseText);
+ if (tvheadend.capabilities && tvheadend.accessupdate)
+ accessUpdate(tvheadend.accessUpdate);
+
+ }
+});
+
/**
* Displays a mediaplayer using VLC plugin
*/
* Obviosuly, access is verified in the server too.
*/
function accessUpdate(o) {
+ tvheadend.accessUpdate = o;
if (o.dvr == true && tvheadend.dvrpanel == null) {
tvheadend.dvrpanel = new tvheadend.dvr;
iconCls : 'wrench',
items : [ new tvheadend.miscconf, new tvheadend.chconf,
new tvheadend.epggrab, new tvheadend.cteditor,
- new tvheadend.dvrsettings, new tvheadend.tvadapters,
- new tvheadend.iptv, new tvheadend.acleditor,
- new tvheadend.cwceditor, new tvheadend.capmteditor ]
+ new tvheadend.dvrsettings,
+ new tvheadend.iptv, new tvheadend.acleditor ]
});
tvheadend.rootTabPanel.add(tvheadend.confpanel);
}
+ if (tvheadend.capabilities && tvheadend.confpanel) {
+ if (tvheadend.capabilities.indexOf('linuxdvb') != -1 ||
+ tvheadend.capabilities.indexOf('v4l') != -1) {
+ tvheadend.confpanel.add(new tvheadend.tvadapters);
+ }
+ if (tvheadend.capabilities.indexOf('cwc') != -1) {
+ tvheadend.confpanel.add(new tvheadend.cwceditor);
+ tvheadend.confpanel.add(new tvheadend.capmteditor);
+ }
+ tvheadend.confpanel.doLayout();
+ }
if (o.admin == true && tvheadend.statuspanel == null) {
tvheadend.statuspanel = new tvheadend.status;