schimbare history in dashboard
This commit is contained in:
@@ -50,3 +50,9 @@ docker compose exec web python manage.py migrate
|
||||
docker compose exec web python manage.py import_access
|
||||
|
||||
docker compose exec web python manage.py clear_database
|
||||
|
||||
git add .
|
||||
git commit -m " -- comentariu -- "
|
||||
git push
|
||||
|
||||
git pull
|
||||
|
||||
@@ -63,7 +63,9 @@
|
||||
<span class="text-danger">șters</span>
|
||||
{% endif %}
|
||||
<br>
|
||||
<span class="text-dark">{{ record.equipment_code }}</span>
|
||||
<span class="text-dark fw-bold">
|
||||
{{ record.equipment_code|default:record.name }}
|
||||
</span>
|
||||
</li>
|
||||
{% empty %}
|
||||
<li class="list-group-item text-muted text-center py-4">Nu există acțiuni recente.</li>
|
||||
|
||||
+4
-1
@@ -568,10 +568,13 @@ def dashboard_view(request):
|
||||
pc_hist = Computer.history.all()[:10]
|
||||
mon_hist = Monitor.history.all()[:10]
|
||||
per_hist = Peripheral.history.all()[:10]
|
||||
emp_hist = Employee.history.all()[:10]
|
||||
|
||||
# Combinăm listele și le sortăm descrescător după data acțiunii (history_date)
|
||||
activity_log = sorted(
|
||||
chain(pc_hist, mon_hist, per_hist), key=attrgetter("history_date"), reverse=True
|
||||
chain(pc_hist, mon_hist, per_hist, emp_hist),
|
||||
key=attrgetter("history_date"),
|
||||
reverse=True,
|
||||
)[
|
||||
:10
|
||||
] # Păstrăm doar ultimele 10 cele mai recente acțiuni în total
|
||||
|
||||
Reference in New Issue
Block a user