Skip to content

Commit

Permalink
add num_runs query param for tree refresh (#16437)
Browse files Browse the repository at this point in the history
- add `num_runs` as a meta field to add to the tree refresh request
  • Loading branch information
bbovenzi committed Jun 14, 2021
1 parent 5c86e3d commit 6087a09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion airflow/www/static/js/tree.js
Expand Up @@ -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);
Expand Down Expand Up @@ -418,7 +419,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 = {
Expand Down
5 changes: 5 additions & 0 deletions airflow/www/templates/airflow/tree.html
Expand Up @@ -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">
Expand Down

0 comments on commit 6087a09

Please sign in to comment.