You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by ry...@apache.org on 2020/12/19 15:57:20 UTC
[airflow] branch master updated: Display alternative tooltip when a
Task has yet to run (no TI) (#13162)
This is an automated email from the ASF dual-hosted git repository.
ryanahamilton pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/master by this push:
new 4ad1acc Display alternative tooltip when a Task has yet to run (no TI) (#13162)
4ad1acc is described below
commit 4ad1accd3f6600ff398500e03c35eda8e3a6ec4a
Author: Ryan Hamilton <ry...@ryanahamilton.com>
AuthorDate: Sat Dec 19 10:56:01 2020 -0500
Display alternative tooltip when a Task has yet to run (no TI) (#13162)
---
airflow/www/static/js/task-instances.js | 13 +++++++++++++
airflow/www/templates/airflow/graph.html | 3 +++
2 files changed, 16 insertions(+)
diff --git a/airflow/www/static/js/task-instances.js b/airflow/www/static/js/task-instances.js
index bc42063..1f71fa1 100644
--- a/airflow/www/static/js/task-instances.js
+++ b/airflow/www/static/js/task-instances.js
@@ -98,4 +98,17 @@ export default function tiTooltip(ti, { includeTryNumber = false } = {}) {
return tt;
}
+export function taskNoInstanceTooltip(taskId, task) {
+ let tt = '';
+ if (taskId) {
+ tt += `Task_id: ${escapeHtml(taskId)}<br>`;
+ }
+ if (task.task_type !== undefined) {
+ tt += `Operator: ${escapeHtml(task.task_type)}<br>`;
+ }
+ tt += '<br><em>DAG has yet to run.</em>';
+ return tt;
+}
+
window.tiTooltip = tiTooltip;
+window.taskNoInstanceTooltip = taskNoInstanceTooltip;
diff --git a/airflow/www/templates/airflow/graph.html b/airflow/www/templates/airflow/graph.html
index 096935e..844ce38 100644
--- a/airflow/www/templates/airflow/graph.html
+++ b/airflow/www/templates/airflow/graph.html
@@ -562,6 +562,9 @@
} else if(task_group_tips.has(task_id)) {
const tt = group_tooltip(task_id, tis)
taskTip.show(tt, evt.target);
+ } else if (task_id in tasks) {
+ const tt = taskNoInstanceTooltip(task_id, tasks[task_id]);
+ taskTip.show(tt, evt.target)
}
};
elem.onmouseout = taskTip.hide;