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) super().__init__(**kw)
self.set_hid() self.set_hid()
@property
def reverse_actions(self) -> list:
return reversed(self.actions)
@property @property
def actions(self) -> list: def actions(self) -> list:
"""All the actions where the device participated, including: """All the actions where the device participated, including:

View file

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