Show old owner data for orphaned keyfobs
All checks were successful
ci/woodpecker/manual/woodpecker Pipeline was successful

This commit is contained in:
Madis Mägi 2023-09-13 11:14:41 +03:00
parent 5b3e284f1b
commit a4b92f8008
2 changed files with 28 additions and 11 deletions

View File

@ -237,7 +237,9 @@ def view_doorboy_admin():
"$push" : {"$mergeObjects": [ "$push" : {"$mergeObjects": [
"$token", "$token",
{"last_seen": "$last_seen"}, {"last_seen": "$last_seen"},
{"_id": "$_id"} {"_id": "$_id"},
{"old_display_name": "$inventory.owner.display_name"},
{"old_foreign_id": "$inventory.owner.foreign_id"}
]} ]}
} }
} }

View File

@ -45,16 +45,31 @@
{{orphaned_keyfobs | length}} {{orphaned_keyfobs | length}}
</div> </div>
</div> </div>
<ul class="collapsible-body collection collapsible-collection"> <div class="collapsible-body collapsible-collection">
{% for c in orphaned_keyfobs %} <table>
<li class="collection-item"> <thead>
{{c.comment or "unnamed"}} <tr>
<div class="secondary-content"> <th>Comment</th>
<a href="/m/doorboy/{{ c._id }}/events">{{ c.uid_hash[-6:] }}</a> <th>Hash tail</th>
</div> <th>Old ownership info</th>
</li> </tr>
{% endfor %} </thead>
</ul> <tbody>
{% for c in orphaned_keyfobs %}
<tr>
<td>{{c.comment or "unnamed"}}</td>
<td><a href="/m/doorboy/{{ c._id }}/events">{{ c.uid_hash[-6:] }}</a></td>
<td>
{{c.old_display_name}}
{% if c.old_foreign_id %}
({{c.old_foreign_id}})
{% endif %}
</td>
</tr>
{% endfor %}
<tbody>
</table>
</div>
</li> </li>
</ul> </ul>