Fixed broken export to CSV/JSON/XML if hashmark in URL

This commit is contained in:
Aleksander Umov 2016-08-30 10:50:47 +02:00
parent dd71d1c49e
commit a9fe99b09b

View File

@ -211,7 +211,7 @@ function performTableAction(table, action, el) {
var format = el.data("format");
var filename = table + "." + format;
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");
win.focus();
break;
@ -542,7 +542,7 @@ function exportTo(format) {
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');
setCurrentTab("table_query");