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

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

commit 7b9dd0b3a9524563713ed491114c9e4322f50af8
Author: Brent Bovenzi <[email protected]>
AuthorDate: Mon Jun 14 15:02:35 2021 -0500

    add num_runs query param for tree refresh (#16437)
    
    - add `num_runs` as a meta field to add to the tree refresh request
    
    (cherry picked from commit 6087a09f89c7da4aac47eab3756a7fe24e3b602b)
---
 airflow/www/static/js/tree.js           | 3 ++-
 airflow/www/templates/airflow/tree.html | 5 +++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/airflow/www/static/js/tree.js b/airflow/www/static/js/tree.js
index cc8276d..882d7ce5 100644
--- a/airflow/www/static/js/tree.js
+++ b/airflow/www/static/js/tree.js
@@ -28,6 +28,7 @@ import getMetaValue from './meta_value';
 // dagId comes from dag.html
 const dagId = getMetaValue('dag_id');
 const treeDataUrl = getMetaValue('tree_data');
+const numRuns = getMetaValue('num_runs');
 
 function toDateString(ts) {
   const dt = new Date(ts * 1000);
@@ -412,7 +413,7 @@ document.addEventListener('DOMContentLoaded', () => {
 
   function handleRefresh() {
     $('#loading-dots').css('display', 'inline-block');
-    $.get(`${treeDataUrl}?dag_id=${dagId}`)
+    $.get(`${treeDataUrl}?dag_id=${dagId}&num_runs=${numRuns}`)
       .done(
         (runs) => {
           const newData = {
diff --git a/airflow/www/templates/airflow/tree.html 
b/airflow/www/templates/airflow/tree.html
index acc68dd..34c4ae7 100644
--- a/airflow/www/templates/airflow/tree.html
+++ b/airflow/www/templates/airflow/tree.html
@@ -33,6 +33,11 @@
   </style>
 {% endblock %}
 
+{% block head_meta %}
+  {{ super() }}
+  <meta name="num_runs" content="{{ num_runs }}">
+{% endblock %}
+
 {% block content %}
   {{ super() }}
   <div class="row dag-view-tools">

Reply via email to