Skip to content

Commit efce528

Browse files
committed
Open pod logs from events
1 parent f503ff4 commit efce528

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/components/ResourceDetail.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -601,11 +601,13 @@ function EventSignalRail({
601601
details: ResourceDetails;
602602
detailsError: string;
603603
detailsLoading: boolean;
604-
onOpenResource: (id: string) => void;
604+
onOpenResource: (id: string, intent?: "logs" | null) => void;
605605
resource: ResourceRow;
606606
}) {
607607
const event = details.events[0];
608608
const target = referencedResources(resource.references, allResources)[0];
609+
const targetIsPod = target?.kind === "Pod";
610+
const TargetActionIcon = targetIsPod ? FileText : Network;
609611
const type = detailsLoading ? "Syncing" : event?.type || resource.image || "Event";
610612
const reason = detailsLoading ? "Loading" : event?.reason || resource.diagnostic || "Event";
611613
const message = detailsLoading
@@ -633,9 +635,9 @@ function EventSignalRail({
633635
<ActionFact label="Target" value={resource.owner || "unknown"} />
634636
</div>
635637
{target ? (
636-
<button type="button" onClick={() => onOpenResource(target.id)}>
637-
<Network size={15} />
638-
Open {target.kind}
638+
<button type="button" onClick={() => onOpenResource(target.id, targetIsPod ? "logs" : null)}>
639+
<TargetActionIcon size={15} />
640+
{targetIsPod ? "Open pod logs" : `Open ${target.kind}`}
639641
</button>
640642
) : null}
641643
</div>

0 commit comments

Comments
 (0)