Merge pull request #175 from cchesk/cleanpr

Fixed broken export to CSV/JSON/XML if hashmark in URL
This commit is contained in:
Dan Sosedoff 2016-09-01 10:05:43 -05:00 committed by GitHub
commit 9430d734a7

View File

@ -211,7 +211,7 @@ function performTableAction(table, action, el) {
var format = el.data("format"); var format = el.data("format");
var filename = table + "." + format; var filename = table + "." + format;
var query = window.encodeURI("SELECT * FROM " + table); var query = window.encodeURI("SELECT * FROM " + table);
var url = window.location.href + "api/query?format=" + format + "&filename=" + filename + "&query=" + query + "&_session_id=" + getSessionId(); var url = window.location.href.split('#')[0] + "api/query?format=" + format + "&filename=" + filename + "&query=" + query + "&_session_id=" + getSessionId();
var win = window.open(url, "_blank"); var win = window.open(url, "_blank");
win.focus(); win.focus();
break; break;
@ -542,7 +542,7 @@ function exportTo(format) {
return; return;
} }
var url = window.location.href + "api/query?format=" + format + "&query=" + encodeQuery(query) + "&_session_id=" + getSessionId(); var url = window.location.href.split('#')[0] + "api/query?format=" + format + "&query=" + encodeQuery(query) + "&_session_id=" + getSessionId();
var win = window.open(url, '_blank'); var win = window.open(url, '_blank');
setCurrentTab("table_query"); setCurrentTab("table_query");