update icon

This commit is contained in:
ervin committed 2026-07-07 19:26:30 +02:00
1 parent c7fa91c8ce
commit 3072bb5099
7 files changed
+1530 -3

No files matched your search

+2
View File
@@ -11,8 +11,10 @@
"socket.io-client": "^4.8.1"
},
"devDependencies": {
"@iconify-json/tabler": "^1.2.35",
"@tailwindcss/vite": "^4.1.3",
"tailwindcss": "^4.1.3",
"unplugin-icons": "^23.0.1",
"vite": "^6.2.3"
}
}
+1272
View File
File diff suppressed because it is too large. Load diff
+2 -1
View File
@@ -1,5 +1,6 @@
// Részletes nézet panel - egy webhook kérés összes adata tabokba szervezve
import { formatTimestamp, methodColor } from '../utils/formatters.js';
import { icon } from '../utils/icon.js';
// Részletes panel komponens létrehozása
// onClose: callback a panel bezárásakor
@@ -9,7 +10,7 @@ export function createRequestDetail(onClose) {
panel.innerHTML = `
<div id="detail-empty" class="flex-1 flex items-center justify-center text-gray-600">
<div class="text-center">
<div class="text-3xl mb-2">👆</div>
<div class="text-3xl mb-2 flex justify-center">${icon('hand-click', 'w-18 h-18 text-gray-500')}</div>
<p>Kattints egy sorra a részletekhez</p>
</div>
</div>
+2 -1
View File
@@ -1,5 +1,6 @@
// Webhook kérések táblázata - valós időben frissülő lista
import { formatRelativeTime, formatTimestamp, methodColor, truncatePayload } from '../utils/formatters.js';
import { icon } from '../utils/icon.js';
// Maximum ennyi sort tartunk a táblázatban memóriakímélés miatt
const MAX_ROWS = 100;
@@ -29,7 +30,7 @@ export function createRequestTable(onRowClick) {
</tbody>
</table>
<div id="empty-state" class="py-16 text-center text-gray-600">
<div class="text-4xl mb-3">📡</div>
<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>
<p class="text-sm mt-1">Küldd el a webhook URL-t, és a kérések itt jelennek meg</p>
</div>
+41
View File
@@ -0,0 +1,41 @@
// Tabler ikon helper - unplugin-icons ?raw importok köré.
// Csak a ténylegesen importált ikonok kerülnek a bundle-be.
//
// Új ikon felvétele:
// 1. import IconValami from '~icons/tabler/valami?raw';
// 2. vedd fel a REG mapbe: 'valami': IconValami
// 3. használat: icon('valami', 'w-5 h-5 text-red-500')
//
// Minden Tabler ikon currentColor-t használ → szín Tailwind text-* osztállyal,
// méret w-*/h-* osztállyal (a beépített width/height attribútumot leszedjük).
import IconTrash from '~icons/tabler/trash?raw';
import IconCopy from '~icons/tabler/copy?raw';
import IconHandClick from '~icons/tabler/hand-click?raw';
import IconNetwork from '~icons/tabler/network?raw';
// Regisztrált ikonok: név -> nyers SVG string
const REG = {
trash: IconTrash,
copy: IconCopy,
'hand-click': IconHandClick,
'network': IconNetwork,
};
/**
* SVG string egy regisztrált Tabler ikonhoz, a megadott CSS osztályokkal.
* @param {string} name - ikonnév, pl. 'trash'
* @param {string} className - CSS osztályok (méret/szín), pl. 'w-5 h-5 text-red-500'
* @returns {string} beszúrható SVG markup
*/
export function icon(name, className = 'w-5 h-5') {
const raw = REG[name];
if (!raw) {
console.warn(`[icon] Nem regisztrált ikon: ${name} (vedd fel az icon.js REG mapbe)`);
return `<svg class="${className}" viewBox="0 0 24 24"></svg>`;
}
// Fix width/height attribútum leszedése (Tailwind méret nyerjen), majd class beszúrása
return raw
.replace(/\s(width|height)="[^"]*"/g, '')
.replace('<svg', `<svg class="${className}" aria-hidden="true"`);
}
+5 -1
View File
@@ -1,11 +1,15 @@
// Vite build konfiguráció
import { defineConfig } from 'vite';
import tailwindcss from '@tailwindcss/vite';
import Icons from 'unplugin-icons/vite';
export default defineConfig({
plugins: [
// Tailwind CSS Vite plugin - natív integráció, nem kell postcss
tailwindcss()
tailwindcss(),
// Ikonok: ~icons/tabler/<név> import, csak a használtak kerülnek a bundle-be.
// compiler 'raw' -> nyers SVG string (vanilla JS-hez, innerHTML-be illeszthető)
Icons({ compiler: 'raw' })
],
build: {