reversed actions for see the better the traceability log

This commit is contained in:
Cayo Puigdefabregas 2022-02-02 13:27:53 +01:00
parent 9a68ad7ab8
commit 8149d0ed7c
2 changed files with 5 additions and 1 deletions

View File

@ -164,6 +164,10 @@ class Device(Thing):
super().__init__(**kw)
self.set_hid()
@property
def reverse_actions(self) -> list:
return reversed(self.actions)
@property
def actions(self) -> list:
"""All the actions where the device participated, including:

View File

@ -109,7 +109,7 @@
<div class="tab-pane fade profile-overview" id="traceability">
<h5 class="card-title">Traceability log Details</h5>
<div class="list-group col-6">
{% for action in device.actions %}
{% for action in device.reverse_actions %}
<div class="list-group-item d-flex justify-content-between align-items-center">
{{ action.type }} {{ action.severity }}
<small class="text-muted">{{ action.created.strftime('%H:%M %d-%m-%Y') }}</small>