mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-17 21:18:16 -06:00
Record a timestamp with script logs
This commit is contained in:
parent
da5eb0bb62
commit
e7f24b7e9c
@ -459,6 +459,7 @@ class BaseScript:
|
|||||||
|
|
||||||
# Record to the script's log
|
# Record to the script's log
|
||||||
self.messages.append({
|
self.messages.append({
|
||||||
|
'time': timezone.now().isoformat(),
|
||||||
'status': level,
|
'status': level,
|
||||||
'message': str(message),
|
'message': str(message),
|
||||||
})
|
})
|
||||||
|
@ -22,12 +22,14 @@
|
|||||||
<table class="table table-hover panel-body">
|
<table class="table table-hover panel-body">
|
||||||
<tr>
|
<tr>
|
||||||
<th>{% trans "Line" %}</th>
|
<th>{% trans "Line" %}</th>
|
||||||
|
<th>{% trans "Time" %}</th>
|
||||||
<th>{% trans "Level" %}</th>
|
<th>{% trans "Level" %}</th>
|
||||||
<th>{% trans "Message" %}</th>
|
<th>{% trans "Message" %}</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for log in job.data.log %}
|
{% for log in job.data.log %}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ forloop.counter }}</td>
|
<td>{{ forloop.counter }}</td>
|
||||||
|
<td>{{ log.time|placeholder }}</td>
|
||||||
<td>{% log_level log.status %}</td>
|
<td>{% log_level log.status %}</td>
|
||||||
<td class="rendered-markdown">{{ log.message|markdown }}</td>
|
<td class="rendered-markdown">{{ log.message|markdown }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
Loading…
Reference in New Issue
Block a user