mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Add markdown rendering for log mesages
This commit is contained in:
@ -269,7 +269,7 @@ def run_script(script, data, commit=True):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
stacktrace = traceback.format_exc()
|
stacktrace = traceback.format_exc()
|
||||||
script.log_failure(
|
script.log_failure(
|
||||||
"An exception occurred. {}: {}\n```{}```".format(type(e).__name__, e, stacktrace)
|
"An exception occurred: `{}: {}`\n```\n{}\n```".format(type(e).__name__, e, stacktrace)
|
||||||
)
|
)
|
||||||
commit = False
|
commit = False
|
||||||
finally:
|
finally:
|
||||||
|
@ -529,6 +529,9 @@ table.report th a {
|
|||||||
border-top: 1px solid #dddddd;
|
border-top: 1px solid #dddddd;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
}
|
}
|
||||||
|
.rendered-markdown :last-child {
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* AJAX loader */
|
/* AJAX loader */
|
||||||
.loading {
|
.loading {
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td>{{ forloop.counter }}</td>
|
<td>{{ forloop.counter }}</td>
|
||||||
<td>{% log_level level %}</td>
|
<td>{% log_level level %}</td>
|
||||||
<td>{{ message }}</td>
|
<td class="rendered-markdown">{{ message|gfm }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{% empty %}
|
{% empty %}
|
||||||
<tr>
|
<tr>
|
||||||
|
Reference in New Issue
Block a user