AstraOS Ver. 1.51 - Letzte Aenderung Kasten im Dashboard
All checks were successful
Deploy AstraOS Panel / deploy (push) Successful in 13s

This commit is contained in:
elias 2026-08-30 16:27:02 +02:00
parent 2d9a796ee5
commit 2164b23962

View file

@ -36,15 +36,9 @@
<div class="grid grid-cols-1 gap-8">
<div class="glow-card opacity-0 translate-y-8 lg:col-span-2 bg-black/40 p-6 rounded-xl backdrop-blur
{% if maintenance_active %}border border-yellow-500/30{% else %}border border-purple-500/20{% endif %}">
<div class="flex flex-col sm:flex-row sm:items-center justify-between gap-4 mb-5">
<div>
<h3 class="text-base font-semibold text-slate-300 uppercase tracking-wider">Schnellzugriff</h3>
<p class="text-xs text-slate-500 mt-0.5">Zuletzt verwendete Bereiche</p>
</div>
<div class="text-xs text-slate-500 flex items-center gap-1.5">
<span class="w-1.5 h-1.5 rounded-full bg-green-400 inline-block"></span>
Letztes Deploy: <span class="text-slate-300 font-mono ml-1" id="last-deploy-time">wird geladen…</span>
</div>
<div class="mb-5">
<h3 class="text-base font-semibold text-slate-300 uppercase tracking-wider">Schnellzugriff</h3>
<p class="text-xs text-slate-500 mt-0.5">Zuletzt verwendete Bereiche</p>
</div>
<div class="grid grid-cols-2 sm:grid-cols-4 gap-3" id="quick-access-grid">
<a href="/user_management" class="group flex flex-col items-center justify-center gap-2 bg-slate-900/60 hover:bg-purple-950/40 border border-slate-800 hover:border-purple-500/40 rounded-xl p-4 transition-all duration-200">
@ -67,7 +61,13 @@
</div>
</div>
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
<div class="glow-card opacity-0 translate-y-8 bg-black/40 rounded-xl p-6 backdrop-blur
{% if maintenance_active %}border border-yellow-500/30{% else %}border border-purple-500/20{% endif %}">
<h3 class="text-xl font-semibold mb-2 {% if maintenance_active %}text-yellow-300{% else %}text-purple-300{% endif %}">Letzte Änderung</h3>
<p class="text-base font-bold text-slate-100 truncate" id="last-commit-msg">wird geladen…</p>
<p class="text-xs text-slate-500 mt-0.5" id="last-commit-author">–</p>
<p class="text-xs text-purple-400 mt-1 font-mono" id="last-commit-time">–</p>
</div>
<div class="glow-card opacity-0 translate-y-8 bg-black/40 rounded-xl p-6 backdrop-blur
{% if maintenance_active %}border border-yellow-500/30{% else %}border border-purple-500/20{% endif %}">
<h3 class="text-xl font-semibold mb-2 {% if maintenance_active %}text-yellow-300{% else %}text-purple-300{% endif %}">Aktive Nutzer</h3>
@ -136,21 +136,34 @@
</div>
</div>
<script>
// Last Deploy Zeit laden
fetch('https://git.astra-os.de/api/v1/repos/MrWhiff/AstraOS-Panel/commits?limit=1&token=', {signal: AbortSignal.timeout(4000)})
// Letzte Änderung (Commit) laden
fetch('https://git.astra-os.de/api/v1/repos/MrWhiff/AstraOS-Panel/commits?limit=1', {signal: AbortSignal.timeout(4000)})
.then(r => r.json())
.then(data => {
const el = document.getElementById('last-deploy-time');
if (!el) return;
const d = data?.[0]?.created;
if (!d) { el.textContent = 'unbekannt'; return; }
const date = new Date(d);
const diff = Math.round((Date.now() - date.getTime()) / 60000);
if (diff < 60) el.textContent = `vor ${diff} Min.`;
else if (diff < 1440) el.textContent = `vor ${Math.round(diff/60)} Std.`;
else el.textContent = date.toLocaleDateString('de-DE', {day:'2-digit', month:'short', hour:'2-digit', minute:'2-digit'});
const commit = data?.[0];
const msgEl = document.getElementById('last-commit-msg');
const authEl = document.getElementById('last-commit-author');
const timeEl = document.getElementById('last-commit-time');
if (!commit || !msgEl) return;
// Commit-Message (erste Zeile)
msgEl.textContent = (commit.commit?.message || '–').split('\n')[0];
// Autor
const author = commit.commit?.author?.name || commit.author?.login || '–';
authEl.textContent = `von ${author}`;
// Relative Zeit
const d = commit.created || commit.commit?.author?.date;
if (d) {
const diff = Math.round((Date.now() - new Date(d).getTime()) / 60000);
if (diff < 60) timeEl.textContent = `vor ${diff} Min.`;
else if (diff < 1440) timeEl.textContent = `vor ${Math.round(diff/60)} Std.`;
else timeEl.textContent = new Date(d).toLocaleDateString('de-DE', {day:'2-digit', month:'short', hour:'2-digit', minute:'2-digit'});
}
})
.catch(() => { const el = document.getElementById('last-deploy-time'); if(el) el.textContent = 'nicht verfügbar'; });
.catch(() => {
const el = document.getElementById('last-commit-msg');
if (el) el.textContent = 'nicht verfügbar';
});
gsap.registerPlugin(ScrollTrigger);