Skip to content

Commit 1aae7da

Browse files
authored
Merge pull request #915 from sipcapture/fix/914-capture-id-display-alias
fix(ui): show Capture ID label for node_id (11.0.307)
2 parents 8096be5 + 5a0b465 commit 1aae7da

4 files changed

Lines changed: 49 additions & 5 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { describe, expect, it } from 'vitest'
2+
import { columnDisplayLabel, columnDisplayTitle } from './resultColumnLabels'
3+
4+
describe('resultColumnLabels', () => {
5+
it('aliases node_id as Capture ID (Homer 7 CaptureID)', () => {
6+
expect(columnDisplayLabel('node_id')).toBe('Capture ID')
7+
expect(columnDisplayTitle('node_id')).toBe('Capture ID (node_id)')
8+
})
9+
10+
it('passes through unknown columns unchanged', () => {
11+
expect(columnDisplayLabel('session_id')).toBe('session_id')
12+
expect(columnDisplayTitle('session_id')).toBe('session_id')
13+
})
14+
})
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/**
2+
* Display labels for lake/result column keys.
3+
* Keys stay as returned by search (e.g. node_id); labels are UI-only.
4+
*
5+
* Homer 7 showed HEP chunk 0x000c as CaptureID; Homer 11 stores it as node_id.
6+
*/
7+
const COLUMN_DISPLAY_LABELS: Record<string, string> = {
8+
node_id: 'Capture ID',
9+
}
10+
11+
/** Human-readable column title; falls back to the raw key. */
12+
export function columnDisplayLabel(col: string): string {
13+
return COLUMN_DISPLAY_LABELS[col] ?? col
14+
}
15+
16+
/** Tooltip for headers / column picker (includes lake key when aliased). */
17+
export function columnDisplayTitle(col: string): string {
18+
const label = columnDisplayLabel(col)
19+
if (label === col) return col
20+
return `${label} (${col})`
21+
}

src/ui/src/dashboard/widgets/ResultsPanel.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import OTLPLogRowModal from '../OTLPLogRowModal'
4242
import OTLPMetricsSeriesModal from '../OTLPMetricsSeriesModal'
4343
import MessageModal from '../MessageModal'
4444
import { useLocale } from '@/components/locale/locale-provider'
45+
import { columnDisplayLabel, columnDisplayTitle } from '../resultColumnLabels'
4546

4647
const OTLP_TRACES_PROTO = 200
4748
const OTLP_METRICS_PROTO = 201
@@ -1108,7 +1109,11 @@ export default function ResultsPanel({ widgetId, config: _config }) {
11081109
'whitespace-nowrap border-b border-border px-2 py-1.5 text-left font-medium text-slate-600 dark:text-slate-300',
11091110
col !== '_actions' && col !== '_select' && 'cursor-pointer select-none hover:text-slate-900 dark:hover:text-sky-100',
11101111
)}
1111-
title={col !== '_actions' && col !== '_select' ? `Sort by ${col}` : undefined}
1112+
title={
1113+
col !== '_actions' && col !== '_select'
1114+
? `Sort by ${columnDisplayTitle(col)}`
1115+
: undefined
1116+
}
11121117
>
11131118
{col === '_select' ? (
11141119
<span className="inline-flex items-center" onClick={(e) => e.stopPropagation()}>
@@ -1128,7 +1133,7 @@ export default function ResultsPanel({ widgetId, config: _config }) {
11281133
<span className="text-[10px] uppercase tracking-wider">Actions</span>
11291134
) : (
11301135
<span className="inline-flex items-center gap-1">
1131-
{col}
1136+
{columnDisplayLabel(col)}
11321137
{sortCol === col ? (
11331138
sortDir === 'asc' ? (
11341139
<ArrowUp className="h-3 w-3" />
@@ -1390,8 +1395,12 @@ export default function ResultsPanel({ widgetId, config: _config }) {
13901395
})
13911396
}}
13921397
/>
1393-
<label htmlFor={`col-${col}`} className="flex-1 cursor-pointer truncate">
1394-
{col}
1398+
<label
1399+
htmlFor={`col-${col}`}
1400+
className="flex-1 cursor-pointer truncate"
1401+
title={columnDisplayTitle(col)}
1402+
>
1403+
{columnDisplayLabel(col)}
13951404
</label>
13961405
<Button
13971406
type="button"

src/version.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
// Version information for homer-core
2525
var (
2626
// VERSION_APPLICATION is the application version
27-
VERSION_APPLICATION = "11.0.306"
27+
VERSION_APPLICATION = "11.0.307"
2828

2929
// BuildDate is the build date
3030
BuildDate = ""

0 commit comments

Comments
 (0)