From 711fa7944439974482fddf64a69313fb9330fea8 Mon Sep 17 00:00:00 2001 From: Dicken Date: Sat, 18 Jul 2026 15:18:59 +0200 Subject: [PATCH] fix: Logs kuerzt lange Link-Pfade (zeigt nur das Ende), antippen kopiert kompletten Link --- frontend/src/App.jsx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index e96f32f..5acfc1b 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -3208,6 +3208,19 @@ function PushLogs({ toast }) { const [filter, setFilter] = useState(''); const [typeFilter, setTypeFilter] = useState('alle'); + const truncatePath = (p, keep=24) => p && p.length > keep ? `…${p.slice(-keep)}` : p; + const copyPath = async (p) => { + try { await navigator.clipboard.writeText(p); toast?.('Link kopiert'); return; } catch {} + try { + const ta = document.createElement('textarea'); + ta.value = p; ta.style.position = 'fixed'; ta.style.left = '-9999px'; + document.body.appendChild(ta); ta.focus(); ta.select(); + const ok = document.execCommand('copy'); + document.body.removeChild(ta); + toast?.(ok ? 'Link kopiert' : 'Kopieren nicht möglich', ok ? 'success' : 'error'); + } catch { toast?.('Kopieren nicht möglich','error'); } + }; + const load = () => { setLoading(true); api('/admin/logs?limit=300').then(setLogs).catch(e=>toast(e.message,'error')).finally(()=>setLoading(false)); @@ -3271,8 +3284,10 @@ function PushLogs({ toast }) { {fmtDate(l.created_at)} -
- {l.path} +
copyPath(window.location.origin + l.path)} title={`${window.location.origin}${l.path} — antippen zum Kopieren`} + style={{ color:'rgba(255,255,255,0.85)', fontFamily:'monospace', fontSize:12, marginBottom:4, + cursor:'pointer', overflow:'hidden', textOverflow:'ellipsis', whiteSpace:'nowrap' }}> + 📋 {truncatePath(l.path)}