-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add: Tests for automation history view
Add: Support for Split/Join in history view
- Loading branch information
Showing
9 changed files
with
172 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,24 @@ | ||
{% extends "automations/base.html" %}{% load i18n %} | ||
{% block content_automations %}{% spaceless %} | ||
<h1> | ||
{{ automation.get_automation_class.get_verbose_name }}<br> | ||
<small>{{ automation.automation_class }}</small> | ||
</h1> | ||
<div class="row"> | ||
<div class="col-8"> | ||
{% include "automations/includes/history.html" with blocks=blocks %} | ||
</div> | ||
<div class="col-4"> | ||
<div class="card"> | ||
<h2 class="card-header">{% trans "Automation info" %} {{ automation.id }}</h2> | ||
<ul class="list-group list-group-flush"> | ||
<li class="list-group-item">{% trans "Updated:" %} {{ automation.updated }}</li> | ||
<li class="list-group-item">{% trans "Paused until:" %} {{ automation.paused_until }}</li> | ||
<li class="list-group-item">{% trans "Created:" %} {{ automation.created }}</li> | ||
</ul> | ||
<div class="card-body"> | ||
<h3 class="h4">{% trans "Data" %}</h3> | ||
<pre>{{ automation.data }}</pre> | ||
</div> | ||
<div class="card mb-4"> | ||
<h1 class="card-header"> | ||
{{ automation.get_automation_class.get_verbose_name }} | ||
<small>{{ automation.automation_class }}</small> | ||
</h1> | ||
<ul class="list-group list-group-flush"> | ||
<li class="list-group-item">{% trans "Automation id" %} {{ automation.id }}</li> | ||
<li class="list-group-item">{% trans "Updated:" %} {{ automation.updated }}</li> | ||
<li class="list-group-item">{% trans "Paused until:" %} {{ automation.paused_until }}</li> | ||
<li class="list-group-item">{% trans "Created:" %} {{ automation.created }}</li> | ||
</ul> | ||
{% if automation.data %} | ||
<div class="card-body"> | ||
<h3 class="h4">{% trans "Data" %}</h3> | ||
<pre>{{ automation.data }}</pre> | ||
</div> | ||
</div> | ||
{% endif %} | ||
</div> | ||
{% include "automations/includes/history.html" with tasks=tasks %} | ||
</div> | ||
{% endspaceless %} | ||
{% endblock %} |
23 changes: 14 additions & 9 deletions
23
src/automations/templates/automations/includes/history.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
<div class="row"> | ||
{% for block in blocks %} | ||
<div class="col"> | ||
{% if block.children %} | ||
{% include "automations/includes/history.html" with blocks=block.children %} | ||
{% endif %} | ||
{% include "automations/includes/history_item.html" with task=block.task %} | ||
</div> | ||
{% spaceless %} | ||
{% for task in tasks reversed %} | ||
{% if task|length > 1 %} | ||
<div class="row align-items-center row-cols-{{ task|length }}"> | ||
{% for sub_tree in task %} | ||
<div class="col"> | ||
{% include "automations/includes/history.html" with tasks=sub_tree %} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% else %} | ||
{% include "automations/includes/history_item.html" with task=task %} | ||
{% endif %} | ||
{% endfor %} | ||
</div> | ||
{% endspaceless %} |
4 changes: 2 additions & 2 deletions
4
src/automations/templates/automations/includes/history_item.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{% load i18n %}{% spaceless %} | ||
<div class="card mb-3"> | ||
<h4 class="card-header{% if "Error" in task.message %} bg-danger{% elif "OK" in task.message %} bg-success{% endif %}">{{ task.status }} = flow.{{ task.get_node.node_name }}() | ||
<h4 class="card-header{% if "Error" in task.message %} bg-danger{% elif "OK" in task.message %} bg-success{% else %} bg-warning{% endif %}">{{ task.status }} = flow.{{ task.get_node.node_name }}() | ||
<small>{% if task.finished %}{{ task.finished }}{% else %}{% trans "running" %}{% endif %}</small></h4> | ||
{% if task.message == "OK" %}<pre class="card-body mb-0">{{ task.result }}</pre>{% endif %} | ||
{% if task.message == "OK" and task.result %}<pre class="card-body mb-0">{{ task.result }}</pre>{% endif %} | ||
{% if "Error" in task.message %}<div class="card-footer"><a href="{% url "traceback" automation.id task.id %}"></a></div>{% endif %} | ||
</div> | ||
{% endspaceless %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{# only for testing #} | ||
{% block content %} | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.