Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/Exceptionless.Web/ClientApp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/Exceptionless.Web/ClientApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
"@testing-library/svelte": "^5.4.2",
"@types/eslint": "^9.6.1",
"@types/node": "^26.6.6",
"@types/semver": "^7.8.0",
"@types/throttle-debounce": "^5.0.2",
"cross-env": "^10.1.0",
"devalue": "^6.0.3",
Expand Down Expand Up @@ -104,6 +105,7 @@
"oidc-client-ts": "^3.5.0",
"pretty-ms": "^10.0.0",
"runed": "^0.38.0",
"semver": "^7.8.5",
"shiki": "^4.6.0",
"streamdown-svelte": "^3.0.6",
"svelte-intercom": "^0.0.35",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
<script lang="ts">
import ArrowDown from '@lucide/svelte/icons/arrow-down';
import ArrowUp from '@lucide/svelte/icons/arrow-up';
import ArrowUpDown from '@lucide/svelte/icons/arrow-up-down';

import CopyToClipboardButton from '#comp/copy-to-clipboard-button.svelte';
import SearchInput from '#comp/search-input.svelte';
import { Code, H3, Muted } from '#comp/typography/index.ts';
import { Badge } from '#comp/ui/badge/index.ts';
import { Button } from '#comp/ui/button/index.ts';
import * as Popover from '#comp/ui/popover/index.ts';
import { Switch } from '#comp/ui/switch/index.ts';
import * as Table from '#comp/ui/table/index.ts';

import type { ModuleInfo } from '../models/event-data';

import { describeEventModules, type ModuleSortColumn, sortEventModules } from '../event-modules';

let { modules }: { modules: ModuleInfo[] } = $props();
const id = $props.id();

let search = $state('');
let showRuntimeModules = $state(false);
let sortColumn = $state<ModuleSortColumn>('name');
let sortDirection = $state<'ascending' | 'descending'>('ascending');

let query = $derived(search.trim().toLowerCase());
let rows = $derived(describeEventModules(modules));
let runtimeCount = $derived(rows.filter((row) => row.isRuntime).length);
let sortedRows = $derived(sortEventModules(rows, sortColumn, sortDirection));
let visibleRows = $derived(
sortedRows.filter((row) =>
query ? row.nameLower.includes(query) || row.versions.some((version) => version.versionLower.includes(query)) : showRuntimeModules || !row.isRuntime
)
);

function sortBy(column: ModuleSortColumn) {
if (sortColumn === column) {
sortDirection = sortDirection === 'ascending' ? 'descending' : 'ascending';
} else {
sortColumn = column;
sortDirection = column === 'name' ? 'ascending' : 'descending';
}
}
</script>

