fix: Logs kuerzt lange Link-Pfade (zeigt nur das Ende), antippen kopiert kompletten Link

This commit is contained in:
2026-07-18 15:18:59 +02:00
parent ff04886986
commit 711fa79444

View File

@@ -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)}
</span>
</div>
<div style={{ color:'rgba(255,255,255,0.85)', fontFamily:'monospace', fontSize:12, marginBottom:4 }}>
{l.path}
<div onClick={()=>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)}
</div>
<div style={{ display:'flex', gap:12, flexWrap:'wrap' }}>
<span style={{ color:'rgba(255,255,255,0.5)', fontFamily:'monospace', fontSize:10 }}>