feat: KoePi Admin-Button zum Neu-Aufloesen der Filial-Whitelist
This commit is contained in:
@@ -183,6 +183,18 @@ export default function Koepi({ toast }) {
|
|||||||
finally { setCronRunning(false); }
|
finally { setCronRunning(false); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const [resolvingStores, setResolvingStores] = useState(false);
|
||||||
|
const resolveStores = async () => {
|
||||||
|
setResolvingStores(true);
|
||||||
|
try {
|
||||||
|
const r = await api('/tools/koepi/local-stores/resolve', { method:'POST', body:{} });
|
||||||
|
toast(`🏪 Filial-Liste: ${r.resolved} von ${r.total} aufgelöst`);
|
||||||
|
setOffers(null); setProspekte(null);
|
||||||
|
setTimeout(() => { if (tab==='angebote') loadOffers(true); else loadProspekte(true); }, 100);
|
||||||
|
} catch(e) { toast?.(e.message||'Fehler','error'); }
|
||||||
|
finally { setResolvingStores(false); }
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div style={{ maxWidth:700, margin:'0 auto' }}>
|
<div style={{ maxWidth:700, margin:'0 auto' }}>
|
||||||
{/* Header */}
|
{/* Header */}
|
||||||
@@ -196,13 +208,16 @@ export default function Koepi({ toast }) {
|
|||||||
<button onClick={testDailyCheck} disabled={cronRunning} style={{ ...S.btn('#f59e0b',true), fontSize:10, opacity:cronRunning?0.5:1 }}>
|
<button onClick={testDailyCheck} disabled={cronRunning} style={{ ...S.btn('#f59e0b',true), fontSize:10, opacity:cronRunning?0.5:1 }}>
|
||||||
{cronRunning ? '⏳ läuft…' : '🔔 Cron testen'}
|
{cronRunning ? '⏳ läuft…' : '🔔 Cron testen'}
|
||||||
</button>
|
</button>
|
||||||
|
<button onClick={resolveStores} disabled={resolvingStores} style={{ ...S.btn('#4ecdc4',true), fontSize:10, opacity:resolvingStores?0.5:1 }}>
|
||||||
|
{resolvingStores ? '⏳ läuft…' : '🏪 Filial-Liste neu auflösen'}
|
||||||
|
</button>
|
||||||
<button onClick={clearCache} style={{ ...S.btn('#666666',true), fontSize:10 }}>🗑 Cache leeren</button>
|
<button onClick={clearCache} style={{ ...S.btn('#666666',true), fontSize:10 }}>🗑 Cache leeren</button>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style={{ color:'rgba(255,255,255,0.3)', fontFamily:'monospace', fontSize:10, marginBottom:14 }}>
|
<div style={{ color:'rgba(255,255,255,0.3)', fontFamily:'monospace', fontSize:10, marginBottom:14 }}>
|
||||||
Raum Duisburg 47259 · EDEKA · REWE · Netto · Kaufland · Penny · Trinkgut · Cache 1h
|
Raum Duisburg 47259 · EDEKA · REWE · Netto · Kaufland · Penny · Trinkgut · Lidl · ALDI Süd · HORNBACH · Cache 1h
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Tabs */}
|
{/* Tabs */}
|
||||||
|
|||||||
Reference in New Issue
Block a user