takahe/templates/activities/debug_json.html

87 lines
3.2 KiB
HTML
Raw Normal View History

2022-12-24 13:56:33 +00:00
{% extends "base_plain.html" %}
2022-12-18 18:00:21 +00: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 08:19:00 +00:00
2023-01-09 16:58:17 +00: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 18:05:07 +00:00
2023-01-09 16:58:17 +00:00
<div class="field">
<span class="name">Content-Type:</span>
<span class="value">{{ content_type }}</span>
</div>
2022-12-24 18:05:07 +00:00
2023-01-09 16:58:17 +00:00
<div class="field">
<span class="name">Bytes Downloaded:</span>
<span class="value">{{ num_bytes_downloaded }}</span>
</div>
2022-12-24 18:05:07 +00:00
</div>
2023-01-09 16:58:17 +00:00
<h2>Payload</h2>
2022-12-24 18:05:07 +00:00
2023-01-09 16:58:17 +00:00
<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
2022-12-24 18:05:07 +00:00
toggle .hidden on #raw_response
then
2023-01-09 16:58:17 +00:00
if my.innerText is 'Hide' set my.innerText to 'Show'
else set my.innerText to 'Hide'
2022-12-24 18:05:07 +00:00
">Show</a></span>
2023-01-09 16:58:17 +00:00
</div>
2023-05-06 06:30:59 +00:00
<pre id="raw_response" class="hidden">{{ raw_result }}</pre>
2022-12-24 18:05:07 +00:00
2023-01-09 16:58:17 +00:00
<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
2022-12-24 18:05:07 +00:00
toggle .hidden on #canonical_response
then
2023-01-09 16:58:17 +00:00
if my.innerText is 'Hide' set my.innerText to 'Show'
else set my.innerText to 'Hide'
2022-12-24 18:05:07 +00:00
">Show</a></span>
2023-01-09 16:58:17 +00:00
</div>
<pre id="canonical_response" class="hidden">{{ result }}</pre>
2022-12-24 18:05:07 +00:00
</div>
2022-12-20 08:19:00 +00:00
</div>
2022-12-18 18:00:21 +00:00
{% endif %}
2022-12-24 18:05:07 +00:00
2022-12-18 18:00:21 +00:00
{% endblock %}