You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ep...@apache.org on 2023/01/11 21:26:07 UTC

[airflow] 26/27: Nest header blocks in divs to fix dagid copy nit on dag.html (#28643)

This is an automated email from the ASF dual-hosted git repository.

ephraimanierobi pushed a commit to branch v2-5-test
in repository https://gitbox.apache.org/repos/asf/airflow.git

commit 4ec5bdab53042c7e00fa571488fa1a4cb0a97ddc
Author: Victor Chiapaikeo <vc...@gmail.com>
AuthorDate: Wed Jan 4 16:19:28 2023 -0500

    Nest header blocks in divs to fix dagid copy nit on dag.html (#28643)
    
    (cherry picked from commit 9aea857343c231319df4c5f47e8b4d9c8c3975e6)
---
 airflow/www/templates/airflow/dag.html | 132 +++++++++++++++++----------------
 1 file changed, 68 insertions(+), 64 deletions(-)

diff --git a/airflow/www/templates/airflow/dag.html b/airflow/www/templates/airflow/dag.html
index e6da97e68d..9fc7d516c0 100644
--- a/airflow/www/templates/airflow/dag.html
+++ b/airflow/www/templates/airflow/dag.html
@@ -102,74 +102,78 @@
   {% endif %}
 
   <div>
-    <h3 class="pull-left">
-      {% if dag.parent_dag is defined and dag.parent_dag %}
-        <span class="text-muted">SUBDAG:</span> {{ dag.dag_id }}
-      {% else %}
-        {% set can_edit = appbuilder.sm.can_edit_dag(dag.dag_id) %}
-        {% if appbuilder.sm.can_edit_dag(dag.dag_id) %}
-          {% set switch_tooltip = 'Pause/Unpause DAG' %}
+    <div>
+      <h3 class="pull-left">
+        {% if dag.parent_dag is defined and dag.parent_dag %}
+          <span class="text-muted">SUBDAG:</span> {{ dag.dag_id }}
         {% else %}
-          {% set switch_tooltip = 'DAG is Paused' if dag_is_paused else 'DAG is Active' %}
+          {% set can_edit = appbuilder.sm.can_edit_dag(dag.dag_id) %}
+          {% if appbuilder.sm.can_edit_dag(dag.dag_id) %}
+            {% set switch_tooltip = 'Pause/Unpause DAG' %}
+          {% else %}
+            {% set switch_tooltip = 'DAG is Paused' if dag_is_paused else 'DAG is Active' %}
+          {% endif %}
+          <label class="switch-label{{' disabled' if not can_edit else ''  }} js-tooltip" title="{{ switch_tooltip }}">
+            <input class="switch-input" id="pause_resume" data-dag-id="{{ dag.dag_id }}"
+                   type="checkbox"{{ " checked" if not dag_is_paused else "" }}
+                   {{ " disabled" if not can_edit else "" }}>
+            <span class="switch" aria-hidden="true"></span>
+          </label>
+          <span class="text-muted">DAG:</span> {{ dag.dag_id }}
+          <small class="text-muted">{{ dag.description[0:150] + '…' if dag.description and dag.description|length > 150 else dag.description|default('', true) }}</small>
+        {% endif %}
+        {% if root %}
+          <span class="text-muted">ROOT:</span> {{ root }}
+        {% endif %}
+      </h3>
+    </div>
+    <div>
+      <h4 class="pull-right js-dataset-triggered" style="user-select: none;-moz-user-select: auto;">
+        {% if state_token is defined and state_token %}
+          {{ state_token }}
+        {% endif %}
+        <a class="label label-default" href="{{ url_for('DagRunModelView.list') }}?_flt_3_dag_id={{ dag.dag_id }}">
+          Schedule: {{ dag_model is defined and dag_model and dag_model.schedule_interval }}
+        </a>
+        {% if dag_model is defined and dag_model and dag_model.timetable_description %}
+            <span class="material-icons text-muted js-tooltip" aria-hidden="true" data-original-title="Schedule: {{ dag_model.timetable_description|string }}">info</span>
         {% endif %}
-        <label class="switch-label{{' disabled' if not can_edit else ''  }} js-tooltip" title="{{ switch_tooltip }}">
-          <input class="switch-input" id="pause_resume" data-dag-id="{{ dag.dag_id }}"
-                 type="checkbox"{{ " checked" if not dag_is_paused else "" }}
-                 {{ " disabled" if not can_edit else "" }}>
-          <span class="switch" aria-hidden="true"></span>
-        </label>
-        <span class="text-muted">DAG:</span> {{ dag.dag_id }}
-        <small class="text-muted">{{ dag.description[0:150] + '…' if dag.description and dag.description|length > 150 else dag.description|default('', true) }}</small>
-      {% endif %}
-      {% if root %}
-        <span class="text-muted">ROOT:</span> {{ root }}
-      {% endif %}
-    </h3>
-    <h4 class="pull-right js-dataset-triggered" style="user-select: none;-moz-user-select: auto;">
-      {% if state_token is defined and state_token %}
-        {{ state_token }}
-      {% endif %}
-      <a class="label label-default" href="{{ url_for('DagRunModelView.list') }}?_flt_3_dag_id={{ dag.dag_id }}">
-        Schedule: {{ dag_model is defined and dag_model and dag_model.schedule_interval }}
-      </a>
-      {% if dag_model is defined and dag_model and dag_model.timetable_description %}
-          <span class="material-icons text-muted js-tooltip" aria-hidden="true" data-original-title="Schedule: {{ dag_model.timetable_description|string }}">info</span>
-      {% endif %}
-      {% if dag_model is defined and dag_model.next_dagrun is defined and dag_model.schedule_interval != 'Dataset' %}
-        <p class="label label-default js-tooltip" style="margin-left: 5px" id="next-run" data-html="true" data-placement="bottom">
-          Next Run: <time datetime="{{ dag_model.next_dagrun }}">{{ dag_model.next_dagrun }}</time>
-        </p>
-      {% endif %}
-      {% if dag_model is defined and dag_model.schedule_interval is defined and dag_model.schedule_interval == 'Dataset' %}
-        {%- with ds_info = dag_model.get_dataset_triggered_next_run_info() -%}
-          <span
-            id="next-dataset-tooltip"
-            class="js-tooltip"
-            title="Click to see dataset details."
-            data-html="true"
-            data-placement="bottom"
-            data-uri="{{ ds_info.uri }}"
-          >
-              <p
-                class="label label-default next-dataset-triggered"
-                style="margin-left: 5px;"
-                data-summary="
-                  {%- if ds_info.total == 1 -%}
-                  On {{ ds_info.uri }}
+        {% if dag_model is defined and dag_model.next_dagrun is defined and dag_model.schedule_interval != 'Dataset' %}
+          <p class="label label-default js-tooltip" style="margin-left: 5px" id="next-run" data-html="true" data-placement="bottom">
+            Next Run: <time datetime="{{ dag_model.next_dagrun }}">{{ dag_model.next_dagrun }}</time>
+          </p>
+        {% endif %}
+        {% if dag_model is defined and dag_model.schedule_interval is defined and dag_model.schedule_interval == 'Dataset' %}
+          {%- with ds_info = dag_model.get_dataset_triggered_next_run_info() -%}
+            <span
+              id="next-dataset-tooltip"
+              class="js-tooltip"
+              title="Click to see dataset details."
+              data-html="true"
+              data-placement="bottom"
+              data-uri="{{ ds_info.uri }}"
+            >
+                <p
+                  class="label label-default next-dataset-triggered"
+                  style="margin-left: 5px;"
+                  data-summary="
+                    {%- if ds_info.total == 1 -%}
+                    On {{ ds_info.uri }}
+                    {%- else -%}
+                    {{ ds_info.ready }} of {{ ds_info.total }} datasets updated
+                    {%- endif -%}"
+                  >
+                  {% if ds_info.total == 1 -%}
+                    On {{ ds_info.uri }}
                   {%- else -%}
                   {{ ds_info.ready }} of {{ ds_info.total }} datasets updated
-                  {%- endif -%}"
-                >
-                {% if ds_info.total == 1 -%}
-                  On {{ ds_info.uri }}
-                {%- else -%}
-                {{ ds_info.ready }} of {{ ds_info.total }} datasets updated
-                {%- endif %}
-              </p>
-          </span>
-        {%- endwith -%}
-      {% endif %}
-    </h4>
+                  {%- endif %}
+                </p>
+            </span>
+          {%- endwith -%}
+        {% endif %}
+      </h4>
+    </div>
   </div>
   <div class="clearfix"></div>
   <br>