pierrejeambrun commented on code in PR #63467:
URL: https://github.com/apache/airflow/pull/63467#discussion_r3032881093
##########
airflow-core/src/airflow/ui/src/pages/TaskInstance/Logs/Logs.tsx:
##########
@@ -118,6 +118,58 @@ export const Logs = () => {
const getLogString = () => getParsedLogs().join("\n");
+ const [searchQuery, setSearchQuery] = useState("");
+ const [currentMatchIndex, setCurrentMatchIndex] = useState(0);
+
+ const getSearchMatchIndices = () => {
+ if (!searchQuery) {
+ return [];
+ }
+ const query = searchQuery.toLowerCase();
+ const lines = parseStreamingLogContent(fetchedData);
+ const textLines = lines.map((line) =>
+ renderStructuredLog({
+ index: 0,
+ logLevelFilters,
+ logLink: "",
+ logMessage: line,
+ renderingMode: "text",
+ showSource,
+ showTimestamp,
+ sourceFilters,
+ translate,
+ }),
+ );
Review Comment:
This piece of code is duplicated with
```
const getParsedLogs = () => {
const lines = parseStreamingLogContent(fetchedData);
return lines.map((line) =>
renderStructuredLog({
index: 0,
logLevelFilters,
logLink: "",
logMessage: line,
renderingMode: "text",
showSource,
showTimestamp,
sourceFilters,
translate,
}),
);
};
```
We can probably extract this into a shared utility function.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]