Show executed query on log #1236

This commit is contained in:
SPRINX0\prochazka
2025-11-05 12:11:19 +01:00
parent e5c94d9698
commit ef7f050bc5
9 changed files with 169 additions and 52 deletions

View File

@@ -5,6 +5,8 @@
import { onMount, afterUpdate } from 'svelte';
export let code = '';
export let inline = false;
export let onClick = null;
let domCode;
@@ -29,7 +31,11 @@
The `sql` class hints the language; highlight.js will
read it even though we register the grammar explicitly.
-->
<pre bind:this={domCode} class="sql">{code}</pre>
{#if inline}
<span bind:this={domCode} class="sql" class:clickable={!!onClick} on:click={onClick}>{code}</span>
{:else}
<pre bind:this={domCode} class="sql" class:clickable={!!onClick} on:click={onClick}>{code}</pre>
{/if}
{/key}
<style>
@@ -38,4 +44,8 @@
padding: 0;
padding: 0.5em;
}
.clickable {
cursor: pointer;
}
</style>