Commit 55bb579 1 parent 68b8ec5 commit 55bb579 Copy full SHA for 55bb579
File tree 1 file changed +10
-2
lines changed
airflow/www/templates/airflow
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -121,10 +121,18 @@ <h4>{{ title }}</h4>
121
121
if ( res . message ) {
122
122
// Auto scroll window to the end if current window location is near the end.
123
123
if ( auto_tailing && checkAutoTailingCondition ( ) ) {
124
- var should_scroll = true
124
+ var should_scroll = true ;
125
125
}
126
126
// The message may contain HTML, so either have to escape it or write it as text.
127
- document . getElementById ( `try-${ try_number } ` ) . textContent += res . message + "\n" ;
127
+ var escaped_message = escapeHtml ( res . message ) ;
128
+
129
+ // Detect urls
130
+ var url_regex = / h t t p ( s ) ? : \/ \/ [ \w \. \- ] + ( \. ? : [ \w \. \- ] + ) * ( [ \/ ? # ] [ \w \- \. _ ~ : / ? # [ \] @ ! \$ & ' \( \) \* \+ , ; = \. % ] + ) ? / g;
131
+ var linkified_message = escaped_message . replace ( url_regex , function ( url ) {
132
+ return "<a href=\"" + url + "\" target=\"_blank\">" + url + "</a>" ;
133
+ } ) ;
134
+
135
+ document . getElementById ( `try-${ try_number } ` ) . innerHTML += linkified_message + "<br/>" ;
128
136
// Auto scroll window to the end if current window location is near the end.
129
137
if ( should_scroll ) {
130
138
scrollBottom ( ) ;
You can’t perform that action at this time.
0 commit comments