Skip to content

Commit

Permalink
Make better use of query tab space
Browse files Browse the repository at this point in the history
  • Loading branch information
erikn69 committed Oct 18, 2024
1 parent 14e4517 commit 29fd3e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
9 changes: 4 additions & 5 deletions src/Resources/laravel-debugbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -571,11 +571,6 @@ ul.phpdebugbar-widgets-timeline li:hover {
background-color: initial;
}

.phpdebugbar-widgets-sqlqueries ul.phpdebugbar-widgets-list li.phpdebugbar-widgets-list-item {
display: flex;
flex-wrap: wrap;
}

.phpdebugbar-widgets-templates ul.phpdebugbar-widgets-list li.phpdebugbar-widgets-list-item {
display: block;
}
Expand Down Expand Up @@ -930,6 +925,10 @@ pre.phpdebugbar-widgets-code-block ul.phpdebugbar-widgets-numbered-code li {
height: 2px !important;
}

div.phpdebugbar-widgets-sqlqueries span.phpdebugbar-widgets-copy-clipboard {
margin-left: 8px !important;
}

div.phpdebugbar-widgets-sqlqueries table.phpdebugbar-widgets-params td.phpdebugbar-widgets-name {
width: 150px;
}
Expand Down
14 changes: 7 additions & 7 deletions src/Resources/queries/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
.attr('data-duplicate', false)
.append($('<strong />').addClass(csscls('sql name')).text(statement.sql));
} else {
const $code = $('<code />').html(PhpDebugBar.Widgets.highlight(statement.sql, 'sql')).addClass(csscls('sql'));
const $code = $('<code />').html(PhpDebugBar.Widgets.highlight(statement.sql, 'sql')).addClass(csscls('sql'));
$li.attr('data-connection', statement.connection)
.attr('data-duplicate', this.duplicateQueries.has(statement))
.append($code);
Expand All @@ -246,7 +246,7 @@
$(event.target).removeClass(csscls('copy-clipboard-check'));
}, 2000)
}
}).appendTo($li);
}).prependTo($li);
}
}

Expand All @@ -260,16 +260,16 @@
}

if ('is_success' in statement && !statement.is_success) {
$li.addClass(csscls('error')).append($('<span />').addClass(csscls('error')).text(`[${statement.error_code}] ${statement.error_message}`));
$li.addClass(csscls('error')).prepend($('<span />').addClass(csscls('error')).text(`[${statement.error_code}] ${statement.error_message}`));
}
if (statement.duration_str) {
$li.append($('<span title="Duration" />').addClass(csscls('duration')).text(statement.duration_str));
$li.prepend($('<span title="Duration" />').addClass(csscls('duration')).text(statement.duration_str));
}
if (statement.memory_str) {
$li.append($('<span title="Memory usage" />').addClass(csscls('memory')).text(statement.memory_str));
$li.prepend($('<span title="Memory usage" />').addClass(csscls('memory')).text(statement.memory_str));
}
if (statement.connection) {
$li.append($('<span title="Connection" />').addClass(csscls('database')).text(statement.connection));
$li.prepend($('<span title="Connection" />').addClass(csscls('database')).text(statement.connection));
}
if (statement.xdebug_link) {
$('<span title="Filename" />')
Expand All @@ -285,7 +285,7 @@
fetch(statement.xdebug_link.url);
}
})
).appendTo($li);
).prependTo($li);
}

const $details = $('<table></table>').addClass(csscls('params'))
Expand Down

0 comments on commit 29fd3e0

Please sign in to comment.