3D-Stats Höhe fix, Dateilimits zu Benutzer-Tab, Gesamtlimit statt Anzahl

This commit is contained in:
2026-05-28 12:34:12 +02:00
parent 903b6d204f
commit ab752d7c93
3 changed files with 26 additions and 22 deletions

View File

@@ -284,15 +284,15 @@ export default function Dateien({ toast, mobile }) {
border:'1px solid rgba(255,255,255,0.06)',borderRadius:8}}>
<div style={{display:'flex',justifyContent:'space-between',alignItems:'center',
color:'rgba(255,255,255,0.45)',fontFamily:'monospace',fontSize:10}}>
<span>{fmtSize(storage.used)} belegt · {storage.count}/{storage.maxCount} Dateien</span>
<span style={{fontSize:9,color:'rgba(255,255,255,0.25)'}}>max. {storage.maxSizeMb} MB pro Datei</span>
<span>{fmtSize(storage.used)} / {storage.totalLimitMb} MB belegt</span>
<span style={{fontSize:9,color:'rgba(255,255,255,0.25)'}}>max. {storage.maxSizeMb} MB pro Datei · {storage.count} Dateien</span>
</div>
<div style={{height:3,borderRadius:3,background:'rgba(255,255,255,0.06)',overflow:'hidden',marginTop:7}}>
<div style={{
height:'100%', borderRadius:3,
width:`${Math.min(100,(storage.count/storage.maxCount)*100)}%`,
background: storage.count/storage.maxCount > 0.85 ? '#ff6b9d' :
storage.count/storage.maxCount > 0.6 ? '#ffe66d' : '#4ecdc4',
width:`${Math.min(100,(storage.used/(storage.totalLimitMb*1024*1024))*100)}%`,
background: storage.used/(storage.totalLimitMb*1024*1024) > 0.85 ? '#ff6b9d' :
storage.used/(storage.totalLimitMb*1024*1024) > 0.6 ? '#ffe66d' : '#4ecdc4',
transition:'width 0.4s',
}}/>
</div>
@@ -509,9 +509,9 @@ export default function Dateien({ toast, mobile }) {
// ── Datei-Einstellungen (Admin) ───────────────────────────────────────────────
export function DateiSettings({ toast }) {
const [s, setS] = useState({file_max_size_mb:'50',file_max_count:'20',file_allowed_ext:'.pdf,.jpg,.jpeg,.png,.gif,.zip,.txt,.docx,.xlsx,.mp4,.stl,.3mf'});
const [s, setS] = useState({file_max_size_mb:'50',file_total_size_mb:'500',file_allowed_ext:'.pdf,.jpg,.jpeg,.png,.gif,.zip,.txt,.docx,.xlsx,.mp4,.stl,.3mf'});
const [busy, setBusy] = useState(false);
useEffect(()=>{api('/tools/dateien/settings').then(setS).catch(()=>{});},[]);
useEffect(()=>{api('/tools/dateien/settings').then(d=>setS(prev=>({...prev,...d}))).catch(()=>{});},[]);
const save = async()=>{
setBusy(true);
try{await api('/tools/dateien/settings',{method:'PUT',body:s});toast('Gespeichert ✓');}
@@ -520,12 +520,12 @@ export function DateiSettings({ toast }) {
return (
<div>
<div style={{marginBottom:10}}>
<label style={{...S.head,display:'block',marginBottom:4}}>MAX. DATEIGRÖSSE (MB)</label>
<label style={{...S.head,display:'block',marginBottom:4}}>MAX. DATEIGRÖSSE PRO UPLOAD (MB)</label>
<input type="number" value={s.file_max_size_mb} onChange={e=>setS(p=>({...p,file_max_size_mb:e.target.value}))} style={{...S.inp,fontSize:15}} min="1"/>
</div>
<div style={{marginBottom:10}}>
<label style={{...S.head,display:'block',marginBottom:4}}>MAX. DATEIEN PRO BENUTZER</label>
<input type="number" value={s.file_max_count} onChange={e=>setS(p=>({...p,file_max_count:e.target.value}))} style={{...S.inp,fontSize:15}} min="1"/>
<label style={{...S.head,display:'block',marginBottom:4}}>GESAMTLIMIT PRO BENUTZER (MB)</label>
<input type="number" value={s.file_total_size_mb} onChange={e=>setS(p=>({...p,file_total_size_mb:e.target.value}))} style={{...S.inp,fontSize:15}} min="1"/>
</div>
<div style={{marginBottom:14}}>
<label style={{...S.head,display:'block',marginBottom:4}}>ERLAUBTE ENDUNGEN (kommagetrennt)</label>