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

View File

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

View File

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

View File

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