{#snippet sortHeader(column: ModuleSortColumn, label: string)}
{@const active = sortColumn === column}
{@const SortIcon = active ? (sortDirection === 'ascending' ? ArrowUp : ArrowDown) : ArrowUpDown}
<Table.Head aria-sort={active ? sortDirection : undefined} class="w-1/2 px-0" scope="col">
<Button onclick={() => sortBy(column)} size="sm" variant="ghost">
{label}
<SortIcon aria-hidden="true" data-icon="inline-end" />
</Button>
</Table.Head>
{/snippet}

<section aria-labelledby={`${id}-heading`} class="mt-4 flex flex-col gap-2">
<H3 id={`${id}-heading`}>Modules</H3>
<div class="flex flex-wrap items-center gap-x-4 gap-y-2">
<SearchInput
aria-label="Search modules"
bind:value={search}
groupClass="w-full sm:max-w-72"
id={`${id}-search`}
placeholder="Name, version, or build hash"
type="search"
/>
{#if runtimeCount && !query}
<div class="flex min-h-8 items-center gap-2">
<Switch bind:checked={showRuntimeModules} id={`${id}-runtime`} size="sm" />
<label class="cursor-pointer text-sm" for={`${id}-runtime`}>Show runtime & framework modules ({runtimeCount})</label>
</div>
{/if}
</div>
<Muted class="text-xs tabular-nums" role="status">
{#if query}
{visibleRows.length} of {rows.length} {rows.length === 1 ? 'module matches' : 'modules match'}
{:else}
{visibleRows.length} of {rows.length} {rows.length === 1 ? 'module' : 'modules'} shown
{/if}
</Muted>

<Table.Root aria-labelledby={`${id}-heading`} class="table-fixed">
<Table.Header>
<Table.Row>
{@render sortHeader('name', 'Name')}
{@render sortHeader('version', 'Reported versions')}
</Table.Row>
</Table.Header>
<Table.Body>
{#each visibleRows as row (row.key)}
<Table.Row class="only:table-row">
<Table.Cell class="align-top wrap-anywhere whitespace-normal">
{#if row.name}
<span class="font-medium">{row.name}</span>
{:else}
<Muted>Unnamed module</Muted>
{/if}
{#if row.entryCount > 1}
<Muted class="mt-0.5 text-xs">{row.entryCount} entries</Muted>
{/if}
</Table.Cell>
<Table.Cell class="align-top wrap-anywhere whitespace-normal">
<ul class="flex flex-col gap-1">
{#each row.versions as value (value.version)}
<li class="flex flex-wrap items-baseline gap-x-1.5">
{#if value.version}
<Code class="bg-transparent p-0 text-xs select-all">{value.versionLabel}</Code>
{#if value.buildHash}
{@const hash = value.buildHash}
{@const shortBuild = hash.length > 8 ? `${hash.slice(0, 8)}…` : hash}
<Popover.Root>
<Popover.Trigger
aria-label={`Show build metadata ${shortBuild} for ${row.name || 'unnamed module'}`}
class="text-muted-foreground hover:text-foreground focus-visible:ring-ring inline-block min-h-6 min-w-6 rounded-sm px-1 font-mono text-xs underline decoration-dotted underline-offset-2 focus-visible:ring-2 focus-visible:outline-none"
openOnHover>{shortBuild}</Popover.Trigger
>
<Popover.Content align="end" aria-label="Build metadata" class="w-88 max-w-[calc(100vw-2rem)]" role="dialog">
<Popover.Title>Build metadata</Popover.Title>
<Code class="bg-transparent p-0 text-xs wrap-anywhere select-all">{hash}</Code>
<div class="flex flex-wrap gap-2">
<CopyToClipboardButton size="sm" title="Copy build metadata" value={hash} variant="outline">
Copy build metadata
</CopyToClipboardButton>
<CopyToClipboardButton size="sm" title="Copy full version" value={value.version} variant="outline">
Copy full version
</CopyToClipboardButton>
</div>
</Popover.Content>
</Popover.Root>
{/if}
{:else}
<Muted>Not reported</Muted>
{/if}
{#if value.count > 1 && row.versions.length > 1}
<Muted class="text-xs">({value.count} entries)</Muted>
{/if}
{#if value.isEntry}
<Badge variant="secondary">Entry module</Badge>
{/if}
</li>
{/each}
</ul>
</Table.Cell>
</Table.Row>
{:else}
<Table.Row>
<Table.Cell class="py-4 whitespace-normal" colspan={2}>
<Muted>{query ? 'No modules match your search.' : 'All reported modules match known runtime or framework names.'}</Muted>
</Table.Cell>
</Table.Row>
{/each}
</Table.Body>
</Table.Root>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

import type { PersistentEvent } from '../../models/index';

import ErrorModules from '../error-modules.svelte';
import ExtendedDataItem from '../extended-data-item.svelte';
import SimpleStackTrace from '../simple-stack-trace/simple-stack-trace.svelte';
import SourceMapStatus from '../stack-trace/source-map-status.svelte';
Expand Down Expand Up @@ -89,24 +90,7 @@
{/if}

{#if modules.length}
<div class="mt-4 mb-2 flex items-center justify-between">
<H3>Modules</H3>
</div>
<Table.Root>
<Table.Header>
<Table.Row>
<Table.Head>Name</Table.Head>
<Table.Head>Version</Table.Head>
</Table.Row>
</Table.Header>
<Table.Body>
<!-- Module IDs are optional and can repeat in submitted events. -->
{#each modules as module, index (index)}
<Table.Row>
<Table.Cell class="whitespace-nowrap">{module.name}</Table.Cell>
<Table.Cell>{module.version}</Table.Cell>
</Table.Row>
{/each}</Table.Body
>
</Table.Root>
{#key event.id}
<ErrorModules {modules} />
{/key}
{/if}
Loading
Loading