Feature: ORS-Wochenlimit (20/Woche), Tages-Cache, Privilegien-Bypass, Datenschutz-Update — SW by-v480, APP_VER 457

This commit is contained in:
rene 2026-04-29 08:23:55 +02:00
parent ca8bb495b0
commit 7048499624
8 changed files with 121 additions and 14 deletions

View file

@ -490,11 +490,21 @@ window.Page_routes = (() => {
});
_suggestResult = result;
} catch (err) {
const is429 = err.status === 429 || String(err.message).includes('Wochenlimit');
if (res) res.innerHTML = `
<div style="padding:var(--space-4);border-radius:var(--radius-lg);
background:rgba(220,38,38,0.08);border:1px solid rgba(220,38,38,0.25);
color:#f87171;font-size:0.9rem">
${UI.icon('warning')} ${UI.escape(err.message || 'Fehler beim Berechnen des Rundwegs.')}
<div style="padding:var(--space-5);border-radius:var(--radius-lg);
background:${is429 ? 'rgba(234,179,8,0.08)' : 'rgba(220,38,38,0.08)'};
border:1px solid ${is429 ? 'rgba(234,179,8,0.3)' : 'rgba(220,38,38,0.25)'};
color:${is429 ? '#facc15' : '#f87171'};text-align:center">
<svg class="ph-icon" style="width:28px;height:28px;margin-bottom:var(--space-3)" aria-hidden="true">
<use href="/icons/phosphor.svg#${is429 ? 'calendar-x' : 'warning'}"></use>
</svg>
<p style="margin:0;font-size:var(--text-sm);font-weight:var(--weight-semibold)">
${is429 ? 'Wochenlimit erreicht' : 'Fehler beim Berechnen'}
</p>
<p style="margin:var(--space-2) 0 0;font-size:var(--text-xs);opacity:0.85">
${is429 ? 'Du hast diese Woche alle 20 Routenvorschläge genutzt. Montag gibt es neue.' : UI.escape(err.message || 'Unbekannter Fehler')}
</p>
</div>`;
if (calcBtn) calcBtn.disabled = false;
return;
@ -515,8 +525,14 @@ window.Page_routes = (() => {
: '';
const diffLabel = { leicht: 'Leicht', mittel: 'Mittel', anspruchsvoll: 'Schwer' }[result.schwierigkeit] || '';
const limitHint = (result.weekly_remaining != null)
? `<p style="font-size:var(--text-xs);color:var(--c-text-muted);text-align:right;margin:0 0 var(--space-2)">
Noch ${result.weekly_remaining} von 20 Anfragen diese Woche
</p>`
: '';
res.innerHTML = `
<div id="rks-map" style="height:250px;background:var(--c-surface);margin-bottom:var(--space-3)"></div>
${limitHint}<div id="rks-map" style="height:250px;background:var(--c-surface);margin-bottom:var(--space-3)"></div>
<div style="display:flex;gap:var(--space-3);align-items:center;flex-wrap:wrap;margin-bottom:var(--space-4)">
<span style="${_pillStyle('rgba(107,114,128,0.10)','#9ca3af','rgba(107,114,128,0.30)')}">
${UI.icon('map-trifold')} ${UI.escape(distStr)}