takahe/templates/activities/debug_json.html

92 lines
3.0 KiB
HTML
Raw Normal View History

2022-12-24 05:56:33 -08:00
{% extends "base_plain.html" %}
2022-12-18 10:00:21 -08:00
{% block title %}Debug JSON{% endblock %}
{% block body_class %}no-sidebar{% endblock %}
{% block content %}
<form action="." method="POST">
{% csrf_token %}
<fieldset>
{% include "forms/_field.html" with field=form.uri %}
</fieldset>
<div class="buttons">
<button>Debug</button>
</div>
</form>
{% if result %}
2022-12-20 00:19:00 -08:00
2022-12-24 10:05:07 -08:00
<div class="debug">
<h2>Summary</h2>
<div class="debug-section">
<div class="field">
<span class="name">Status Code:</span>
<span class="value">{{ status_code }}</span>
</div>
<div class="field">
<span class="name">Content-Type:</span>
<span class="value">{{ content_type }}</span>
</div>
<div class="field">
<span class="name">Bytes Downloaded:</span>
<span class="value">{{ num_bytes_downloaded }}</span>
</div>
</div>
<h2>Payload</h2>
<div class="debug-section">
<div class="field payload">
<span class="name">Raw Response:
<a title="Copy Content"
class="copy"
_="on click
writeText(#raw_response.innerText) into the navigator's clipboard
then add .copied
wait 2s
then remove .copied">
<i class="fa-solid fa-copy"></i>
</a>
</span>
<span class="value">
<a _="on click
toggle .hidden on #raw_response
then
if my.innerText is 'Hide' set my.innerText to 'Show'
else set my.innerText to 'Hide'
">Show</a></span>
</div>
<div id="raw_response" class="hidden">
2022-12-20 00:19:00 -08:00
{{ raw_result|escape }}
2022-12-24 10:05:07 -08:00
</div>
<div class="field payload">
<span class="name">Canonical:
<a title="Copy Content"
class="copy"
_="on click
writeText(#canonical_response.innerText) into the navigator's clipboard
then add .copied
wait 2s
then remove .copied">
<i class="fa-solid fa-copy"></i>
</a>
</span>
<span class="value">
<a _="on click
toggle .hidden on #canonical_response
then
if my.innerText is 'Hide' set my.innerText to 'Show'
else set my.innerText to 'Hide'
">Show</a></span>
</div>
<pre id="canonical_response" class="hidden">{{ result }}</pre>
2022-12-20 00:19:00 -08:00
</div>
2022-12-24 10:05:07 -08:00
</div>
2022-12-18 10:00:21 -08:00
{% endif %}
2022-12-24 10:05:07 -08:00
2022-12-18 10:00:21 -08:00
{% endblock %}