DVB networks view, WIP

This commit is contained in:
Andreas Öman 2012-11-19 13:15:19 +01:00
parent f33dd3b722
commit abde2507d8
3 changed files with 60 additions and 5 deletions

View file

@ -130,6 +130,7 @@ extjs_root(http_connection_t *hc, const char *remain, void *opaque)
extjs_load(hq, "static/app/tvadapters.js");
#if ENABLE_LINUXDVB
extjs_load(hq, "static/app/dvb.js");
extjs_load(hq, "static/app/dvb_networks.js");
#endif
extjs_load(hq, "static/app/iptv.js");
#if ENABLE_V4L

View file

@ -685,6 +685,55 @@ extjs_list_dvb_adapters(htsmsg_t *array)
}
/**
*
*/
static int
extjs_dvbnetworks(http_connection_t *hc, const char *remain, void *opaque)
{
htsbuf_queue_t *hq = &hc->hc_reply;
const char *s = http_arg_get(&hc->hc_req_args, "node");
htsmsg_t *out = NULL;
if(s == NULL)
return HTTP_STATUS_BAD_REQUEST;
pthread_mutex_lock(&global_lock);
if(http_access_verify(hc, ACCESS_ADMIN)) {
pthread_mutex_unlock(&global_lock);
return HTTP_STATUS_UNAUTHORIZED;
}
printf("s=%s\n", s);
out = htsmsg_create_list();
if(!strcmp(s, "root")) {
htsmsg_t *n = htsmsg_create_map();
htsmsg_add_str(n, "text", "Network1");
htsmsg_add_str(n, "id", "net/1");
htsmsg_add_str(n, "cls", "folder");
htsmsg_add_str(n, "iconCls", "iptv");
htsmsg_add_msg(out, NULL, n);
n = htsmsg_create_map();
htsmsg_add_str(n, "text", "Network2");
htsmsg_add_str(n, "id", "net/2");
htsmsg_add_str(n, "cls", "folder");
htsmsg_add_msg(out, NULL, n);
}
pthread_mutex_unlock(&global_lock);
htsmsg_json_serialize(out, hq, 0);
htsmsg_destroy(out);
http_output_content(hc, "text/x-json; charset=UTF-8");
return 0;
}
/**
* DVB WEB user interface
*/
@ -694,6 +743,9 @@ extjs_start_dvb(void)
http_path_add("/dvb/locations",
NULL, extjs_dvblocations, ACCESS_WEB_INTERFACE);
http_path_add("/dvb/networks",
NULL, extjs_dvbnetworks, ACCESS_WEB_INTERFACE);
http_path_add("/dvb/adapter",
NULL, extjs_dvbadapter, ACCESS_ADMIN);

View file

@ -235,11 +235,13 @@ function accessUpdate(o) {
autoScroll : true,
title : 'Configuration',
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 ]
items : [ new tvheadend.dvb_networks,
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 ]
});
tvheadend.rootTabPanel.add(tvheadend.confpanel);
}