mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-21 05:43:55 -07:00
Fixed broken sql log selecting in debug-panel
This commit is contained in:
parent
63802f02ba
commit
a2bf059c35
2 changed files with 8 additions and 35 deletions
|
@ -42,17 +42,6 @@ if (!defined('BB_ROOT')) {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sqlLogHead {
|
|
||||||
text-align: right;
|
|
||||||
float: right;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sqlLogHead fieldset {
|
|
||||||
float: right;
|
|
||||||
margin-right: 4px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.sqlLogWrapped {
|
.sqlLogWrapped {
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
overflow: visible;
|
overflow: visible;
|
||||||
|
@ -74,7 +63,6 @@ if (!defined('BB_ROOT')) {
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
if (!empty($_COOKIE['explain'])) {
|
if (!empty($_COOKIE['explain'])) {
|
||||||
foreach ($DBS->srv as $srv_name => $db_obj) {
|
foreach ($DBS->srv as $srv_name => $db_obj) {
|
||||||
if (!empty($db_obj->do_explain)) {
|
if (!empty($db_obj->do_explain)) {
|
||||||
|
@ -85,32 +73,17 @@ if (!empty($_COOKIE['explain'])) {
|
||||||
|
|
||||||
$sql_log = !empty($_COOKIE['sql_log']) ? \TorrentPier\Legacy\Dev::get_sql_log() : '';
|
$sql_log = !empty($_COOKIE['sql_log']) ? \TorrentPier\Legacy\Dev::get_sql_log() : '';
|
||||||
|
|
||||||
echo '
|
if ($sql_log) {
|
||||||
|
echo '<div class="sqlLog" id="sqlLog">' . ($sql_log ?: '') . '</div><!-- / sqlLog --><br clear="all" />';
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
function fixSqlLog() {
|
function fixSqlLog() {
|
||||||
if ($("#sqlLog").height() > 400) {
|
if ($("#sqlLog").height() > 400) {
|
||||||
$("#sqlLog").height(400);
|
$("#sqlLog").height(400);
|
||||||
}
|
}
|
||||||
$("#sqlLog div.sqlLogRow")
|
|
||||||
.hover(
|
|
||||||
function(){ $(this).addClass("sqlHover"); },
|
|
||||||
function(){ $(this).removeClass("sqlHover"); }
|
|
||||||
)
|
|
||||||
.click(
|
|
||||||
function(){ $(this).toggleClass("sqlHighlight"); }
|
|
||||||
)
|
|
||||||
;
|
|
||||||
}
|
}
|
||||||
</script>
|
|
||||||
<div class="sqlLogHead">
|
|
||||||
';
|
|
||||||
|
|
||||||
echo '</div><!-- / sqlLogHead -->';
|
|
||||||
|
|
||||||
if ($sql_log) {
|
|
||||||
echo '<div class="sqlLog" id="sqlLog">' . ($sql_log ?: '') . '</div><!-- / sqlLog --><br clear="all" />';
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<script type="text/javascript">
|
|
||||||
$(document).ready(fixSqlLog);
|
$(document).ready(fixSqlLog);
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -67,7 +67,7 @@ class Dev
|
||||||
$info = !empty($dbg['info']) ? $dbg['info'] . ' [' . $dbg['src'] . ']' : $dbg['src'];
|
$info = !empty($dbg['info']) ? $dbg['info'] . ' [' . $dbg['src'] . ']' : $dbg['src'];
|
||||||
|
|
||||||
$log .= ''
|
$log .= ''
|
||||||
. '<div class="sqlLogRow" title="' . $info . '">'
|
. '<div onmouseout="$(this).removeClass(\'sqlHover\');" onmouseover="$(this).addClass(\'sqlHover\');" onclick="$(this).toggleClass(\'sqlHighlight\');" class="sqlLogRow" title="' . $info . '">'
|
||||||
. '<span style="letter-spacing: -1px;">' . $time . ' </span>'
|
. '<span style="letter-spacing: -1px;">' . $time . ' </span>'
|
||||||
. '<span title="Copy to clipboard" onclick="$.copyToClipboard( $(\'#' . $id . '\').text() );" style="color: gray; letter-spacing: -1px;">' . $perc . '</span>'
|
. '<span title="Copy to clipboard" onclick="$.copyToClipboard( $(\'#' . $id . '\').text() );" style="color: gray; letter-spacing: -1px;">' . $perc . '</span>'
|
||||||
. ' '
|
. ' '
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue