uj stílus

This commit is contained in:
ervin committed 2026-07-07 19:35:28 +02:00
1 parent 3072bb5099
commit 5cc0d52bb3
6 files changed
+91 -83

No files matched your search

+29 -21
View File
@@ -17,21 +17,21 @@ export function createRequestTable(onRowClick) {
wrapper.innerHTML = `
<table class="w-full text-sm">
<thead>
<tr class="text-left text-gray-500 border-b border-gray-800">
<th class="pb-3 pr-4 font-medium whitespace-nowrap">Időpont</th>
<th class="pb-3 pr-4 font-medium">Metódus</th>
<th class="pb-3 pr-4 font-medium">IP cím</th>
<th class="pb-3 pr-4 font-medium hidden md:table-cell">Payload</th>
<th class="pb-3 pr-4 font-medium text-center hidden sm:table-cell">GET</th>
<th class="pb-3 font-medium text-center hidden sm:table-cell">POST</th>
<tr class="text-left text-slate-500 border-b border-slate-800">
<th class="pb-3 pl-3 pr-4 font-medium whitespace-nowrap text-xs uppercase tracking-wider">Időpont</th>
<th class="pb-3 pr-4 font-medium text-xs uppercase tracking-wider">Metódus</th>
<th class="pb-3 pr-4 font-medium text-xs uppercase tracking-wider">IP cím</th>
<th class="pb-3 pr-4 font-medium hidden md:table-cell text-xs uppercase tracking-wider">Payload</th>
<th class="pb-3 pr-4 font-medium text-center hidden sm:table-cell text-xs uppercase tracking-wider">GET</th>
<th class="pb-3 font-medium text-center hidden sm:table-cell text-xs uppercase tracking-wider">POST</th>
</tr>
</thead>
<tbody id="request-tbody" class="divide-y divide-gray-800/50">
<tbody id="request-tbody" class="divide-y divide-slate-800/60">
</tbody>
</table>
<div id="empty-state" class="py-16 text-center text-gray-600">
<div class="text-4xl mb-3 flex justify-center">${icon('network', 'w-18 h-18 text-gray-500')}</div>
<p class="text-lg font-medium text-gray-500">Várakozás a webhook hívásokra…</p>
<div id="empty-state" class="py-16 text-center text-slate-600">
<div class="text-4xl mb-3 flex justify-center">${icon('network', 'w-18 h-18 text-slate-600')}</div>
<p class="text-lg font-medium text-slate-400">Várakozás a webhook hívásokra…</p>
<p class="text-sm mt-1">Küldd el a webhook URL-t, és a kérések itt jelennek meg</p>
</div>
`;
@@ -52,39 +52,47 @@ export function createRequestTable(onRowClick) {
const tr = document.createElement('tr');
tr.dataset.id = data.id;
tr.className = 'cursor-pointer hover:bg-gray-800/40 transition-colors duration-150 group';
// Bal oldali átlátszó accent sáv alapból, hogy kijelöléskor ne ugorjon a layout
tr.className = 'cursor-pointer border-l-2 border-transparent hover:bg-slate-800/40 transition-colors duration-150 group';
tr.innerHTML = `
<td class="py-3 pr-4 whitespace-nowrap">
<td class="py-3 pl-3 pr-4 whitespace-nowrap">
<span
class="text-gray-400 group-hover:text-gray-200 transition-colors"
class="text-slate-400 group-hover:text-slate-100 transition-colors"
data-timestamp="${data.timestamp}"
title="${formatTimestamp(data.timestamp)}"
>${formatRelativeTime(data.timestamp)}</span>
</td>
<td class="py-3 pr-4">
<span class="inline-block px-2 py-0.5 rounded border text-xs font-bold ${methodColor(data.method)}">
<span class="inline-block px-2 py-0.5 rounded-md border text-xs font-bold ${methodColor(data.method)}">
${data.method}
</span>
</td>
<td class="py-3 pr-4 text-gray-400 font-mono text-xs whitespace-nowrap">${data.remoteIp}</td>
<td class="py-3 pr-4 text-gray-500 hidden md:table-cell max-w-xs truncate">
<td class="py-3 pr-4 text-slate-400 font-mono text-xs whitespace-nowrap">${data.remoteIp}</td>
<td class="py-3 pr-4 text-slate-500 hidden md:table-cell max-w-xs truncate">
${truncatePayload(data.rawPayload)}
</td>
<td class="py-3 pr-4 text-center hidden sm:table-cell">
${data.queryCount > 0 ? `<span class="text-blue-400 font-medium">${data.queryCount}</span>` : '<span class="text-gray-700">—</span>'}
${data.queryCount > 0 ? `<span class="text-cyan-300 font-semibold">${data.queryCount}</span>` : '<span class="text-slate-700">—</span>'}
</td>
<td class="py-3 text-center hidden sm:table-cell">
${data.bodyCount > 0 ? `<span class="text-green-400 font-medium">${data.bodyCount}</span>` : '<span class="text-gray-700">—</span>'}
${data.bodyCount > 0 ? `<span class="text-emerald-300 font-semibold">${data.bodyCount}</span>` : '<span class="text-slate-700">—</span>'}
</td>
`;
// Kijelölést jelző osztályok (gradiens háttér + cyan accent sáv)
const selectedClasses = ['bg-linear-to-r', 'from-cyan-500/15', 'to-transparent', 'border-cyan-400'];
// Sor kattintás esemény
tr.addEventListener('click', () => {
// Előző kijelölés törlése
tbody.querySelectorAll('tr').forEach(r => r.classList.remove('bg-indigo-900/20', 'border-l-2', 'border-indigo-500'));
tbody.querySelectorAll('tr').forEach(r => {
r.classList.remove(...selectedClasses);
r.classList.add('border-transparent');
});
// Új kijelölés
tr.classList.add('bg-indigo-900/20', 'border-l-2', 'border-indigo-500');
tr.classList.remove('border-transparent');
tr.classList.add(...selectedClasses);
selectedId = data.id;
onRowClick(data);
});