Skip to content

Commit

Permalink
feat: Open node file when clicking on it
Browse files Browse the repository at this point in the history
Fix #68
  • Loading branch information
haidaraM committed Aug 4, 2021
1 parent 549d44d commit 6b76861
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ansibleplaybookgrapher/grapher.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ def _graph_task(self, task: Task, loop_counter: int, task_vars: Dict, graph: Cus
task_id = generate_id(id_prefix)
edge_id = generate_id("edge_")

graph.node(task_id, label=task_name, shape="octagon", id=task_id, tooltip=task_name)
# the task path is something like this: ${absolute_path_to_the_file}:${task_line_number}
task_path = task.get_path().split(":")[0]
graph.node(task_id, label=task_name, shape="octagon", id=task_id, tooltip=task_name, URL=task_path)
graph.edge(parent_node_name, task_id, label=task_edge_label, color=color, fontcolor=color, style="bold",
id=edge_id)
self.graph_representation.add_link(parent_node_id, edge_id)
Expand Down

0 comments on commit 6b76861

Please sign in to comment.