ohadmata commented on a change in pull request #6998: [AIRFLOW-6404] - ANSI 
color support for WebUI logger
URL: https://github.com/apache/airflow/pull/6998#discussion_r362526965
 
 

 ##########
 File path: airflow/www/templates/airflow/ti_log.html
 ##########
 @@ -123,8 +123,32 @@ <h4>{{ title }}</h4>
             if(auto_tailing && checkAutoTailingCondition()) {
               var should_scroll = true
             }
+            
+            // ANSI color support
+            var ansi_color_regex = /.\[([0-9][0-9])m(.*?).\[0m/gs;
+            var res.message = res.message.replace(ansi_color_regex, 
function(match, color, content) {
+              var colors = {
+                30: 'black',  40: 'black',
+                31: 'red',    41: 'red',
+                32: 'green',  42: 'green',
+                33: 'yellow', 43: 'yellow',
+                34: 'blue',   44: 'blue',
+                35: 'magenta',45: 'magenta',
+                36: 'cyan',   46: 'cyan',
+                37: 'white',  47: 'white'
+              }
+
+              if (30 <= parseInt(color) && parseInt(color) <= 37) {
 
 Review comment:
   I tested the change in a local environment with ansi_up and it's working 
like a magic :-)
   The problem is that I don't know where I should inclute the new js file.
   Some help please 
   
   Edit: I see that other resource file (Like bootstrap/jquery) stored in: 
/admin/admin/vendor
   But I cant find it in the source code :-(

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to