Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Making SQL explain Javascript use POST instead of GET for getting que…

…ry logs.
  • Loading branch information...
commit 3e514de505149cf3a8bc079f4d8deb47dcf78281 1 parent 7deee0e
@markstory markstory authored
Showing with 14 additions and 3 deletions.
  1. +14 −3 views/elements/sql_log_panel.ctp
View
17 views/elements/sql_log_panel.ctp
@@ -1,4 +1,4 @@
-=<?php
+<?php
/**
* SQL Log Panel Element
*
@@ -60,13 +60,24 @@ DEBUGKIT.sqlLog = function () {
return {
init : function () {
var sqlPanel = document.getElementById('sql_log-tab');
- var buttons = sqlPanel.getElementsByTagName('A');
+ var buttons = sqlPanel.getElementsByTagName('input');
// Button handling code for explain links.
// performs XHR request to get explain query.
var handleButton = function (event) {
event.preventDefault();
+ var data = {};
+ var inputs = this.form.getElementsByTagName('input');
+ var i = inputs.length;
+ while (i--) {
+ var input = inputs[i];
+ if (input.name) {
+ data[input.name] = input.value;
+ }
+ }
+
var fetch = new Request({
+ method: 'POST',
onComplete : function (response) {
var targetEl = document.getElementById('sql-log-explain-query');
targetEl.innerHTML = response.response.text;
@@ -74,7 +85,7 @@ DEBUGKIT.sqlLog = function () {
onFail : function () {
alert('Could not fetch EXPLAIN for query.');
}
- }).send(this.href);
+ }).send(this.form.action, data);
};
Collection.apply(buttons, function (button) {
Please sign in to comment.
Something went wrong with that request. Please try again.