Skip to content

Commit

Permalink
[AIRFLOW-3569] Add "Trigger DAG" button in DAG page (/www only) (apac…
Browse files Browse the repository at this point in the history
…he#4373)

This is a back-ported version of the change introducted to the RBAC ui
in apache#4373.
  • Loading branch information
ashb committed Mar 5, 2019
1 parent 2da10c5 commit b012ec9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions airflow/www/templates/airflow/dag.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ <h4 class="pull-right">
Code
</a>
</li>
<li>
<a href="{{ url_for("airflow.trigger", dag_id=dag.dag_id, origin="/tree?dag_id="+dag.dag_id) }}"
onclick="return confirmTriggerDag('{{ dag.safe_dag_id }}')">
<span class="glyphicon glyphicon-play-circle" aria-hidden="true"></span>
Trigger DAG
</a>
</li>
<li>
<a href="{{ url_for("airflow.refresh", dag_id=dag.dag_id) }}" title="Refresh">
<span class="glyphicon glyphicon-refresh" aria-hidden="true"></span>
Expand Down Expand Up @@ -330,6 +337,10 @@ <h4 class="modal-title" id="dagModalLabel">
$("#dagModal").css("margin-top","0px");
}

function confirmTriggerDag(dag_id){
return confirm("Are you sure you want to run '"+dag_id+"' now?");
}

function confirmDeleteDag(dag_id){
return confirm("Are you sure you want to delete '"+dag_id+"' now?\n\
This option will delete ALL metadata, DAG runs, etc.\n\
Expand Down

0 comments on commit b012ec9

Please sign in to comment.