Skip to content
Merged
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
14 changes: 14 additions & 0 deletions src/ui/src/dashboard/resultColumnLabels.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { describe, expect, it } from 'vitest'
import { columnDisplayLabel, columnDisplayTitle } from './resultColumnLabels'

describe('resultColumnLabels', () => {
it('aliases node_id as Capture ID (Homer 7 CaptureID)', () => {
expect(columnDisplayLabel('node_id')).toBe('Capture ID')
expect(columnDisplayTitle('node_id')).toBe('Capture ID (node_id)')
})

it('passes through unknown columns unchanged', () => {
expect(columnDisplayLabel('session_id')).toBe('session_id')
expect(columnDisplayTitle('session_id')).toBe('session_id')
})
})
21 changes: 21 additions & 0 deletions src/ui/src/dashboard/resultColumnLabels.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/**
* Display labels for lake/result column keys.
* Keys stay as returned by search (e.g. node_id); labels are UI-only.
*
* Homer 7 showed HEP chunk 0x000c as CaptureID; Homer 11 stores it as node_id.
*/
const COLUMN_DISPLAY_LABELS: Record<string, string> = {
node_id: 'Capture ID',
}

/** Human-readable column title; falls back to the raw key. */
export function columnDisplayLabel(col: string): string {
return COLUMN_DISPLAY_LABELS[col] ?? col
}

/** Tooltip for headers / column picker (includes lake key when aliased). */
export function columnDisplayTitle(col: string): string {
const label = columnDisplayLabel(col)
if (label === col) return col
return `${label} (${col})`
}
17 changes: 13 additions & 4 deletions src/ui/src/dashboard/widgets/ResultsPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import OTLPLogRowModal from '../OTLPLogRowModal'
import OTLPMetricsSeriesModal from '../OTLPMetricsSeriesModal'
import MessageModal from '../MessageModal'
import { useLocale } from '@/components/locale/locale-provider'
import { columnDisplayLabel, columnDisplayTitle } from '../resultColumnLabels'

const OTLP_TRACES_PROTO = 200
const OTLP_METRICS_PROTO = 201
Expand Down Expand Up @@ -1108,7 +1109,11 @@ export default function ResultsPanel({ widgetId, config: _config }) {
'whitespace-nowrap border-b border-border px-2 py-1.5 text-left font-medium text-slate-600 dark:text-slate-300',
col !== '_actions' && col !== '_select' && 'cursor-pointer select-none hover:text-slate-900 dark:hover:text-sky-100',
)}
title={col !== '_actions' && col !== '_select' ? `Sort by ${col}` : undefined}
title={
col !== '_actions' && col !== '_select'
? `Sort by ${columnDisplayTitle(col)}`
: undefined
}
>
{col === '_select' ? (
<span className="inline-flex items-center" onClick={(e) => e.stopPropagation()}>
Expand All @@ -1128,7 +1133,7 @@ export default function ResultsPanel({ widgetId, config: _config }) {
<span className="text-[10px] uppercase tracking-wider">Actions</span>
) : (
<span className="inline-flex items-center gap-1">
{col}
{columnDisplayLabel(col)}
{sortCol === col ? (
sortDir === 'asc' ? (
<ArrowUp className="h-3 w-3" />
Expand Down Expand Up @@ -1390,8 +1395,12 @@ export default function ResultsPanel({ widgetId, config: _config }) {
})
}}
/>
<label htmlFor={`col-${col}`} className="flex-1 cursor-pointer truncate">
{col}
<label
htmlFor={`col-${col}`}
className="flex-1 cursor-pointer truncate"
title={columnDisplayTitle(col)}
>
{columnDisplayLabel(col)}
</label>
<Button
type="button"
Expand Down
2 changes: 1 addition & 1 deletion src/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
// Version information for homer-core
var (
// VERSION_APPLICATION is the application version
VERSION_APPLICATION = "11.0.306"
VERSION_APPLICATION = "11.0.307"

// BuildDate is the build date
BuildDate = ""
Expand Down