{% from "leeuwenhoek/_macros.html" import status_tag, duration, time_ago, json_tree %} {% macro outcome(c) %}{% if c.error %}{{ c.error['class'].split('.')[-1] }}{% else %}{{ status_tag(c.status) }}{% endif %}{% endmacro %} {% macro head() %}VerbURLStatusDurationWhen{% endmacro %} {% macro row(e) %} {{ e.content.method }} {{ e.content.url | lw_truncate(90) }} {{ outcome(e.content) }} {{ duration(e.content.duration_ms) }} {{ time_ago(e.created_at) }} {% endmacro %} {% macro summary(e) %}{{ e.content.method }} {{ e.content.url | lw_truncate(90) }} {{ outcome(e.content) }} {{ duration(e.content.duration_ms) }}{% endmacro %} {% macro detail(e) %} {% set c = e.content %}

Method

{{ c.method }}

Status

{{ outcome(c) }}

Duration

{{ c.duration_ms | lw_duration }}

Host

{{ c.host or '—' }}

Client

{{ c.library }}

{{ c.url }} {%- if c.redirects %}
{{ c.redirects }} redirect{{ 's' if c.redirects > 1 }} → {{ c.final_url }}{% endif %}

{% if c.error %}
{{ c.error['class'] }}: {{ c.error.message }}
{% endif %}
{{ json_tree(c.payload, true) if c.payload is not none else 'No payload' }}
{% endmacro %}