Compare commits
No commits in common. "07db68aea2cda463a5cb2c39d2ebb75380b599f7" and "be87930e5be5a4cf422f8a261c76f4d9426e2ac8" have entirely different histories.
07db68aea2
...
be87930e5b
6 changed files with 18 additions and 28 deletions
|
|
@ -406,7 +406,7 @@ async def serve_media(path: str, request: _Request):
|
|||
raise _HE(404, "Nicht gefunden.")
|
||||
return _media_response(filepath)
|
||||
|
||||
APP_VER = "962" # muss mit APP_VER in app.js übereinstimmen
|
||||
APP_VER = "961" # muss mit APP_VER in app.js übereinstimmen
|
||||
|
||||
@app.get("/.well-known/assetlinks.json")
|
||||
async def assetlinks():
|
||||
|
|
|
|||
|
|
@ -30,23 +30,19 @@ async def public_stats():
|
|||
if _pub_cache["data"] and now - _pub_cache["ts"] < _PUB_TTL:
|
||||
return _pub_cache["data"]
|
||||
with db() as conn:
|
||||
users = conn.execute("SELECT COUNT(*) FROM users").fetchone()[0]
|
||||
dogs = conn.execute("SELECT COUNT(*) FROM dogs").fetchone()[0]
|
||||
km = conn.execute(
|
||||
users = conn.execute("SELECT COUNT(*) FROM users").fetchone()[0]
|
||||
dogs = conn.execute("SELECT COUNT(*) FROM dogs").fetchone()[0]
|
||||
km = conn.execute(
|
||||
"SELECT ROUND(COALESCE(SUM(distanz_km),0),0) FROM routes"
|
||||
).fetchone()[0]
|
||||
posts = conn.execute("SELECT COUNT(*) FROM forum_posts").fetchone()[0]
|
||||
diary = conn.execute("SELECT COUNT(*) FROM diary").fetchone()[0]
|
||||
kotbeutel = conn.execute(
|
||||
"SELECT COUNT(*) FROM user_map_pois WHERE type='kotbeutel'"
|
||||
).fetchone()[0]
|
||||
posts = conn.execute("SELECT COUNT(*) FROM forum_posts").fetchone()[0]
|
||||
diary = conn.execute("SELECT COUNT(*) FROM diary").fetchone()[0]
|
||||
data = {
|
||||
"users": users,
|
||||
"dogs": dogs,
|
||||
"km": int(km or 0),
|
||||
"forum_posts": posts,
|
||||
"diary_entries": diary,
|
||||
"kotbeutel": kotbeutel,
|
||||
}
|
||||
_pub_cache["data"] = data
|
||||
_pub_cache["ts"] = now
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Router, State-Management, Navigation, Initialisierung.
|
||||
============================================================ */
|
||||
|
||||
const APP_VER = '962'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||
const APP_VER = '961'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||
const APP_VERSION = '1.5.1'; // ← semantische Version, wird bei make release gesetzt
|
||||
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
||||
// Cache-Bust-Parameter nach Update-Reload sofort entfernen
|
||||
|
|
|
|||
|
|
@ -1342,9 +1342,8 @@ window.Worlds = (() => {
|
|||
if (mmdd === `${mt}-${dt}`) return 'tomorrow';
|
||||
return null;
|
||||
}
|
||||
const bdayDog = _dogs.find(d => _birthdayState(d.geburtstag)) || null;
|
||||
const bday = bdayDog ? _birthdayState(bdayDog.geburtstag) : null;
|
||||
const bdayYear = bdayDog?.geburtstag ? new Date().getFullYear() - parseInt(bdayDog.geburtstag.slice(0, 4)) : null;
|
||||
const bday = _birthdayState(dog.geburtstag);
|
||||
const bdayYear = dog.geburtstag ? new Date().getFullYear() - parseInt(dog.geburtstag.slice(0, 4)) : null;
|
||||
|
||||
const [streakRes, diaryRes] = await Promise.allSettled([
|
||||
_cachedGet(`streak_${dog.id}`, `/streak/${dog.id}`),
|
||||
|
|
@ -1429,8 +1428,8 @@ window.Worlds = (() => {
|
|||
</div>
|
||||
<div style="font-weight:800;font-size:var(--text-sm);color:#fff;letter-spacing:0.01em">
|
||||
${bday === 'today'
|
||||
? `Alles Gute zum ${bdayYear}. Geburtstag, ${_esc(bdayDog.name)}!`
|
||||
: `Morgen hat ${_esc(bdayDog.name)} Geburtstag!`}
|
||||
? `Alles Gute zum ${bdayYear}. Geburtstag, ${_esc(dog.name)}!`
|
||||
: `Morgen hat ${_esc(dog.name)} Geburtstag!`}
|
||||
</div>
|
||||
<div style="display:flex;gap:8px;align-items:center">
|
||||
<svg class="ph-icon bday-fw3" style="width:1rem;height:1rem;color:#e8c96e"><use href="/icons/phosphor.svg#sparkle"></use></svg>
|
||||
|
|
@ -1444,7 +1443,7 @@ window.Worlds = (() => {
|
|||
</div>` : ''}
|
||||
<div style="display:flex;align-items:center;gap:4px;font-size:10px;color:rgba(196,132,58,0.9);font-weight:700;margin-top:2px">
|
||||
<svg class="ph-icon" style="width:11px;height:11px"><use href="/icons/phosphor.svg#magic-wand"></use></svg>
|
||||
${bday === 'today' ? `Was hat sich ${_esc(bdayDog.name)} gewünscht?` : 'KI-Überraschungsideen'}
|
||||
${bday === 'today' ? 'Was hat sich Ban Yaro gewünscht?' : 'KI-Überraschungsideen'}
|
||||
</div>
|
||||
</div>
|
||||
${bday === 'today' && new Date().getHours() >= 18 ? `
|
||||
|
|
@ -1564,10 +1563,10 @@ window.Worlds = (() => {
|
|||
|
||||
try {
|
||||
const res = await API.post('/ki/geburtstag', {
|
||||
dog_id: bdayDog.id,
|
||||
name: bdayDog.name,
|
||||
rasse: bdayDog.rasse || null,
|
||||
alter: bdayDog.alter_jahre ? Math.round(bdayDog.alter_jahre) : null,
|
||||
dog_id: dog.id,
|
||||
name: dog.name,
|
||||
rasse: dog.rasse || null,
|
||||
alter: dog.alter_jahre ? Math.round(dog.alter_jahre) : null,
|
||||
mode: bdayMode,
|
||||
});
|
||||
const body = ov.querySelector('#bday-ki-body');
|
||||
|
|
|
|||
|
|
@ -824,10 +824,6 @@
|
|||
<div class="stats-band-num" id="big-posts">…</div>
|
||||
<div class="stats-band-label">Forum-Beiträge</div>
|
||||
</div>
|
||||
<div class="stats-band-item fade-up">
|
||||
<div class="stats-band-num" id="big-kotbeutel">…</div>
|
||||
<div class="stats-band-label">Kotbeutel-Stationen</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -1583,8 +1579,7 @@
|
|||
set('big-users', d.users);
|
||||
set('big-dogs', d.dogs);
|
||||
set('big-km', d.km);
|
||||
set('big-posts', d.forum_posts);
|
||||
set('big-kotbeutel', d.kotbeutel);
|
||||
set('big-posts', d.forum_posts);
|
||||
|
||||
var heroStats = document.getElementById('hero-stats');
|
||||
if (heroStats && d.users > 0) heroStats.style.display = 'flex';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Offline-Cache + Push Notifications + Tile-Cache
|
||||
============================================================ */
|
||||
|
||||
const CACHE_VERSION = 'by-v962';
|
||||
const CACHE_VERSION = 'by-v961';
|
||||
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
||||
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
||||
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue