Add HTML templates for all tools
Some checks failed
CI / test (3.10) (push) Has been cancelled
CI / test (3.11) (push) Has been cancelled
CI / test (3.12) (push) Has been cancelled
CI / test (3.8) (push) Has been cancelled
CI / test (3.9) (push) Has been cancelled
CI / lint (push) Has been cancelled
CI / typecheck (push) Has been cancelled
CI / build-package (push) Has been cancelled

This commit is contained in:
2026-01-29 11:13:22 +00:00
parent 7ca4f4d935
commit b1dfa0b734

108
devterm/templates/jwt.html Normal file
View File

@@ -0,0 +1,108 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JWT Decoder - Devterm</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
min-height: 100vh;
color: #fff;
}
.container { max-width: 1200px; margin: 0 auto; padding: 2rem; }
header {
display: flex;
align-items: center;
gap: 1rem;
padding-bottom: 1rem;
border-bottom: 1px solid rgba(255,255,255,0.1);
margin-bottom: 2rem;
}
h1 { font-size: 1.5rem; background: linear-gradient(90deg, #00d4ff, #7c3aed); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.back-link { color: #94a3b8; text-decoration: none; }
.back-link:hover { color: #00d4ff; }
.panel { background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; overflow: hidden; margin-bottom: 1.5rem; }
.panel-header { padding: 1rem; border-bottom: 1px solid rgba(255,255,255,0.1); font-weight: 600; }
textarea {
width: 100%;
height: 120px;
background: transparent;
border: none;
color: #e2e8f0;
padding: 1rem;
font-family: 'Monaco', 'Menlo', monospace;
font-size: 14px;
resize: none;
}
textarea:focus { outline: none; }
.actions { display: flex; gap: 1rem; margin: 1.5rem 0; }
button {
background: linear-gradient(90deg, #00d4ff, #7c3aed);
border: none;
color: white;
padding: 0.75rem 1.5rem;
border-radius: 8px;
cursor: pointer;
font-weight: 600;
transition: opacity 0.2s;
}
button:hover { opacity: 0.9; }
.result { padding: 1rem; color: #94a3b8; font-size: 0.9rem; min-height: 60px; }
.error { color: #ef4444; }
pre { background: rgba(0,0,0,0.3); padding: 1rem; overflow-x: auto; margin: 0; }
code { font-family: 'Monaco', 'Menlo', monospace; font-size: 13px; }
</style>
</head>
<body>
<div class="container">
<header>
<a href="/" class="back-link"></a>
<h1>JWT Decoder</h1>
</header>
<div class="panel">
<div class="panel-header">JWT Token</div>
<textarea id="token" placeholder="Paste your JWT token here..."></textarea>
</div>
<div class="actions">
<button onclick="decodeJwt()">Decode</button>
<button onclick="clearAll()">Clear</button>
</div>
<div class="panel">
<div class="panel-header">Decoded Header</div>
<pre><code id="header">-</code></pre>
</div>
<div class="panel">
<div class="panel-header">Decoded Payload</div>
<pre><code id="payload">-</code></pre>
</div>
<div class="panel">
<div class="panel-header">Signature</div>
<pre><code id="signature">-</code></pre>
</div>
</div>
<script>
async function decodeJwt() {
const token = document.getElementById('token').value;
if (!token.trim()) return;
const res = await fetch('/jwt/decode', { method: 'POST', body: token });
const data = await res.json();
if (data.error) {
alert('Error: ' + data.error);
} else {
document.getElementById('header').textContent = JSON.stringify(data.header, null, 2);
document.getElementById('payload').textContent = JSON.stringify(data.payload, null, 2);
document.getElementById('signature').textContent = data.signature;
}
}
function clearAll() {
document.getElementById('token').value = '';
document.getElementById('header').textContent = '-';
document.getElementById('payload').textContent = '-';
document.getElementById('signature').textContent = '-';
}
</script>
</body>
</html>