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 dc267217875d2acc0d981a32651607242f8aacd2
Author: Felipe Lolas <[email protected]>
AuthorDate: Mon May 24 16:22:14 2021 -0400

    Fix auto-refresh in tree view When webserver ui is not in ``/`` (#16018)
    
    Co-authored-by: Felipe Lolas <[email protected]>
    
    Obtain tree_data object endpoint from meta.
    closes: #16017
    
    (cherry picked from commit c288957939ad534eb968a90a34b92dd3a009ddb3)
---
 airflow/www/static/js/tree.js          | 3 ++-
 airflow/www/templates/airflow/dag.html | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/airflow/www/static/js/tree.js b/airflow/www/static/js/tree.js
index 1c443cd..04702a7 100644
--- a/airflow/www/static/js/tree.js
+++ b/airflow/www/static/js/tree.js
@@ -27,6 +27,7 @@ import getMetaValue from './meta_value';
 
 // dagId comes from dag.html
 const dagId = getMetaValue('dag_id');
+const treeDataUrl = getMetaValue('tree_data');
 
 function toDateString(ts) {
   const dt = new Date(ts * 1000);
@@ -409,7 +410,7 @@ document.addEventListener('DOMContentLoaded', () => {
 
   function handleRefresh() {
     $('#loading-dots').css('display', 'inline-block');
-    $.get(`/object/tree_data?dag_id=${dagId}`)
+    $.get(`${treeDataUrl}?dag_id=${dagId}`)
       .done(
         (runs) => {
           const newData = {
diff --git a/airflow/www/templates/airflow/dag.html 
b/airflow/www/templates/airflow/dag.html
index 94d926a..171b4a9 100644
--- a/airflow/www/templates/airflow/dag.html
+++ b/airflow/www/templates/airflow/dag.html
@@ -35,6 +35,7 @@
   <meta name="external_log_url" content="{{ 
url_for('Airflow.redirect_to_external_log') }}">
   <meta name="extra_links_url" content="{{ url_for('Airflow.extra_links') }}">
   <meta name="paused_url" content="{{ url_for('Airflow.paused') }}">
+  <meta name="tree_data" content="{{ url_for('Airflow.tree_data') }}">
   {% if show_external_log_redirect is defined %}
     <meta name="show_external_log_redirect" content="{{ 
show_external_log_redirect }}">
   {% endif %}

Reply via email to