Skip to content

Commit 93c8868

Browse files
committed
Enhance Hex128 component to display icons based on type and update usage in LogsViewer
1 parent 96b942a commit 93c8868

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

web/pages/DeploymentPage.tsx

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ import {
1010
Download,
1111
Eye,
1212
FileText,
13+
Hash,
1314
Info,
15+
Link2,
1416
MoreHorizontal,
1517
Play,
1618
Plus,
@@ -943,19 +945,22 @@ const logThreads = [
943945
'Attributes',
944946
] as const
945947

946-
const Hex128 = ({ hex }: { hex: string }) => {
948+
const Hex128 = ({ hex, type }: { hex: string; type: 'trace' | 'span' }) => {
947949
const { hue, short, value } = parseHex128(hex)
950+
const Icon = type === 'trace' ? Link2 : Hash
951+
948952
return (
949-
<span
950-
title={`${hex} (${value})`}
951-
class='block truncate badge-sm badge badge-outline border-current/20 uppercase'
953+
<div
954+
class='badge badge-outline badge-sm border-current/20'
955+
title={`${type}: ${hex} (${value})`}
952956
style={{
953957
color: `oklch(0.93 0.15 ${hue})`,
954958
backgroundColor: `oklch(0.25 0.01 ${hue})`,
955959
}}
956960
>
957-
{short}
958-
</span>
961+
<Icon class='w-3 h-3 mr-1' />
962+
<span class='uppercase truncate'>{short}</span>
963+
</div>
959964
)
960965
}
961966

@@ -1044,11 +1049,11 @@ function LogsViewer() {
10441049
)}
10451050
</div>
10461051
</td>
1047-
<td class='p-0 font-mono text-xs text-base-content/50 max-w-[12rem] hidden md:table-cell'>
1048-
<Hex128 hex={log.trace_id} />
1052+
<td class='p-0 max-w-[12rem] hidden md:table-cell'>
1053+
<Hex128 hex={log.trace_id} type='trace' />
10491054
</td>
1050-
<td class='p-0 font-mono text-xs text-base-content/50 max-w-[12rem] hidden md:table-cell'>
1051-
<Hex128 hex={log.span_id} />
1055+
<td class='p-0 max-w-[12rem] hidden md:table-cell'>
1056+
<Hex128 hex={log.span_id} type='span' />
10521057
</td>
10531058
<td class='p-0 text-xs text-base-content/60 hidden lg:table-cell min-w-[12rem] max-w-[16rem]'>
10541059
<code

0 commit comments

Comments
 (0)