Dateien nach "frontend/src" hochladen
This commit is contained in:
@@ -948,7 +948,7 @@ function AdminPanel({ toast, mobile, user }) {
|
||||
<h1 style={{ color:'#fff', fontFamily:"'Space Mono',monospace", fontSize:mobile?17:22, marginBottom:16 }}>Einstellungen</h1>
|
||||
|
||||
<div style={{ display:'flex', gap:6, marginBottom:18, flexWrap:'wrap' }}>
|
||||
{[['profil','Profil'], ...(user?.role==='admin'?[['benutzer','Benutzer'],['backup','Backup']]:[])]
|
||||
{[['profil','Profil'],['dashboard','Dashboard'], ...(user?.role==='admin'?[['benutzer','Benutzer'],['backup','Backup']]:[])]
|
||||
.map(([k,l]) => (
|
||||
<button key={k} onClick={()=>setSection(k)} style={{
|
||||
padding:'6px 16px', borderRadius:20, fontFamily:'monospace', fontSize:12, cursor:'pointer',
|
||||
@@ -1010,9 +1010,6 @@ function AdminPanel({ toast, mobile, user }) {
|
||||
{busy.pw ? '…' : '✓ Passwort ändern'}
|
||||
</button>
|
||||
</Sec>
|
||||
<Sec title="KALENDER (iCal)">
|
||||
<CalendarSettings toast={toast}/>
|
||||
</Sec>
|
||||
<Sec title="ACCOUNT LÖSCHEN">
|
||||
<p style={{ color:'rgba(255,255,255,0.55)', fontSize:12, fontFamily:'monospace', marginBottom:12, lineHeight:1.6 }}>
|
||||
Löscht deinen Account und alle deine Daten unwiderruflich.
|
||||
@@ -1026,6 +1023,14 @@ function AdminPanel({ toast, mobile, user }) {
|
||||
<div><UserManagement toast={toast}/></div>
|
||||
)}
|
||||
|
||||
{section === 'dashboard' && (
|
||||
<div>
|
||||
<Sec title="KALENDER (iCal)">
|
||||
<CalendarSettings toast={toast}/>
|
||||
</Sec>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{section === 'backup' && (
|
||||
<div>
|
||||
<Sec title="DATENBANK">
|
||||
|
||||
@@ -93,7 +93,6 @@ export default function CalendarWidget() {
|
||||
const [selected, setSelected] = useState(null); // date object
|
||||
|
||||
const [errors, setErrors] = useState([]);
|
||||
const [debug, setDebug] = useState([]);
|
||||
|
||||
// Load all feeds
|
||||
const loadFeeds = async (feedList) => {
|
||||
@@ -102,33 +101,23 @@ export default function CalendarWidget() {
|
||||
setErrors([]);
|
||||
const all = [];
|
||||
const errs = [];
|
||||
const dbg = [];
|
||||
dbg.push(`Feeds: ${feedList.length}`);
|
||||
for (const f of feedList) {
|
||||
try {
|
||||
dbg.push(`Lade: ${f.name} (${f.url.slice(0,50)}…)`);
|
||||
const res = await fetch(`/api/calendar/fetch?url=${encodeURIComponent(f.url)}`, {
|
||||
headers: { Authorization: `Bearer ${localStorage.getItem('sk_token')}` }
|
||||
});
|
||||
dbg.push(`HTTP: ${res.status}`);
|
||||
if (res.ok) {
|
||||
const text = await res.text();
|
||||
dbg.push(`Bytes: ${text.length}, VCALENDAR: ${text.includes('BEGIN:VCALENDAR')}, VEVENTs: ${(text.match(/BEGIN:VEVENT/g)||[]).length}`);
|
||||
dbg.push(`Inhalt (erste 200 Zeichen): ${text.slice(0,200).replace(/\n/g,' ')}`);
|
||||
const evs = parseIcal(text).map(e => ({ ...e, color: f.color, feedName: f.name }));
|
||||
dbg.push(`Geparst: ${evs.length} Termine`);
|
||||
if (evs.length > 0) dbg.push(`Erstes: ${evs[0].summary} @ ${evs[0].dtstart}`);
|
||||
all.push(...evs);
|
||||
} else {
|
||||
const d = await res.json().catch(()=>({error:'Unbekannter Fehler'}));
|
||||
errs.push(`${f.name}: ${d.error}`);
|
||||
dbg.push(`Fehler: ${d.error}`);
|
||||
}
|
||||
} catch(e) { errs.push(`${f.name}: ${e.message}`); dbg.push(`Exception: ${e.message}`); }
|
||||
} catch(e) { errs.push(`${f.name}: ${e.message}`); }
|
||||
}
|
||||
setEvents(all);
|
||||
setErrors(errs);
|
||||
setDebug(dbg);
|
||||
setLoading(false);
|
||||
};
|
||||
|
||||
@@ -270,16 +259,7 @@ export default function CalendarWidget() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Debug Panel */}
|
||||
{debug.length > 0 && (
|
||||
<div style={{ marginTop:10, background:'rgba(0,0,0,0.4)', borderRadius:8,
|
||||
padding:'8px 10px', border:'1px solid rgba(255,255,255,0.08)' }}>
|
||||
<div style={{ color:'rgba(255,255,255,0.3)', fontFamily:'monospace', fontSize:9, marginBottom:4 }}>DEBUG</div>
|
||||
{debug.map((d,i) => (
|
||||
<div key={i} style={{ color:'rgba(255,255,255,0.55)', fontFamily:'monospace', fontSize:10, lineHeight:1.6 }}>{d}</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user