Files
WinnieAPI-v2/public/tools/uuid.html
T
2026-05-01 20:02:13 +02:00

38 lines
2.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- ═══════════════ UUID ═══════════════ -->
<div class="page" id="page-uuid">
<button class="back-btn" onclick="showPage('home')">← Back to Tools</button>
<div class="section-header">
<h2><i class="fas fa-hashtag" style="color:var(--accent)"></i> UUID Generator</h2>
<p>Generate random v4 UUIDs.</p>
</div>
<div style="max-width:640px;">
<div style="display:flex;gap:10px;align-items:center;margin-bottom:16px;">
<label style="font-size:0.85rem;color:var(--text-secondary);">Count:</label>
<input type="number" id="uuidCount" value="5" min="1" max="100" style="width:80px;" />
<button class="btn btn-primary" onclick="generateUUIDs()"><i class="fas fa-dice"></i> Generate</button>
<button class="btn btn-green" onclick="copyUUIDs()"><i class="fas fa-copy"></i> Copy All</button>
</div>
<div id="uuidResults" style="font-family:var(--font-mono);font-size:0.85rem;"></div>
<div class="api-usage">
<button class="api-usage-toggle" onclick="toggleApiUsage(this)"><span><i class="fas fa-terminal"></i> API Usage <span class="badge">REST</span></span><i class="fas fa-chevron-down"></i></button>
<div class="api-usage-body">
<div class="api-baseurl-note">All examples use <code>BASE_URL</code> — set it to your deployment URL.</div>
<div class="api-endpoint">
<span class="api-method post">POST</span><span class="api-path">/api/uuid</span>
<div class="api-desc">Generate random v4 UUIDs. Batch up to 100.</div>
<div class="api-code"><button class="api-code-copy" onclick="copyApiCode(this)">Copy</button><span class="kw">const</span> <span class="var">BASE_URL</span> = <span class="str">"http://localhost:3000"</span>;
<span class="kw">const</span> res = <span class="kw">await</span> <span class="fn">fetch</span>(<span class="var">`${BASE_URL}/api/uuid`</span>, {
method: <span class="str">"POST"</span>,
headers: { <span class="str">"Content-Type"</span>: <span class="str">"application/json"</span> },
body: JSON.<span class="fn">stringify</span>({ count: 5 }) <span class="cm">// 1100</span>
});
<span class="kw">const</span> data = <span class="kw">await</span> res.<span class="fn">json</span>();
<span class="cm">// → { success: true, uuids: ["550e8400-e29b-41d4-...", ...] }</span></div>
</div>
</div>
</div>
</div>
</div>