Skip to content

Commit 9db8040

Browse files
committed
Dashboard: VERSION-Karte mit Kanal-Anzeige, Beta als Standard-Update-Kanal
1 parent bb12649 commit 9db8040

3 files changed

Lines changed: 53 additions & 3 deletions

File tree

app/routes/settings_routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"enable_file_selection_dialog": "false",
3535
"enable_multi_color_tracking": "true",
3636
"enable_ftp_gcode_download": "true",
37-
"update_channel": "stable",
37+
"update_channel": "beta",
3838
}
3939
PRO_CONFIG_DEFAULTS = {
4040
"debug.config.debug_logging_enabled": "false",

app/routes/version_routes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
_VERSION_URLS = {
3232
"beta": "https://raw.githubusercontent.com/d3nn3s08/FilamentHub/beta/VERSION",
33-
"stable": "https://raw.githubusercontent.com/d3nn3s08/FilamentHub/master/VERSION",
33+
"stable": "https://raw.githubusercontent.com/d3nn3s08/FilamentHub/main/VERSION",
3434
}
3535

3636

@@ -86,7 +86,7 @@ def get_current_version():
8686
@router.get("/check")
8787
async def check_for_update(session: Session = Depends(get_session), channel: str | None = None):
8888
if channel not in ("stable", "beta"):
89-
channel = get_setting(session, "update_channel", "stable") or "stable"
89+
channel = get_setting(session, "update_channel", "beta") or "beta"
9090
current = _read_current_version()
9191
latest = await _fetch_latest(channel)
9292

frontend/templates/dashboard.html

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,19 @@
364364
<div class="big-number" id="filamentTodayValue"></div>
365365
<p class="subtitle" style="margin:0;">Verbraucht</p>
366366
</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>
367380
</section>
368381

369382
<!-- Active Print Jobs -->
@@ -553,4 +566,41 @@ <h2>👋 Willkommen bei FilamentHub!</h2>
553566
setTimeout(checkAndShowWelcomePopup, 500);
554567
});
555568
</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>
556606
{% endblock %}

0 commit comments

Comments
 (0)