This commit is contained in:
ervin committed 2026-07-07 19:49:39 +02:00
1 parent 5cc0d52bb3
commit 66cd208b61
4 files changed
+74 -11

No files matched your search

+43 -4
View File
@@ -11,7 +11,11 @@ export function renderHome(container) {
<header class="border-b border-slate-800/70 bg-slate-900/40 backdrop-blur px-6 py-4">
<div class="max-w-4xl mx-auto flex items-center gap-3">
<span class="text-2xl font-bold text-white tracking-tight">webhook<span class="text-transparent bg-clip-text bg-linear-to-r from-cyan-400 to-teal-400">.hu</span></span>
<span class="text-slate-500 text-sm">Webhook fogadó és megjelenítő</span>
<span class="inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider bg-red-400/10 text-red-300 border border-red-400/25">
<span class="w-1.5 h-1.5 rounded-full bg-red-400 animate-pulse"></span>
Béta
</span>
<span class="text-slate-500 text-sm hidden sm:inline">Webhook fogadó és megjelenítő</span>
</div>
</header>
@@ -21,9 +25,33 @@ export function renderHome(container) {
<h1 class="text-4xl font-bold text-white mb-3 tracking-tight">
Teszteld a webhook integrációdat
</h1>
<p class="text-slate-400 text-lg mb-8">
<p class="text-slate-400 text-lg">
Generálj egyedi URL-t és nézd valós időben a beérkező HTTP kéréseket
</p>
<!-- Adatvédelmi / béta infó kártya -->
<div class="rounded-2xl border border-slate-800 bg-slate-900/40 p-6 sm:p-7 my-4">
<div class="flex items-start gap-4">
<!-- Pajzs ikon -->
<div class="shrink-0 flex items-center justify-center w-11 h-11 rounded-xl bg-cyan-400/10 border border-cyan-400/20 text-cyan-300">
<svg xmlns="http://www.w3.org/2000/svg" class="w-6 h-6" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
<path d="m9 12 2 2 4-4"/>
</svg>
</div>
<div class="min-w-0">
<h3 class="text-white font-semibold mb-1.5 flex items-center gap-2">
Béta &amp; adatvédelem
</h3>
<p class="text-slate-400 text-sm leading-relaxed">
Ez a szolgáltatás jelenleg <span class="text-cyan-300 font-medium">bétában</span> fut — előfordulhatnak hibák és változások.
A beérkező kéréseket <span class="text-slate-200 font-medium">nem tároljuk</span>: az adatok kizárólag a valós időben
<span class="text-slate-200 font-medium">feliratkozott, épp figyelő klienseknek</span> jutnak el, majd nyomtalanul eltűnnek.
Kérjük, <span class="text-slate-200 font-medium">ne küldj érzékeny adatot</span> (jelszó, token, személyes információ) a webhookodra — csak teszteléshez használd.
</p>
</div>
</div>
</div>
<button
id="create-btn"
class="inline-flex items-center gap-2 px-6 py-3 bg-linear-to-r from-cyan-500 to-teal-500 hover:from-cyan-400 hover:to-teal-400 text-slate-950 font-semibold rounded-xl transition-all duration-200 text-lg shadow-lg shadow-cyan-500/25"
@@ -34,11 +62,17 @@ export function renderHome(container) {
</div>
<!-- History szekció -->
<div id="history-section" class="hidden">
<div id="history-section" class="hidden mb-12">
<h2 class="text-slate-500 text-sm font-medium uppercase tracking-wider mb-4">Korábbi webhook URL-ek</h2>
<div id="history-list" class="grid gap-3"></div>
</div>
</main>
<!-- Lábléc -->
<footer class="max-w-4xl mx-auto w-full px-6 py-6 text-center text-slate-600 text-xs">
webhook<span class="text-slate-500">.hu</span> · ingyenes webhook teszter · béta
</footer>
</div>
`;
@@ -55,12 +89,17 @@ export function renderHome(container) {
try {
const res = await fetch('/api/create', { method: 'POST' });
// Rate limit túllépés - a szerver üzenetét jelenítjük meg
if (res.status === 429) {
const data = await res.json().catch(() => ({}));
throw new Error(data.error || 'Túl sok webhook létrehozása. Próbáld újra később.');
}
if (!res.ok) throw new Error('Szerver hiba');
const { uuid } = await res.json();
// Átirányítás a viewer nézetre
window.location.hash = `#/view/${uuid}`;
} catch (err) {
showToast('Hiba a webhook létrehozásakor. Próbáld újra!', 'error');
showToast(err.message || 'Hiba a webhook létrehozásakor. Próbáld újra!', 'error');
createBtn.disabled = false;
createBtnIcon.textContent = '+';
createBtnText.textContent = 'Új webhook létrehozása';