ryanahamilton commented on a change in pull request #10944:
URL: https://github.com/apache/airflow/pull/10944#discussion_r489454843



##########
File path: airflow/www/templates/airflow/dag.html
##########
@@ -108,199 +108,221 @@ <h4 class="pull-right">
   </div>
   <hr>
   <!-- Modal -->
-  <div class="modal fade" id="myModal"
-        tabindex="-1" role="dialog"
-      aria-labelledby="myModalLabel" aria-hidden="true">
+  <div class="modal fade" id="taskInstanceModal" tabindex="-1" role="dialog" 
aria-labelledby="taskInstanceModalLabel" aria-hidden="true">
     <div class="modal-dialog">
       <div class="modal-content">
         <div class="modal-header">
-          <h4 class="modal-title" id="myModalLabel">
-            <span id='task_id'></span>
-            <button id="btn_filter" type="button" class="btn btn-default" 
title="Filter on this task and upstream ">
-              <span class="glyphicon glyphicon-filter" style="margin-left:0;" 
aria-hidden="true"></span>
-            </button>
-              on
-            <span id='execution_date'></span>
+          <button type="button" class="close" data-dismiss="modal" 
aria-label="Close"><span aria-hidden="true">&times;</span></button>
+          <h4 class="modal-title" id="taskInstanceModalLabel">
+            <span class="text-muted">Task Instance:</span> <span 
id="task_id"></span>
+            <br /><span class="text-muted">at:</span> <span 
id="execution_date"></span>
           </h4>
         </div>
         <div class="modal-body">
           <div id="div_btn_subdag">
-            <a id="btn_subdag" type="button" class="btn btn-primary" 
data-base-url="{{ url_for('Airflow.' + dag.get_default_view()) }}">
+            <a id="btn_subdag" class="btn btn-primary" data-base-url="{{ 
url_for('Airflow.' + dag.get_default_view()) }}">
               Zoom into Sub DAG
             </a>
             <hr/>
           </div>
-          <a id="btn_task" type="button" class="btn btn-primary" 
data-base-url="{{ url_for('Airflow.task') }}">
+          <a id="btn_task" class="btn btn-sm btn-default" data-base-url="{{ 
url_for('Airflow.task') }}">
             Task Instance Details
           </a>
-          <a id="btn_rendered" type="button" class="btn btn-primary" 
data-base-url="{{ url_for('Airflow.rendered') }}">
+          <a id="btn_rendered" class="btn btn-sm btn-default" 
data-base-url="{{ url_for('Airflow.rendered') }}">
             Rendered
           </a>
-          <a id="btn_ti" type="button" class="btn btn-primary" 
data-base-url="{{ url_for('TaskInstanceModelView.list') }}">
+          <a id="btn_ti" class="btn btn-sm btn-default" data-base-url="{{ 
url_for('TaskInstanceModelView.list') }}">
             Task Instances
           </a>
-          <a id="btn_log" type="button" class="btn btn-primary" 
data-base-url="{{ url_for('Airflow.log') }}">
+          <a id="btn_log" class="btn btn-sm btn-default" data-base-url="{{ 
url_for('Airflow.log') }}">
             View Log
           </a>
+          <button id="btn_filter" type="button" class="btn btn-sm btn-default" 
title="Filter on this task and upstream ">
+            <span class="glyphicon glyphicon-filter" style="margin-left:0;" 
aria-hidden="true"></span>
+            Filter Upstream
+          </button>
           <hr/>
           <div id="dag_dl_logs">
-            <label style="display:inline"> Download Log (by attempts): </label>
+            <label style="display:inline"> Download Log (by attempts):</label>
             <ul class="nav nav-pills" role="tablist" id="try_index" 
style="display:inline">
             </ul>
             <hr/>
             <hr/>
           </div>
-          <div id="dag_redir_logs">
-            {% if external_log_name is defined %}
-              <label style="display:inline"> View Logs in {{ external_log_name 
}} (by attempts): </label>
+          {% if external_log_name is defined %}
+            <div id="dag_redir_logs">
+              <label style="display:inline"> View Logs in {{ external_log_name 
}} (by attempts):</label>
               <ul class="nav nav-pills" role="tablist" 
id="redir_log_try_index" style="display:inline">
               </ul>
               <hr/>
               <hr/>
-            {% endif %}
-          </div>
-          <form method="POST">
+            </div>
+          {% endif %}
+          <form method="POST" data-action="{{ url_for('Airflow.run') }}">

Review comment:
       The associated scripting below (line 555) is modifying form values 
priory to submitting, so it's not submitting to the `action` natively. The 
second to last line is basically changing `data-action` to `action`—this just 
felt like an explicit indicator when reading the code that this form is handled 
by scripting (not a vanilla `<form>`).
   ```js
       // Task Instance Modal actions
       $('form[data-action]').submit(function (e) {
         e.preventDefault();
         var form = $(this).get(0);
         form.execution_date.value = execution_date;
         form.origin.value = window.location;
         if (form.task_id) {
           form.task_id.value = task_id;
         }
         form.action = $(this).data("action");
         form.submit();
       })
   ```




----------------------------------------------------------------
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]


Reply via email to