diff --git a/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json b/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json index ac440354e9f9f..1958abbb085fc 100644 --- a/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json +++ b/airflow-core/src/airflow/ui/public/i18n/locales/en/common.json @@ -78,6 +78,11 @@ "githubRepo": "GitHub Repo", "restApiReference": "REST API Reference" }, + "download": { + "download": "Download", + "hotkey": "d", + "tooltip": "Press {{hotkey}} to download logs" + }, "duration": "Duration", "endDate": "End Date", "error": { diff --git a/airflow-core/src/airflow/ui/src/components/renderStructuredLog.tsx b/airflow-core/src/airflow/ui/src/components/renderStructuredLog.tsx index a5707cdb1ceb0..f810f57554bd9 100644 --- a/airflow-core/src/airflow/ui/src/components/renderStructuredLog.tsx +++ b/airflow-core/src/airflow/ui/src/components/renderStructuredLog.tsx @@ -47,6 +47,7 @@ type RenderStructuredLogProps = { logLevelFilters?: Array; logLink: string; logMessage: string | StructuredLogMessage; + renderingMode?: "jsx" | "text"; showSource?: boolean; showTimestamp?: boolean; sourceFilters?: Array; @@ -107,17 +108,22 @@ const addAnsiWithLinks = (line: string) => { const sourceFields = ["logger", "chan", "lineno", "filename", "loc"]; -export const renderStructuredLog = ({ +const renderStructuredLogImpl = ({ index, logLevelFilters, logLink, logMessage, + renderingMode = "jsx", showSource = true, showTimestamp = true, sourceFilters, translate, -}: RenderStructuredLogProps) => { +}: RenderStructuredLogProps): JSX.Element | string => { if (typeof logMessage === "string") { + if (renderingMode === "text") { + return logMessage; + } + return ( {addAnsiWithLinks(logMessage)} @@ -147,22 +153,32 @@ export const renderStructuredLog = ({ } if (Boolean(timestamp) && showTimestamp) { - elements.push("[",