Skip to content

Commit 91659e7

Browse files
authored
[Feature]: If GCP logging or AWS Cloudwatch logging is configured, show link in the UI to the log stream #2926 (#2948)
1 parent 71a6f5c commit 91659e7

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

frontend/src/pages/Runs/Details/Logs/index.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const Logs: React.FC<IProps> = ({ className, projectName, runName, jobSub
2323
const scrollPositionByBottom = useRef<number>(0);
2424

2525
const [logsData, setLogsData] = useState<ILogItem[]>([]);
26+
const [externalLink, setExternalLink] = useState<string | undefined>();
2627
const [isLoading, setIsLoading] = useState(false);
2728
const [getProjectLogs] = useLazyGetProjectLogsQuery();
2829
const [isEnabledDecoding, setIsEnabledDecoding] = useLocalStorageState('enable-encode-logs', false);
@@ -84,6 +85,7 @@ export const Logs: React.FC<IProps> = ({ className, projectName, runName, jobSub
8485
setLogsData((old) => [...reversed, ...old]);
8586
} else {
8687
setLogsData(reversed);
88+
setExternalLink(response.external_url);
8789
}
8890

8991
nextTokenRef.current = response.next_token;
@@ -154,6 +156,10 @@ export const Logs: React.FC<IProps> = ({ className, projectName, runName, jobSub
154156
<Header variant="h2">{t('projects.run.log')}</Header>
155157
</div>
156158

159+
{externalLink && (
160+
<Button target="_blank" formAction="none" iconName="external" href={externalLink} variant="icon" />
161+
)}
162+
157163
<Loader
158164
show={isLoading && Boolean(logsForView.length)}
159165
padding={'n'}

frontend/src/types/log.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,6 @@ declare type TRequestLogsParams = {
1818

1919
declare type TResponseLogsParams = {
2020
logs: ILogItem[];
21+
external_url?: string;
2122
next_token?: string;
2223
};

0 commit comments

Comments
 (0)