Skip to content

Commit 5147517

Browse files
committed
fix(opspilot linkage): new method for finding opspilot fields
1 parent 438fc70 commit 5147517

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

public/app/features/logs/components/LogDetailsRow.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,14 @@ class UnThemedLogDetailsRow extends PureComponent<Props, State> {
304304
const isMultiParsedValueWithNoContent =
305305
!singleVal && parsedValues != null && !parsedValues.every((val) => val === '');
306306

307+
// Check if this is an OpsPilot field without links and create synthetic link
308+
const isOpsPilotField = parsedKeys?.[0] === "OpsPilot" && singleVal;
309+
const syntheticOpsPilotLink = isOpsPilotField ? {
310+
title: "OpsPilot AI",
311+
href: parsedValues[0], // The log content
312+
url: parsedValues[0]
313+
} : null;
314+
307315
const toggleFieldButton =
308316
displayedFields && parsedKeys != null && displayedFields.includes(parsedKeys[0]) ? (
309317
<IconButton
@@ -366,6 +374,12 @@ class UnThemedLogDetailsRow extends PureComponent<Props, State> {
366374
{singleVal ? parsedValues[0] : this.generateMultiVal(parsedValues, true)}
367375
{singleVal && this.generateClipboardButton(parsedValues[0])}
368376
<div className={cx((singleVal || isMultiParsedValueWithNoContent) && styles.adjoiningLinkButton)}>
377+
{/* Render synthetic OpsPilot button for OpsPilot fields without formal links */}
378+
{syntheticOpsPilotLink && (
379+
<span key="synthetic-opspilot">
380+
<OpspilotDataLinkButton link={syntheticOpsPilotLink} />
381+
</span>
382+
)}
369383
{links?.map((link, i) => {
370384
if (link.onClick && onPinLine) {
371385
const originalOnClick = link.onClick;

0 commit comments

Comments
 (0)