diff --git a/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx b/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx index 16a5e2159f38d..12d64f42388c5 100644 --- a/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx +++ b/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx @@ -26,6 +26,7 @@ import { Checkbox, Icon, Spinner, + Select, } from "@chakra-ui/react"; import { MdWarning } from "react-icons/md"; @@ -152,6 +153,9 @@ const Logs = ({ [data, fileSourceFilters, logLevelFilters, timezone] ); + const logAttemptDropdownLimit = 10; + const showDropdown = internalIndexes.length > logAttemptDropdownLimit; + useEffect(() => { // Reset fileSourceFilters and selected attempt when changing to // a task that do not have those filters anymore. @@ -193,24 +197,45 @@ const Logs = ({ {tryNumber !== undefined && ( <> - (by attempts) - - - {internalIndexes.map((index) => ( - - ))} - - + {!showDropdown && ( + + (by attempts) + + + {internalIndexes.map((index) => ( + + ))} + + + + )} + {showDropdown && ( + + + + )}