Skip to content

Commit

Permalink
Fix problem that links in legacy log view can not be clicked (#38882)
Browse files Browse the repository at this point in the history
* Remove problems by double-linkification from coloring

* Fix problem that links in legacy log view can not be clicked
  • Loading branch information
jscheffl committed Apr 10, 2024
1 parent 768e116 commit 87acf61
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export const parseLogs = (
const parsedLines: Array<string> = [];
const fileSources: Set<string> = new Set();
const ansiUp = new AnsiUp();
ansiUp.url_allowlist = {};

const urlRegex = /((https?:\/\/|http:\/\/)[^\s]+)/g;
// Detect log groups which can be collapsed
Expand Down
8 changes: 6 additions & 2 deletions airflow/www/static/js/ti_log.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ function autoTailingLog(tryNumber, metadata = null, autoTailing = false) {

// Text coloring, detect urls and log timestamps
const ansiUp = new AnsiUp();
ansiUp.url_allowlist = {};
// Detect urls and log timestamps
const urlRegex =
/http(s)?:\/\/[\w.-]+(\.?:[\w.-]+)*([/?#][\w\-._~:/?#[\]@!$&'()*+,;=.%]+)?/g;
Expand Down Expand Up @@ -194,11 +195,14 @@ function handleLogGroupClick(e) {
if (e.target.id?.endsWith(unfoldIdSuffix)) {
e.target.style.display = "none";
e.target.nextSibling.style.display = "inline";
} else if (e.target.id?.endsWith(foldIdSuffix)) {
return false;
}
if (e.target.id?.endsWith(foldIdSuffix)) {
e.target.parentNode.style.display = "none";
e.target.parentNode.previousSibling.style.display = "inline";
return false;
}
return false;
return true;
}

function setDownloadUrl(tryNumber) {
Expand Down

0 comments on commit 87acf61

Please sign in to comment.