[GitHub] feng-tao commented on a change in pull request #4425: [AIRFLOW-3623] Support download logs by attempts from UI

2019-01-03 Thread GitBox
feng-tao commented on a change in pull request #4425: [AIRFLOW-3623] Support 
download logs by attempts from UI
URL: https://github.com/apache/incubator-airflow/pull/4425#discussion_r245168034
 
 

 ##
 File path: airflow/www/templates/airflow/dag.html
 ##
 @@ -320,6 +326,29 @@ 
 $("#div_btn_subdag").show();
 subdag_id = "{{ dag.dag_id }}."+t;
 }
+
+  $("#try_index > li").remove()
+  var startIndex = (try_numbers > 2 ? 0 : 1)
 
 Review comment:
   nit: semicolon in the end?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] feng-tao commented on a change in pull request #4425: [AIRFLOW-3623] Support download logs by attempts from UI

2019-01-03 Thread GitBox
feng-tao commented on a change in pull request #4425: [AIRFLOW-3623] Support 
download logs by attempts from UI
URL: https://github.com/apache/incubator-airflow/pull/4425#discussion_r245167349
 
 

 ##
 File path: airflow/utils/helpers.py
 ##
 @@ -297,3 +297,16 @@ def parse_template_string(template_string):
 return None, Template(template_string)
 else:
 return template_string, None
+
+
+def render_log_filename(ti, try_number, filename_template):
 
 Review comment:
   nit: please provides a docstring for the function.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] feng-tao commented on a change in pull request #4425: [AIRFLOW-3623] Support download logs by attempts from UI

2019-01-03 Thread GitBox
feng-tao commented on a change in pull request #4425: [AIRFLOW-3623] Support 
download logs by attempts from UI
URL: https://github.com/apache/incubator-airflow/pull/4425#discussion_r245167996
 
 

 ##
 File path: airflow/www/templates/airflow/dag.html
 ##
 @@ -320,6 +326,29 @@ 
 $("#div_btn_subdag").show();
 subdag_id = "{{ dag.dag_id }}."+t;
 }
+
+  $("#try_index > li").remove()
 
 Review comment:
   nit: semicolon in the end?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] feng-tao commented on a change in pull request #4425: [AIRFLOW-3623] Support download logs by attempts from UI

2019-01-03 Thread GitBox
feng-tao commented on a change in pull request #4425: [AIRFLOW-3623] Support 
download logs by attempts from UI
URL: https://github.com/apache/incubator-airflow/pull/4425#discussion_r245168256
 
 

 ##
 File path: airflow/www/views.py
 ##
 @@ -770,7 +774,12 @@ def get_logs_with_metadata(self, session=None):
 task_id = request.args.get('task_id')
 execution_date = request.args.get('execution_date')
 dttm = pendulum.parse(execution_date)
-try_number = int(request.args.get('try_number'))
+if request.args.get('try_number', None) is not None:
 
 Review comment:
   small nit: request.args.get('try_number', None) could be 
request.args.get('try_number') as the default should be None


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] feng-tao commented on a change in pull request #4425: [AIRFLOW-3623] Support download logs by attempts from UI

2019-01-03 Thread GitBox
feng-tao commented on a change in pull request #4425: [AIRFLOW-3623] Support 
download logs by attempts from UI
URL: https://github.com/apache/incubator-airflow/pull/4425#discussion_r245168050
 
 

 ##
 File path: airflow/www/templates/airflow/dag.html
 ##
 @@ -320,6 +326,29 @@ 
 $("#div_btn_subdag").show();
 subdag_id = "{{ dag.dag_id }}."+t;
 }
+
+  $("#try_index > li").remove()
+  var startIndex = (try_numbers > 2 ? 0 : 1)
+  for (var index = startIndex; index <  try_numbers; index++) {
+var url = "{{ url_for('airflow.get_logs_with_metadata') }}" +
+  "?dag_id=" + encodeURIComponent(dag_id) +
+  "_id=" + encodeURIComponent(task_id) +
+  "_date=" + encodeURIComponent(execution_date) +
+  "=null" +
+  "=file"
 
 Review comment:
   nit: semicolon in the end?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] feng-tao commented on a change in pull request #4425: [AIRFLOW-3623] Support download logs by attempts from UI

2019-01-03 Thread GitBox
feng-tao commented on a change in pull request #4425: [AIRFLOW-3623] Support 
download logs by attempts from UI
URL: https://github.com/apache/incubator-airflow/pull/4425#discussion_r245168502
 
 

 ##
 File path: airflow/www_rbac/templates/airflow/dag.html
 ##
 @@ -314,12 +320,35 @@ 
   $('#execution_date').html(d);
   $('#myModal').modal({});
   $("#myModal").css("margin-top","0px")
-if (subdag_id===undefined)
-$("#div_btn_subdag").hide();
-else {
-$("#div_btn_subdag").show();
-subdag_id = "{{ dag.dag_id }}."+t;
+  if (subdag_id===undefined)
+  $("#div_btn_subdag").hide();
+  else {
+  $("#div_btn_subdag").show();
+  subdag_id = "{{ dag.dag_id }}."+t;
+  }
+
+  $("#try_index > li").remove()
 
 Review comment:
   same for the semicolon


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services