Added webui debug mode switcher

This commit is contained in:
Vuolter 2013-01-07 16:24:44 +01:00
parent ac5db4e22f
commit a7da81a394
4 changed files with 35 additions and 11 deletions

View file

@ -1,6 +1,6 @@
/*
* TVheadend
* Copyright (C) 2007 - 2010 Andreas Öman
* Copyright (C) 2007 - 2010 Andreas <EFBFBD>man
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -78,6 +78,7 @@ int log_debug_to_syslog;
int log_debug_to_console;
int webui_port;
int webui_debug;
int htsp_port;
int htsp_port_extra;
const char *tvheadend_cwd;
@ -206,14 +207,15 @@ usage(const char *argv0)
" it will allow world-wide administrative access\n"
" to your Tvheadend installation until you edit\n"
" the access-control from within the Tvheadend UI\n");
printf(" -s Log debug to syslog\n");
printf(" -w <portnumber> WebUI access port [default 9981]\n");
printf(" -w <portnumber> Web interface access port [default 9981]\n");
printf(" -e <portnumber> HTSP access port [default 9982]\n");
printf(" -W <path> WebUI context path [default /]\n");
printf(" -W <path> Web interface context path [default /]\n");
printf("\n");
printf("Development options\n");
printf("\n");
printf(" -d Log debug to console\n");
printf(" -s Log debug to syslog\n");
printf(" -x Run web interface in debug mode\n");
printf(" -j <id> Statically join the given transport id\n");
printf(" -r <tsfile> Read the given transport stream file and present\n"
" found services as channels\n");
@ -306,7 +308,7 @@ main(int argc, char **argv)
// make sure the timezone is set
tzset();
while((c = getopt(argc, argv, "Aa:fp:u:g:c:Chdr:j:sw:e:E:R:W:")) != -1) {
while((c = getopt(argc, argv, "Aa:fp:u:g:c:Chdxr:j:sw:e:E:R:W:")) != -1) {
switch(c) {
case 'a':
adapter_mask = 0x0;
@ -360,6 +362,9 @@ main(int argc, char **argv)
break;
case 's':
log_debug_to_syslog = 1;
break;
case 'x':
webui_debug = 1;
break;
case 'C':
createdefault = 1;

View file

@ -65,6 +65,7 @@ extern pthread_mutex_t ffmpeg_lock;
extern pthread_mutex_t fork_lock;
extern int webui_port;
extern int webui_debug;
extern int htsp_port;
typedef struct source_info {

View file

@ -87,12 +87,22 @@ extjs_root(http_connection_t *hc, const char *remain, void *opaque)
#define EXTJSPATH "static/extjs"
htsbuf_qprintf(hq, "<html>\n"
"<script type=\"text/javascript\" src=\""EXTJSPATH"/adapter/ext/ext-base.js\"></script>\n"
"<script type=\"text/javascript\" src=\""EXTJSPATH"/ext-all-debug.js\"></script>\n"
"<link rel=\"stylesheet\" type=\"text/css\" href=\""EXTJSPATH"/resources/css/ext-all.css\">\n"
"<link rel=\"stylesheet\" type=\"text/css\" href=\"static/livegrid/resources/css/ext-ux-livegrid.css\">\n"
"<link rel=\"stylesheet\" type=\"text/css\" href=\"static/app/ext.css\">\n");
htsbuf_qprintf(hq, "<html>\n");
if(webui_debug) {
htsbuf_qprintf(hq, "<script type=\"text/javascript\" src=\""EXTJSPATH"/adapter/ext/ext-base-debug.js\"></script>\n"
"<script type=\"text/javascript\" src=\""EXTJSPATH"/ext-all-debug.js\"></script>\n"
"<link rel=\"stylesheet\" type=\"text/css\" href=\""EXTJSPATH"/resources/css/ext-all-notheme.css\">\n");
tvhlog(LOG_INFO, "webui", "Running web interface in debug mode");
}
else {
htsbuf_qprintf(hq, "<script type=\"text/javascript\" src=\""EXTJSPATH"/adapter/ext/ext-base.js\"></script>\n"
"<script type=\"text/javascript\" src=\""EXTJSPATH"/ext-all.js\"></script>\n"
"<link rel=\"stylesheet\" type=\"text/css\" href=\""EXTJSPATH"/resources/css/ext-all-notheme-min.css\">\n");
}
htsbuf_qprintf(hq, "<link rel=\"stylesheet\" type=\"text/css\" href=\"static/livegrid/resources/css/ext-ux-livegrid.css\">\n"
"<link rel=\"stylesheet\" type=\"text/css\" href=\"static/app/ext.css\">\n");
extjs_exec(hq, "Ext.BLANK_IMAGE_URL = "
"'"EXTJSPATH"/resources/images/default/s.gif';");

File diff suppressed because one or more lines are too long