Fixed broken sql log selecting in debug-panel (#95)

torrentpier/torrentpier#533
This commit is contained in:
Roman Kelesidis 2023-04-01 01:06:12 +07:00 committed by GitHub
parent accc87da38
commit ce0aefe713
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 33 deletions

View File

@ -52,7 +52,7 @@ function get_sql_log_html ($db_obj, $log_name)
$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="$(\'#'. $id .'\').CopyToClipboard();" style="color: gray; letter-spacing: -1px;">'. $perc .'</span>' . '<span title="Copy to clipboard" onclick="$(\'#'. $id .'\').CopyToClipboard();" style="color: gray; letter-spacing: -1px;">'. $perc .'</span>'
. ' ' . ' '

View File

@ -29,15 +29,6 @@
border-width: 0 0 1px 0; border-width: 0 0 1px 0;
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;
@ -56,7 +47,6 @@
</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)
@ -70,33 +60,16 @@ if (!empty($_COOKIE['explain']))
$sql_log = !empty($_COOKIE['sql_log']) ? get_sql_log() : ''; $sql_log = !empty($_COOKIE['sql_log']) ? get_sql_log() : '';
echo '
<script type="text/javascript">
function fixSqlLog() {
if ($("#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) if ($sql_log)
{ {
echo '<div class="sqlLog" id="sqlLog">'. ($sql_log ? $sql_log : '') .'</div><!-- / sqlLog --><br clear="all" />'; echo '<div class="sqlLog" id="sqlLog">'. ($sql_log ? $sql_log : '') .'</div><!-- / sqlLog --><br clear="all" />';
} }
?> ?>
<script type="text/javascript"> <script type="text/javascript">
function fixSqlLog() {
if ($("#sqlLog").height() > 400) {
$("#sqlLog").height(400);
}
}
$(document).ready(fixSqlLog); $(document).ready(fixSqlLog);
</script> </script>