Dateien nach "frontend/src/tools" hochladen

This commit is contained in:
2026-05-28 08:08:36 +02:00
parent 166b3be251
commit 2e9bbeeece

View File

@@ -4,7 +4,7 @@ import { useConfirm } from '../confirm.jsx';
import { UploadIcon, DownloadIcon, TrashIcon, SearchIcon, ChevronIcon } from '../icons.jsx'; import { UploadIcon, DownloadIcon, TrashIcon, SearchIcon, ChevronIcon } from '../icons.jsx';
const fmtSize = b => b<1024?`${b} B`:b<1024*1024?`${(b/1024).toFixed(1)} KB`:`${(b/(1024*1024)).toFixed(1)} MB`; const fmtSize = b => b<1024?`${b} B`:b<1024*1024?`${(b/1024).toFixed(1)} KB`:`${(b/(1024*1024)).toFixed(1)} MB`;
const fmtDate = s => new Date(s).toLocaleDateString('de-DE',{day:'2-digit',month:'2-digit',year:'numeric'}); const fmtDate = s => { if (!s) return ''; const d = new Date(String(s).replace(' ','T')); return isNaN(d)?'':d.toLocaleDateString('de-DE',{day:'2-digit',month:'2-digit',year:'numeric'}); };
const extIcon = name => { const extIcon = name => {
const e = name.split('.').pop().toLowerCase(); const e = name.split('.').pop().toLowerCase();
if (['jpg','jpeg','png','gif','webp'].includes(e)) return '🖼'; if (['jpg','jpeg','png','gif','webp'].includes(e)) return '🖼';
@@ -385,7 +385,10 @@ export default function Dateien({ toast, mobile }) {
<span style={{fontSize:22,flexShrink:0}}>{extIcon(file.originalname)}</span> <span style={{fontSize:22,flexShrink:0}}>{extIcon(file.originalname)}</span>
<div style={{flex:1,minWidth:0}}> <div style={{flex:1,minWidth:0}}>
<div style={{color:'#fff',fontFamily:'monospace',fontSize:13,fontWeight:700, <div style={{color:'#fff',fontFamily:'monospace',fontSize:13,fontWeight:700,
overflow:'hidden',textOverflow:'ellipsis',whiteSpace:'nowrap'}}>{file.originalname}</div> overflow:'hidden',textOverflow:'ellipsis',whiteSpace:'nowrap',display:'flex',alignItems:'center',gap:5}}>
<span style={{overflow:'hidden',textOverflow:'ellipsis',whiteSpace:'nowrap'}}>{file.originalname}</span>
{file.has_password ? <span title="Passwortgeschützt" style={{fontSize:11,flexShrink:0}}>🔒</span> : null}
</div>
<div style={{color:'rgba(255,255,255,0.45)',fontFamily:'monospace',fontSize:10,marginTop:2}}> <div style={{color:'rgba(255,255,255,0.45)',fontFamily:'monospace',fontSize:10,marginTop:2}}>
{fmtSize(file.size)} · {fmtDate(file.created_at)} {fmtSize(file.size)} · {fmtDate(file.created_at)}
{tab==='shared'?` · von ${file.owner}`:''} {tab==='shared'?` · von ${file.owner}`:''}