Github user arina-ielchiieva commented on a diff in the pull request:
https://github.com/apache/drill/pull/910#discussion_r135571864
--- Diff: exec/java-exec/src/main/resources/rest/query/query.ftl ---
@@ -47,8 +58,32 @@
<label for="query">Query</label>
<textarea class="form-control" id="query" rows="5" name="query"
style="font-family: Courier;"></textarea>
</div>
- <button type="submit" class="btn btn-default">Submit</button>
+
+ <button class="btn btn-default" type=<#if model?? && model>"button"
onclick="doSubmit()"<#else>"submit"</#if>>
+ Submit
+ </button>
</form>
+
+ <#if model?? && model>
+ <script>
+ function doSubmit() {
+ var userName = document.getElementById("userName").value;
+ $.ajax({
+ type: "POST",
+ beforeSend: function (request) {
+ request.setRequestHeader("User-Name", userName);
+ },
+ url: "/query",
+ data: $("#queryForm").serializeArray(),
+ success: function (response) {
--- End diff --
Added callback.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---