takahe/templates/activities/debug_json.html

87 lines
3.2 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 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
2023-01-09 08:58:17 -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>
2022-12-24 10:05:07 -08:00
2023-01-09 08:58:17 -08:00
<div class="field">
<span class="name">Content-Type:</span>
<span class="value">{{ content_type }}</span>
</div>
2022-12-24 10:05:07 -08:00
2023-01-09 08:58:17 -08:00
<div class="field">
<span class="name">Bytes Downloaded:</span>
<span class="value">{{ num_bytes_downloaded }}</span>
</div>
2022-12-24 10:05:07 -08:00
</div>
2023-01-09 08:58:17 -08:00
<h2>Payload</h2>
2022-12-24 10:05:07 -08:00
2023-01-09 08:58:17 -08:00
<div class="debug-section">
<div class="field payload">
<span class="name">Raw Response:
<a title="Copy Content"
2023-11-09 11:07:21 -08:00
class="copy"
_="on click
writeText(#raw_response.innerText) into the navigator's clipboard
then add .copied
wait 2s
then remove .copied">
2023-01-09 08:58:17 -08:00
<i class="fa-solid fa-copy"></i>
</a>
</span>
<span class="value">
<a _="on click
2023-11-09 11:07:21 -08:00
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>
2023-01-09 08:58:17 -08:00
</div>
2023-05-05 23:30:59 -07:00
<pre id="raw_response" class="hidden">{{ raw_result }}</pre>
2022-12-24 10:05:07 -08:00
2023-01-09 08:58:17 -08:00
<div class="field payload">
<span class="name">Canonical:
<a title="Copy Content"
2023-11-09 11:07:21 -08:00
class="copy"
_="on click
writeText(#canonical_response.innerText) into the navigator's clipboard
then add .copied
wait 2s
then remove .copied">
2023-01-09 08:58:17 -08:00
<i class="fa-solid fa-copy"></i>
</a>
</span>
<span class="value">
<a _="on click
2023-11-09 11:07:21 -08:00
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>
2023-01-09 08:58:17 -08:00
</div>
<pre id="canonical_response" class="hidden">{{ result }}</pre>
2022-12-24 10:05:07 -08:00
</div>
2022-12-20 00:19:00 -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 %}