Skip to content

Commit

Permalink
Fix auto-refresh in tree view When webserver ui is not in / (apac…
Browse files Browse the repository at this point in the history
…he#16018)

Co-authored-by: Felipe Lolas <felipe.lolas@bci.cl>

Obtain tree_data object endpoint from meta.
closes: apache#16017

(cherry picked from commit c288957)
  • Loading branch information
flolas authored and jhtimmins committed Jun 3, 2021
1 parent 8dcbdcd commit 79c99e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion airflow/www/static/js/tree.js
Expand Up @@ -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);
Expand Down Expand Up @@ -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 = {
Expand Down
1 change: 1 addition & 0 deletions airflow/www/templates/airflow/dag.html
Expand Up @@ -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 %}
Expand Down

0 comments on commit 79c99e9

Please sign in to comment.