Fixed broken copy log from debug-panel

Исправляет напрочь нерабочую реализацию копирования данных из дебаг панели. По-моему ещё с SVN версий не работало 😁

+ Перспективы на будущее использование в коде при необходимости.
This commit is contained in:
Roman Kelesidis 2023-02-20 23:16:06 +07:00
commit 3cf6e0974c
4 changed files with 12 additions and 2 deletions

View file

@ -69,7 +69,7 @@ class Dev
$log .= ''
. '<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 title="Copy to clipboard" onclick="$.copyToClipboard( $(\'#' . $id . '\').text() );" style="color: gray; letter-spacing: -1px;">' . $perc . '</span>'
. '<span class="copyElement" data-clipboard-target="#' . $id . '" title="Copy to clipboard" style="color: gray; letter-spacing: -1px;">' . $perc . '</span>'
. ' '
. '<span style="letter-spacing: 0;" id="' . $id . '">' . $sql . '</span>'
. '<span style="color: gray"> # ' . $info . ' </span>'

View file

@ -995,7 +995,7 @@ class SqlDb
<table width="98%" cellpadding="0" cellspacing="0" class="bodyline row2 bCenter" style="border-bottom: 0;">
<tr>
<th style="height: 22px; cursor: pointer;" align="left">&nbsp;' . $dbg['src'] . '&nbsp; [' . sprintf('%.4f', $dbg['time']) . ' s]&nbsp; <i>' . $dbg['info'] . '</i></th>
<th style="height: 22px; cursor: pointer;" align="right" title="Copy to clipboard" onclick="$.copyToClipboard( $(\'#' . $htid . '\').text() );">' . "$this->db_server.$this->selected_db" . ' :: Query #' . ($this->num_queries + 1) . '&nbsp;</th>
<th class="copyElement" data-clipboard-target="#' . $htid . '" style="height: 22px; cursor: pointer;" align="right" title="Copy to clipboard">' . "$this->db_server.$this->selected_db" . ' :: Query #' . ($this->num_queries + 1) . '&nbsp;</th>
</tr>
<tr><td colspan="2">' . $this->explain_hold . '</td></tr>
</table>

File diff suppressed because one or more lines are too long

View file

@ -64,6 +64,8 @@
<!-- ENDIF -->
<script type="text/javascript">new ClipboardJS('.copyElement');</script>
<!-- IF ONLOAD_FOCUS_ID -->
<script type="text/javascript">
$p('{ONLOAD_FOCUS_ID}').focus();