fixed on message click

This commit is contained in:
SPRINX0\prochazka 2024-11-06 16:48:22 +01:00
parent cec26b0614
commit 83610783e0
4 changed files with 10 additions and 7 deletions

View File

@ -10,6 +10,7 @@
export let showLine = false;
export let showCaller = false;
export let startLine = 0;
export let onMessageClick = null;
export let filter = '';
@ -88,7 +89,7 @@
{time0}
{startLine}
previousRow={index > 0 ? items[index - 1] : null}
on:messageclick
{onMessageClick}
/>
{/each}
</table>

View File

@ -12,7 +12,6 @@
</script>
<script lang="ts">
import { createEventDispatcher } from 'svelte';
import moment from 'moment';
import JSONTree from '../jsontree/JSONTree.svelte';
import FontIcon from '../icons/FontIcon.svelte';
@ -27,17 +26,16 @@
export let startLine;
export let previousRow = null;
export let onMessageClick = null;
let isExpanded = false;
const dispatch = createEventDispatcher();
</script>
<tr
class:isError={row.severity == 'error'}
class:isDebug={row.severity == 'debug'}
class:isActive={row.line}
on:click={() => dispatch('messageclick', row)}
on:click={() => onMessageClick?.(row)}
>
<td>{index + 1}</td>
<td>
@ -88,6 +86,9 @@
border-top: 1px solid var(--theme-border);
padding: 5px;
}
tr.isActive {
cursor: pointer;
}
tr.isActive:hover {
background: var(--theme-bg-2);
}

View File

@ -16,6 +16,7 @@
export let showNoMessagesAlert = false;
export let startLine = 0;
export let onChangeErrors = null;
export let onMessageClick = null;
const cachedMessagesRef = createRef([]);
const lastErrorMessageCountRef = createRef(0);
@ -69,5 +70,5 @@
{#if showNoMessagesAlert && (!displayedMessages || displayedMessages.length == 0)}
<ErrorInfo message="No messages" icon="img alert" />
{:else}
<MessageView items={displayedMessages} on:messageclick {showProcedure} {showLine} {showCaller} {startLine} />
<MessageView items={displayedMessages} {onMessageClick} {showProcedure} {showLine} {showCaller} {startLine} />
{/if}

View File

@ -469,7 +469,7 @@
<svelte:fragment slot="0">
<SocketMessageView
eventName={sessionId ? `session-info-${sessionId}` : null}
on:messageClick={handleMesageClick}
onMessageClick={handleMesageClick}
{executeNumber}
startLine={executeStartLine}
showProcedure