[Uptime] Use base path for screenshot url (#81930)

This commit is contained in:
Shahzad 2020-10-29 16:07:09 +01:00 committed by GitHub
parent 59662eefd2
commit 995111ad8a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 4 deletions

View file

@ -253,6 +253,9 @@ describe('ExecutedJourney component', () => {
}
}
/>
<EuiSpacer
size="s"
/>
</EuiFlexGroup>
`);
});

View file

@ -79,6 +79,7 @@ export const ExecutedJourney: FC<ExecutedJourneyProps> = ({ journey }) => (
{journey.steps.filter(isStepEnd).map((step, index) => (
<ExecutedStep key={index} index={index} step={step} />
))}
<EuiSpacer size="s" />
</EuiFlexGroup>
</div>
);

View file

@ -41,7 +41,7 @@ export const ExecutedStep: FC<ExecutedStepProps> = ({ step, index }) => (
<div>
<StatusBadge status={step.synthetics?.payload?.status} />
</div>
<EuiSpacer />
<EuiSpacer size="s" />
<div>
<EuiFlexGroup>
<EuiFlexItem grow={false}>
@ -87,6 +87,5 @@ export const ExecutedStep: FC<ExecutedStepProps> = ({ step, index }) => (
</EuiFlexGroup>
</div>
</div>
<EuiSpacer />
</>
);

View file

@ -16,7 +16,7 @@ import { i18n } from '@kbn/i18n';
import { FormattedMessage } from '@kbn/i18n/react';
import React, { useContext, useEffect, useRef, useState, FC } from 'react';
import { useIntersection } from 'react-use';
import { UptimeThemeContext } from '../../../contexts';
import { UptimeSettingsContext, UptimeThemeContext } from '../../../contexts';
interface StepScreenshotDisplayProps {
screenshotExists?: boolean;
@ -41,6 +41,8 @@ export const StepScreenshotDisplay: FC<StepScreenshotDisplayProps> = ({
colors: { lightestShade: pageBackground },
} = useContext(UptimeThemeContext);
const { basePath } = useContext(UptimeSettingsContext);
const [isImagePopoverOpen, setIsImagePopoverOpen] = useState<boolean>(false);
const [isOverlayOpen, setIsOverlayOpen] = useState<boolean>(false);
@ -59,7 +61,7 @@ export const StepScreenshotDisplay: FC<StepScreenshotDisplayProps> = ({
}, [hasIntersected, isIntersecting, setHasIntersected]);
let content: JSX.Element | null = null;
const imgSrc = `/api/uptime/journey/screenshot/${checkGroup}/${stepIndex}`;
const imgSrc = basePath + `/api/uptime/journey/screenshot/${checkGroup}/${stepIndex}`;
if (hasIntersected && screenshotExists) {
content = (
<>