|
364 | 364 | <div class="big-number" id="filamentTodayValue">–</div> |
365 | 365 | <p class="subtitle" style="margin:0;">Verbraucht</p> |
366 | 366 | </div> |
| 367 | + <div class="live-card" id="versionCard"> |
| 368 | + <div style="display:flex;justify-content:space-between;align-items:flex-start;"> |
| 369 | + <div> |
| 370 | + <p class="eyebrow" style="margin-bottom:4px;">🔖 Version</p> |
| 371 | + <div class="big-number" id="dashVerCurrent" style="font-size:22px;">–</div> |
| 372 | + </div> |
| 373 | + <div style="text-align:right;"> |
| 374 | + <p class="eyebrow" style="margin-bottom:4px;">Kanal</p> |
| 375 | + <div class="big-number" id="dashVerChannel" style="font-size:22px;">–</div> |
| 376 | + </div> |
| 377 | + </div> |
| 378 | + <p class="subtitle" style="margin:4px 0 0 0;" id="dashVerStatus">Prüfe...</p> |
| 379 | + </div> |
367 | 380 | </section> |
368 | 381 |
|
369 | 382 | <!-- Active Print Jobs --> |
@@ -553,4 +566,41 @@ <h2>👋 Willkommen bei FilamentHub!</h2> |
553 | 566 | setTimeout(checkAndShowWelcomePopup, 500); |
554 | 567 | }); |
555 | 568 | </script> |
| 569 | + |
| 570 | +<script> |
| 571 | +(function() { |
| 572 | + const card = document.getElementById('versionCard'); |
| 573 | + const verEl = document.getElementById('dashVerCurrent'); |
| 574 | + const statEl = document.getElementById('dashVerStatus'); |
| 575 | + |
| 576 | + fetch('/api/version/check') |
| 577 | + .then(r => r.json()) |
| 578 | + .then(d => { |
| 579 | + verEl.textContent = d.current || '–'; |
| 580 | + const chanEl = document.getElementById('dashVerChannel'); |
| 581 | + if (chanEl && d.channel) { |
| 582 | + chanEl.textContent = d.channel === 'beta' ? 'BETA' : 'STABLE'; |
| 583 | + } |
| 584 | + if (d.update_available) { |
| 585 | + card.style.borderColor = 'rgba(255,193,101,.4)'; |
| 586 | + card.style.background = 'radial-gradient(circle at 20% 20%, rgba(255,193,101,.05), transparent 40%), var(--panel)'; |
| 587 | + statEl.textContent = '↑ ' + d.latest + ' verfügbar'; |
| 588 | + statEl.style.color = '#ffc165'; |
| 589 | + } else if (d.latest) { |
| 590 | + statEl.textContent = '✓ Aktuell'; |
| 591 | + statEl.style.color = '#6ae485'; |
| 592 | + } else { |
| 593 | + statEl.textContent = d.error || 'Offline'; |
| 594 | + statEl.style.color = 'var(--text-dim)'; |
| 595 | + } |
| 596 | + }) |
| 597 | + .catch(() => { |
| 598 | + fetch('/api/version/current').then(r => r.json()).then(d => { |
| 599 | + verEl.textContent = d.version || '–'; |
| 600 | + statEl.textContent = '–'; |
| 601 | + statEl.style.color = 'var(--text-dim)'; |
| 602 | + }).catch(() => {}); |
| 603 | + }); |
| 604 | +})(); |
| 605 | +</script> |
556 | 606 | {% endblock %} |
0 commit comments