From 94f1fa5aba3ab58589d0e8215ec3bf6b5f6ca81e Mon Sep 17 00:00:00 2001 From: Karthikeyan Singaravelan Date: Wed, 29 Nov 2023 19:55:58 +0530 Subject: [PATCH 1/2] Use dropdown instead of buttons when there are more than 10 retries in log tab. --- .../dag/details/taskInstance/Logs/index.tsx | 56 +++++++++++++------ 1 file changed, 40 insertions(+), 16 deletions(-) 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..5543e30818069 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,44 @@ const Logs = ({ {tryNumber !== undefined && ( <> - (by attempts) - - - {internalIndexes.map((index) => ( - - ))} - - + {!showDropdown && ( + + (by attempts) + + + {internalIndexes.map((index) => ( + + ))} + + + + )} + {showDropdown && ( + + + + )} Date: Sun, 3 Dec 2023 00:34:03 +0530 Subject: [PATCH 2/2] Update airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx Co-authored-by: Jens Scheffler <95105677+jscheffl@users.noreply.github.com> --- airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx | 1 + 1 file changed, 1 insertion(+) 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 5543e30818069..12d64f42388c5 100644 --- a/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx +++ b/airflow/www/static/js/dag/details/taskInstance/Logs/index.tsx @@ -222,6 +222,7 @@ const Logs = ({ {showDropdown && (