Update docker

This commit is contained in:
2026-01-11 07:47:40 +03:00
parent 56cdb353cb
commit 6b3d989b03
2 changed files with 47 additions and 0 deletions

View File

@@ -183,6 +183,25 @@ function showAccessDenied() {
document.body.appendChild(div);
}
function showInviteRequired() {
document.body.innerHTML = '';
document.body.style.display = 'block';
const div = document.createElement('div');
div.style.cssText = 'display:flex; flex-direction:column; align-items:center; justify-content:center; height:100vh; padding:24px; text-align:center; background:var(--md-sys-color-background); color:var(--md-sys-color-on-background); font-family:var(--font-brand);';
div.innerHTML = `
<svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="var(--md-sys-color-error)" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" style="margin-bottom:24px;"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><line x1="3" x2="21" y1="9" y2="9"/><path d="m9 16 2 2 4-4"/></svg>
<h1 style="font-size:24px; font-weight:600; margin-bottom:16px;">Registration Required</h1>
<p style="font-size:16px; opacity:0.7; max-width:320px; margin-bottom:32px; line-height:1.5;">
You need to activate the bot with an invite code to use this app.
</p>
<button onclick="window.Telegram?.WebApp?.close()" style="background:var(--md-sys-color-primary); color:var(--md-sys-color-on-primary); padding:12px 24px; border-radius:100px; border:none; font-size:16px; font-weight:500; cursor:pointer;">
Close App
</button>
`;
document.body.appendChild(div);
}
function initApp() {
// Enhanced OS Detection
const ua = navigator.userAgent.toLowerCase();
@@ -361,6 +380,12 @@ async function loadDashboard() {
try {
const res = await fetch(`${API_BASE}/user/${currentState.user.id}`);
if (res.status === 404) {
showInviteRequired();
return;
}
const data = await res.json();
if (data.error) throw new Error(data.error);