Node js runtime adds logs as an array of arrays, whilst python stores it as an array. Adjust logs template to handle both
This commit is contained in:
@@ -60,9 +60,13 @@ history_url=url_for('http.history', function_id=function_id)) }}
|
|||||||
|
|
||||||
<!-- Logs -->
|
<!-- Logs -->
|
||||||
<div class="bg-gray-50 rounded-lg p-3 overflow-auto max-h-40">
|
<div class="bg-gray-50 rounded-lg p-3 overflow-auto max-h-40">
|
||||||
{% for log in invocation.logs %}
|
<pre class="text-sm font-mono text-gray-600 whitespace-pre-wrap">{% if invocation.logs and invocation.logs[0] is iterable and invocation.logs[0] is not string -%}
|
||||||
<div class="text-sm font-mono text-gray-600 py-0.5">{{ log[0] }}</div>
|
{{- invocation.logs | map('join', ' ') | join('\n') -}}
|
||||||
{% endfor %}
|
{%- elif invocation.logs is iterable and invocation.logs is not string -%}
|
||||||
|
{{- invocation.logs | join('\n') -}}
|
||||||
|
{%- else -%}
|
||||||
|
{{- invocation.logs | string -}}
|
||||||
|
{%- endif -%}</pre>
|
||||||
{% if not invocation.logs %}
|
{% if not invocation.logs %}
|
||||||
<div class="text-sm text-gray-400 italic">No logs available</div>
|
<div class="text-sm text-gray-400 italic">No logs available</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
@@ -48,8 +48,13 @@ history_url=url_for('timer.history', function_id=function_id)) }}
|
|||||||
|
|
||||||
<!-- Logs -->
|
<!-- Logs -->
|
||||||
<div class="bg-gray-50 rounded-lg p-3 overflow-auto max-h-40">
|
<div class="bg-gray-50 rounded-lg p-3 overflow-auto max-h-40">
|
||||||
<pre
|
<pre class="text-sm font-mono text-gray-600 whitespace-pre-wrap">{% if invocation.logs and invocation.logs[0] is iterable and invocation.logs[0] is not string -%}
|
||||||
class="text-sm font-mono text-gray-600 whitespace-pre-wrap">{{ (invocation.logs | map('first')) | join('\n') }}</pre>
|
{{- invocation.logs | map('join', ' ') | join('\n') -}}
|
||||||
|
{%- elif invocation.logs is iterable and invocation.logs is not string -%}
|
||||||
|
{{- invocation.logs | join('\n') -}}
|
||||||
|
{%- else -%}
|
||||||
|
{{- invocation.logs | string -}}
|
||||||
|
{%- endif -%}</pre>
|
||||||
{% if not invocation.logs %}
|
{% if not invocation.logs %}
|
||||||
<div class="text-sm text-gray-400 italic">No logs available</div>
|
<div class="text-sm text-gray-400 italic">No logs available</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in New Issue
Block a user