diff --git a/console/client/src/components/Card.tsx b/console/client/src/components/Card.tsx index 5b315697d9..58108480a6 100644 --- a/console/client/src/components/Card.tsx +++ b/console/client/src/components/Card.tsx @@ -1,13 +1,17 @@ interface Props { topBarColor?: string + className?: string onClick?: () => void children: React.ReactNode } -export const Card = ({ topBarColor, onClick, children }: Props) => { + +export const Card = ({ topBarColor, className, onClick, children }: Props) => { return (
{topBarColor && (
diff --git a/console/client/src/features/timeline/Timeline.tsx b/console/client/src/features/timeline/Timeline.tsx index 08b25bd6e3..df41ad1519 100644 --- a/console/client/src/features/timeline/Timeline.tsx +++ b/console/client/src/features/timeline/Timeline.tsx @@ -116,6 +116,21 @@ export const Timeline = ({ timeSettings, filters }: Props) => { setSearchParams({ ...Object.fromEntries(searchParams.entries()), id: entry.id.toString() }) } + const deploymentName = (event: Event) => { + switch (event.entry?.case) { + case 'call': + return event.entry.value.deploymentName + case 'log': + return event.entry.value.deploymentName + case 'deploymentCreated': + return event.entry.value.name + case 'deploymentUpdated': + return event.entry.value.name + default: + return '' + } + } + return (
@@ -124,6 +139,9 @@ export const Timeline = ({ timeSettings, filters }: Props) => { Date + + Deployment + Content @@ -144,6 +162,12 @@ export const Timeline = ({ timeSettings, filters }: Props) => { {formatTimestampShort(entry.timeStamp)} + + {deploymentName(entry)} + {(() => { switch (entry.entry?.case) { diff --git a/console/client/src/features/timeline/TimelinePage.tsx b/console/client/src/features/timeline/TimelinePage.tsx index 417025808e..ce107fdcae 100644 --- a/console/client/src/features/timeline/TimelinePage.tsx +++ b/console/client/src/features/timeline/TimelinePage.tsx @@ -15,13 +15,14 @@ export const TimelinePage = () => { const [selectedTimeRange, setSelectedTimeRange] = React.useState(TIME_RANGES['tail']) const [isTimelinePaused, setIsTimelinePaused] = React.useState(false) + const initialEventId = searchParams.get('id') React.useEffect(() => { - if (searchParams.get('id')) { + if (initialEventId) { // if we're loading a specific event, we don't want to tail. setSelectedTimeRange(TIME_RANGES['5m']) setIsTimelinePaused(true) } - }, [searchParams]) + }, []) const handleTimeSettingsChanged = (settings: TimeSettings) => { setTimeSettings(settings) diff --git a/console/client/src/features/timeline/details/TimelineCallDetails.tsx b/console/client/src/features/timeline/details/TimelineCallDetails.tsx index 8427760448..b04ab6eebc 100644 --- a/console/client/src/features/timeline/details/TimelineCallDetails.tsx +++ b/console/client/src/features/timeline/details/TimelineCallDetails.tsx @@ -1,5 +1,7 @@ import { Timestamp } from '@bufbuild/protobuf' import React, { useEffect, useState } from 'react' +import { useNavigate } from 'react-router-dom' +import { Card } from '../../../components' import { AttributeBadge } from '../../../components/AttributeBadge' import { CloseButton } from '../../../components/CloseButton' import { CodeBlock } from '../../../components/CodeBlock' @@ -20,6 +22,7 @@ interface Props { export const TimelineCallDetails = ({ timestamp, call }: Props) => { const client = useClient(ConsoleService) + const navigate = useNavigate() const { closePanel } = React.useContext(SidePanelContext) const [requestCalls, setRequestCalls] = useState([]) const [selectedCall, setSelectedCall] = useState(call) @@ -83,10 +86,17 @@ export const TimelineCallDetails = ({ timestamp, call }: Props) => { )} + navigate(`/deployments/${call.deploymentName}`)} + > + {call.deploymentName} +

{call.deploymentName}

+
+
    -
  • - -
  • {selectedCall.requestName && (
  • diff --git a/console/client/src/features/timeline/details/TimelineDeploymentCreatedDetails.tsx b/console/client/src/features/timeline/details/TimelineDeploymentCreatedDetails.tsx index 7694b821c6..0abdd6952a 100644 --- a/console/client/src/features/timeline/details/TimelineDeploymentCreatedDetails.tsx +++ b/console/client/src/features/timeline/details/TimelineDeploymentCreatedDetails.tsx @@ -1,6 +1,8 @@ import { Timestamp } from '@bufbuild/protobuf' import React from 'react' +import { useNavigate } from 'react-router-dom' import { AttributeBadge } from '../../../components/AttributeBadge' +import { Card } from '../../../components/Card' import { CloseButton } from '../../../components/CloseButton' import { DeploymentCreatedEvent, Event } from '../../../protos/xyz/block/ftl/v1/console/console_pb' import { SidePanelContext } from '../../../providers/side-panel-provider' @@ -13,6 +15,8 @@ interface Props { export const TimelineDeploymentCreatedDetails = ({ event, deployment }: Props) => { const { closePanel } = React.useContext(SidePanelContext) + const navigate = useNavigate() + return ( <>
    @@ -31,10 +35,17 @@ export const TimelineDeploymentCreatedDetails = ({ event, deployment }: Props) =
+ navigate(`/deployments/${deployment.name}`)} + > + {deployment.name} +

{deployment.name}

+
+
+ navigate(`/deployments/${deployment.name}`)} + > + {deployment.name} +

{deployment.name}

+
+