[PR-210] some tidying up of the webui debug option.

This commit is contained in:
Adam Sutton 2013-01-08 13:30:11 +00:00
parent 60801bb1a8
commit ddcee0e750
2 changed files with 13 additions and 25 deletions

View file

@ -86,34 +86,19 @@ extjs_root(http_connection_t *hc, const char *remain, void *opaque)
htsbuf_queue_t *hq = &hc->hc_reply;
#define EXTJSPATH "static/extjs"
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=\""EXTJSPATH"/resources/css/xtheme-blue.css\">\n"
htsbuf_qprintf(hq, "<script type=\"text/javascript\" src=\""EXTJSPATH"/adapter/ext/ext-base%s.js\"></script>\n"
"<script type=\"text/javascript\" src=\""EXTJSPATH"/ext-all%s.js\"></script>\n"
"<link rel=\"stylesheet\" type=\"text/css\" href=\""EXTJSPATH"/resources/css/ext-all-notheme%s.css\">\n"
"<link rel=\"stylesheet\" type=\"text/css\" href=\""EXTJSPATH"/resources/css/xtheme-blue.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");
extjs_exec(hq, "Ext.BLANK_IMAGE_URL = "
"'"EXTJSPATH"/resources/images/default/s.gif';");
#if 0
htsbuf_qprintf(hq,
"<script type='text/javascript' "
"src='http://getfirebug.com/releases/lite/1.2/firebug-lite-compressed.js'></script>");
#endif
"<link rel=\"stylesheet\" type=\"text/css\" href=\"static/app/ext.css\">\n",
webui_debug ? "-debug" : "",
webui_debug ? "-debug" : "",
webui_debug ? "" : "-min");
extjs_exec(hq, "Ext.BLANK_IMAGE_URL = " "'"EXTJSPATH"/resources/images/default/s.gif';");
/**
* Load extjs extensions

View file

@ -939,6 +939,9 @@ int page_statedump(http_connection_t *hc, const char *remain, void *opaque);
void
webui_init(void)
{
if (webui_debug)
tvhlog(LOG_INFO, "webui", "Running web interface in debug mode");
http_path_add("", NULL, page_root2, ACCESS_WEB_INTERFACE);
http_path_add("/", NULL, page_root, ACCESS_WEB_INTERFACE);