Feature: Admin-Panel wird immer live vom Server geladen (v1.2.2)
Kein manuelles Update von admin.html mehr nötig – immer die aktuelle Version. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
20
index.html
20
index.html
@@ -1713,7 +1713,7 @@
|
||||
// ============================================================
|
||||
// CONSTANTS & CHAPTER CONFIG
|
||||
// ============================================================
|
||||
const APP_VERSION = '1.2.1';
|
||||
const APP_VERSION = '1.2.2';
|
||||
const GITEA_RAW = 'http://72.60.134.73:3000/api/v1/repos/cheubaum/BNI-Vorstellungsrunde/raw';
|
||||
const GITEA_API = 'http://72.60.134.73:3000/api/v1/repos/cheubaum/BNI-Vorstellungsrunde';
|
||||
function giteaUrl(path) { return `${GITEA_RAW}/${path}?ref=main`; }
|
||||
@@ -1893,7 +1893,7 @@ function renderStammvertreterSection() {
|
||||
if (!container) return;
|
||||
const list = loadStammvertreter();
|
||||
if (list.length === 0) {
|
||||
container.innerHTML = `<div style="color:var(--muted);font-size:0.82rem;padding:2px 0 8px;">Noch keine gespeichert. → <a href="admin.html" target="_blank" style="color:var(--red);">Admin öffnen</a> zum Importieren aus anderen Chaptern.</div>`;
|
||||
container.innerHTML = `<div style="color:var(--muted);font-size:0.82rem;padding:2px 0 8px;">Noch keine gespeichert. → <a href="#" onclick="openAdminPanel();return false;" style="color:var(--red);">Admin öffnen</a> zum Importieren aus anderen Chaptern.</div>`;
|
||||
return;
|
||||
}
|
||||
container.innerHTML = '';
|
||||
@@ -4492,7 +4492,7 @@ function renderAdminPanel() {
|
||||
</div>
|
||||
<button class="btn btn-secondary btn-sm" style="width:100%;margin-bottom:6px;" onclick="fetchChapterMembersFromGitea()">🔄 Mitglieder vom Server laden</button>
|
||||
<div style="font-size:0.78rem;color:var(--muted);margin-bottom:16px;">Letzter Download: ${lastSync}</div>
|
||||
<a href="admin.html" target="_blank" class="btn btn-primary btn-sm" style="width:100%;display:block;text-align:center;text-decoration:none;margin-bottom:16px;">⚙ Admin-Panel öffnen</a>
|
||||
<button onclick="openAdminPanel()" class="btn btn-primary btn-sm" style="width:100%;display:block;margin-bottom:16px;">⚙ Admin-Panel öffnen</button>
|
||||
` : `<div style="color:var(--muted);font-size:0.88rem;margin-bottom:20px;">Kein Chapter aktiviert.</div>`}
|
||||
<div style="border-top:1px solid var(--border);padding-top:14px;margin-bottom:14px;">
|
||||
<div style="font-size:0.78rem;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:1px;margin-bottom:10px;">Einstellungen</div>
|
||||
@@ -4509,6 +4509,20 @@ function renderAdminPanel() {
|
||||
</div>`;
|
||||
}
|
||||
|
||||
async function openAdminPanel() {
|
||||
try {
|
||||
const res = await fetch(giteaUrl('admin.html'), { cache: 'no-store' });
|
||||
if (!res.ok) throw new Error('Nicht erreichbar');
|
||||
const html = await res.text();
|
||||
const blob = new Blob([html], { type: 'text/html' });
|
||||
const url = URL.createObjectURL(blob);
|
||||
window.open(url, '_blank', 'noopener');
|
||||
setTimeout(() => URL.revokeObjectURL(url), 10000);
|
||||
} catch(e) {
|
||||
alert('Admin-Panel konnte nicht geladen werden.\nBitte Internetverbindung prüfen.');
|
||||
}
|
||||
}
|
||||
|
||||
function confirmSwitchChapter() {
|
||||
if (!confirm('Chapter wechseln?\n\nAlle lokalen Daten dieses Chapters werden gelöscht. Fortfahren?')) return;
|
||||
clearChapterData();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"version": "1.2.1",
|
||||
"notes": "Timer-Schalter im Admin-Menü"
|
||||
"version": "1.2.2",
|
||||
"notes": "Admin-Panel immer aktuell vom Server"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user