This is an automated email from the ASF dual-hosted git repository.
jscheffl pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 87acf61f57 Fix problem that links in legacy log view can not be
clicked (#38882)
87acf61f57 is described below
commit 87acf61f574daf47ce9e03a986e352a2c727f4ce
Author: Jens Scheffler <[email protected]>
AuthorDate: Wed Apr 10 13:40:45 2024 +0200
Fix problem that links in legacy log view can not be clicked (#38882)
* Remove problems by double-linkification from coloring
* Fix problem that links in legacy log view can not be clicked
---
airflow/www/static/js/dag/details/taskInstance/Logs/utils.ts | 1 +
airflow/www/static/js/ti_log.js | 8 ++++++--
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/airflow/www/static/js/dag/details/taskInstance/Logs/utils.ts
b/airflow/www/static/js/dag/details/taskInstance/Logs/utils.ts
index a7043cb32f..1d41b3dccd 100644
--- a/airflow/www/static/js/dag/details/taskInstance/Logs/utils.ts
+++ b/airflow/www/static/js/dag/details/taskInstance/Logs/utils.ts
@@ -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
diff --git a/airflow/www/static/js/ti_log.js b/airflow/www/static/js/ti_log.js
index 465af4be6d..1fd66acee6 100644
--- a/airflow/www/static/js/ti_log.js
+++ b/airflow/www/static/js/ti_log.js
@@ -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;
@@ -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) {