(function($) { var csscls = PhpDebugBar.utils.makecsscls('phpdebugbar-widgets-'); /** * Widget for the displaying sql queries * * Options: * - data */ var SQLQueriesWidget = PhpDebugBar.Widgets.SQLQueriesWidget = PhpDebugBar.Widget.extend({ className: csscls('sqlqueries'), render: function() { this.$status = $('
').addClass(csscls('status')).appendTo(this.$el); this.$list = new PhpDebugBar.Widgets.ListWidget({ itemRenderer: function(li, stmt) { $('
').addClass(csscls('sql')).html(PhpDebugBar.Widgets.highlight(stmt.sql, 'sql')).appendTo(li);
if (stmt.duration_str) {
$('').addClass(csscls('duration')).text(stmt.duration_str).appendTo(li);
}
if (stmt.memory_str) {
$('').addClass(csscls('memory')).text(stmt.memory_str).appendTo(li);
}
if (typeof(stmt.is_success) != 'undefined' && !stmt.is_success) {
li.addClass(csscls('error'));
li.append($('').addClass(csscls('error')).text("[" + stmt.error_code + "] " + stmt.error_message));
} else if (typeof(stmt.row_count) != 'undefined') {
$('').addClass(csscls('row-count')).text(stmt.row_count).appendTo(li);
}
if (typeof(stmt.stmt_id) != 'undefined' && stmt.stmt_id) {
$('').addClass(csscls('stmt-id')).text(stmt.stmt_id).appendTo(li);
}
if (stmt.params && !$.isEmptyObject(stmt.params)) {
var table = $('Params |
---|