@@ -93,14 +93,28 @@ <h3 class="mt-4 mb-4">{% trans "Log" %}</h3>
93
93
< ul class ="list-group mb-3 ">
94
94
{% for log in device_logs %}
95
95
< li class ="list-group-item ">
96
- < div class ="d-flex w-100 justify-content-between ">
96
+ < div class ="d-flex w-100 justify-content-start ">
97
97
< small class ="text-muted "> {{ log.timestamp|naturaltime }}</ small >
98
98
<!-- Display log level with badge using the mapping -->
99
99
{% with badge_class=level_badge_map|get:log.level %}
100
100
{% if badge_class %}
101
- < span class ="badge {{ badge_class }} "> {{ level_map|get:log.level }}</ span >
101
+ < span class ="badge {{ badge_class }} ms-2 ">
102
+ {% if log.level == 0 %}
103
+ < i class ="bi bi-info-circle "> </ i > {{ level_map|get:log.level|capfirst }}
104
+ {% elif log.level == 1 %}
105
+ < i class ="bi bi-info-circle "> </ i > {{ level_map|get:log.level|capfirst }}
106
+ {% elif log.level == 2 %}
107
+ < i class ="bi bi-exclamation-triangle "> </ i > {{ level_map|get:log.level|capfirst }}
108
+ {% elif log.level == 3 %}
109
+ < i class ="bi bi-exclamation-octagon "> </ i > {{ level_map|get:log.level|capfirst }}
110
+ {% elif log.level == 4 %}
111
+ < i class ="bi bi-x-octagon "> </ i > {{ level_map|get:log.level|capfirst }}
112
+ {% else %}
113
+ {{ level_map|get:log.level|default:_("unknown") }}
114
+ {% endif %}
115
+ </ span >
102
116
{% else %}
103
- < span class ="badge {{ badge_class }} "> {{ level_map|get:log.level }}</ span >
117
+ < span class ="badge bg-light text-dark "> {{ level_map|get:log.level|capfirst }}</ span >
104
118
{% endif %}
105
119
{% endwith %}
106
120
</ div >
0 commit comments