Новая страница входа — чистый JS без ошибок

This commit is contained in:
Dauren777 2026-06-25 06:01:18 +00:00
parent 69ecad68fb
commit 52b8b8556b

View File

@ -3,85 +3,138 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1"> <meta name="viewport" content="width=device-width,initial-scale=1">
<title>Вход — ПАБ</title> <title>ПАБ — Вход</title>
<style>
*{box-sizing:border-box;margin:0;padding:0}
body{font:16px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;display:flex;align-items:center;justify-content:center;min-height:100vh;background:linear-gradient(135deg,#0F1218 0%,#1a2332 100%)}
#card{background:#fff;padding:44px 36px;border-radius:14px;width:100%;max-width:400px;box-shadow:0 8px 40px rgba(0,0,0,0.25)}
#card h1{font-size:19px;text-align:center;margin-bottom:4px}
#card .sub{font-size:13px;color:#5B6573;text-align:center;margin-bottom:24px}
input{width:100%;padding:12px;margin-bottom:12px;border:2px solid #E2E6EB;border-radius:8px;font-size:14px;font-family:inherit;outline:none}
input:focus{border-color:#00B4D8}
select{width:100%;padding:10px;margin-bottom:10px;border:2px solid #E2E6EB;border-radius:8px;font-size:13px;font-family:inherit}
button{width:100%;padding:12px;background:#00B4D8;color:#fff;border:none;border-radius:8px;font-size:15px;font-weight:700;cursor:pointer;font-family:inherit}
button:hover{background:#48CAE4}
.tabs{display:flex;gap:0;margin-bottom:20px;border-radius:8px;overflow:hidden;border:2px solid #E2E6EB}
.tabs button{flex:1;padding:8px;background:#fff;color:#5B6573;border:none;font-size:13px;font-weight:700;cursor:pointer;font-family:inherit;border-radius:0}
.tabs button.ac{background:#00B4D8;color:#fff}
.err{color:#E63946;font-size:13px;text-align:center;display:none;margin-top:8px}
.ok{background:#EDF7F0;border:1px solid #2D6A4F;color:#2D6A4F;padding:10px;border-radius:8px;font-size:13px;text-align:center;display:none;margin-top:10px;font-weight:600}
#regForm{display:none}
</style>
</head> </head>
<body> <body style="margin:0;padding:0;font-family:sans-serif;display:flex;align-items:center;justify-content:center;min-height:100vh;background:linear-gradient(135deg,#0F1218,#1a2332)">
<div id="card"> <div style="background:#fff;padding:40px;border-radius:14px;width:380px;max-width:90vw;box-shadow:0 8px 40px rgba(0,0,0,0.3)">
<h1>🛡️ Поведенческий аудит безопасности</h1> <h1 style="font-size:18px;text-align:center;margin-bottom:4px">🛡️ ПАБ</h1>
<div class="sub">Система ПАБ</div> <p style="text-align:center;color:#666;font-size:12px;margin-bottom:20px">Система ПАБ</p>
<div class="tabs"><button class="ac" id="tL">Вход</button><button id="tR">Регистрация</button></div>
<div id="loginForm"> <div id="tabs" style="display:flex;margin-bottom:16px;border:2px solid #ddd;border-radius:8px;overflow:hidden">
<input type="text" id="lu" placeholder="Логин"> <button id="tLogin" style="flex:1;padding:8px;font-weight:700;background:#00B4D8;color:#fff;border:none;cursor:pointer;font-size:13px">Вход</button>
<input type="password" id="lp" placeholder="Пароль"> <button id="tReg" style="flex:1;padding:8px;font-weight:700;background:#fff;color:#666;border:none;cursor:pointer;font-size:13px">Регистрация</button>
<button id="lb">Войти</button>
<div class="err" id="lerr">Неверный логин или пароль</div>
</div> </div>
<div id="regForm">
<input type="text" id="rl" placeholder="Придумайте логин"> <!-- Вход -->
<input type="password" id="rp" placeholder="Придумайте пароль (мин. 3)"> <div id="fLogin">
<input type="text" id="rn" placeholder="ФИО"> <input id="lu" placeholder="Логин" style="width:100%;padding:10px;margin-bottom:10px;border:2px solid #ddd;border-radius:8px;box-sizing:border-box">
<input type="email" id="re" placeholder="Email"> <input type="password" id="lp" placeholder="Пароль" style="width:100%;padding:10px;margin-bottom:10px;border:2px solid #ddd;border-radius:8px;box-sizing:border-box">
<select id="rr"><option value="">-- Должность --</option><option>Директор департамента ЦА</option><option>Директор департамента филиала</option><option>Региональный директор филиала</option><option>Директор ДЭСД</option><option>Начальник ТУСМ</option><option>Руководитель структурного подразделения</option><option>Начальник центра/службы/цеха</option><option>Начальник участка</option><option>Инженер БиОТ</option><option>Работник отдела БиОТ</option></select> <button id="btnLogin" style="width:100%;padding:12px;background:#00B4D8;color:#fff;border:none;border-radius:8px;font-size:14px;font-weight:700;cursor:pointer">Войти</button>
<select id="rf"><option value="">-- Периодичность ПАБ --</option><option value="2,month">2 раза в месяц</option><option value="1,month">1 раз в месяц</option><option value="1,quarter">1 раз в квартал</option><option value="1,halfyear">1 раз в полгода</option></select> <div id="loginErr" style="color:red;font-size:13px;text-align:center;display:none;margin-top:8px">Неверный логин или пароль</div>
<input type="text" id="rb" placeholder="Филиал">
<input type="text" id="rd" placeholder="Подразделение">
<input type="text" id="rg" placeholder="Регион">
<input type="text" id="ro" placeholder="Область">
<input type="text" id="rc" placeholder="Город / село">
<button id="rbb">Зарегистрироваться</button>
<div class="err" id="rerr"></div><div class="ok" id="rok">✅ Регистрация успешна! Теперь войдите.</div>
<button id="testBtn" style="margin-top:12px;background:none;border:1px solid #E2E6EB;padding:8px;width:100%;border-radius:6px;font-size:11px;cursor:pointer;color:#5B6573">🔍 Проверить Supabase</button>
</div> </div>
<!-- Регистрация -->
<div id="fReg" style="display:none">
<input id="rLogin" placeholder="Логин" style="width:100%;padding:10px;margin-bottom:10px;border:2px solid #ddd;border-radius:8px;box-sizing:border-box">
<input id="rPass" placeholder="Пароль (мин. 3)" type="password" style="width:100%;padding:10px;margin-bottom:10px;border:2px solid #ddd;border-radius:8px;box-sizing:border-box">
<input id="rName" placeholder="ФИО" style="width:100%;padding:10px;margin-bottom:10px;border:2px solid #ddd;border-radius:8px;box-sizing:border-box">
<input id="rEmail" placeholder="Email" style="width:100%;padding:10px;margin-bottom:10px;border:2px solid #ddd;border-radius:8px;box-sizing:border-box">
<select id="rRole" style="width:100%;padding:10px;margin-bottom:10px;border:2px solid #ddd;border-radius:8px;font-size:13px">
<option value="">Должность</option><option>Директор департамента ЦА</option><option>Директор департамента филиала</option><option>Региональный директор</option><option>Директор ДЭСД</option><option>Начальник ТУСМ</option><option>Руководитель СП</option><option>Начальник центра/службы/цеха</option><option>Начальник участка</option><option>Инженер БиОТ</option><option>Работник отдела БиОТ</option>
</select>
<select id="rFreq" style="width:100%;padding:10px;margin-bottom:10px;border:2px solid #ddd;border-radius:8px;font-size:13px">
<option value="">Периодичность ПАБ</option><option value="2,month">2 раза в месяц</option><option value="1,month">1 раз в месяц</option><option value="1,quarter">1 раз в квартал</option><option value="1,halfyear">1 раз в полгода</option>
</select>
<div style="display:flex;gap:8px;margin-bottom:10px">
<input id="rBranch" placeholder="Филиал" style="flex:1;padding:10px;border:2px solid #ddd;border-radius:8px;box-sizing:border-box">
<input id="rDept" placeholder="Подразделение" style="flex:1;padding:10px;border:2px solid #ddd;border-radius:8px;box-sizing:border-box">
</div> </div>
<div style="display:flex;gap:8px;margin-bottom:10px">
<input id="rRegion" placeholder="Регион" style="flex:1;padding:10px;border:2px solid #ddd;border-radius:8px;box-sizing:border-box">
<input id="rOblast" placeholder="Область" style="flex:1;padding:10px;border:2px solid #ddd;border-radius:8px;box-sizing:border-box">
</div>
<input id="rCity" placeholder="Город / село" style="width:100%;padding:10px;margin-bottom:10px;border:2px solid #ddd;border-radius:8px;box-sizing:border-box">
<button id="btnReg" style="width:100%;padding:12px;background:#00B4D8;color:#fff;border:none;border-radius:8px;font-size:14px;font-weight:700;cursor:pointer">Зарегистрироваться</button>
<div id="regErr" style="color:red;font-size:13px;text-align:center;display:none;margin-top:8px"></div>
<div id="regOk" style="color:#2D6A4F;font-size:13px;text-align:center;display:none;margin-top:8px">✅ Успешно! Теперь войдите.</div>
</div>
</div>
<script> <script>
document.getElementById('tL').onclick=function(){document.getElementById('loginForm').style.display='block';document.getElementById('regForm').style.display='none';this.classList.add('ac');document.getElementById('tR').classList.remove('ac')}; // Табы
document.getElementById('tR').onclick=function(){document.getElementById('loginForm').style.display='none';document.getElementById('regForm').style.display='block';this.classList.add('ac');document.getElementById('tL').classList.remove('ac')}; document.getElementById('tLogin').onclick=function(){document.getElementById('fLogin').style.display='block';document.getElementById('fReg').style.display='none';this.style.background='#00B4D8';this.style.color='#fff';document.getElementById('tReg').style.background='#fff';document.getElementById('tReg').style.color='#666'};
function doAppLogin(login,data){sessionStorage.setItem('pab_user',JSON.stringify({login:login,name:data.name,role:data.role,freq:data.freq||'',email:data.email||'',branch:data.branch||'',dept:data.dept||'',region:data.region||'',oblast:data.oblast||'',city:data.city||''}));location.href='app.html'} document.getElementById('tReg').onclick=function(){document.getElementById('fLogin').style.display='none';document.getElementById('fReg').style.display='block';this.style.background='#00B4D8';this.style.color='#fff';document.getElementById('tLogin').style.background='#fff';document.getElementById('tLogin').style.color='#666'};
document.getElementById('lb').onclick=function(){
// ВХОД
document.getElementById('btnLogin').onclick=function(){
var u=document.getElementById('lu').value.trim().toLowerCase(); var u=document.getElementById('lu').value.trim().toLowerCase();
var p=document.getElementById('lp').value.trim(); var p=document.getElementById('lp').value.trim();
if(u==='admin'&&p==='admin'){doAppLogin('admin',{name:'Администратор',role:'Руководитель',freq:'0,month',email:'admin@telecom.kz',branch:'АО «Казахтелеком»',dept:'ЦА',region:'Центральный',oblast:'—',city:'г. Астана'});return} var err=document.getElementById('loginErr');err.style.display='none';
// Быстрая проверка localStorage
var users={};try{users=JSON.parse(localStorage.getItem('pab_users')||'{}')}catch(e){} // 1. Admin
if(users[u]&&users[u].pass===p){doAppLogin(u,users[u]);return} if(u==='admin'&&p==='admin'){
// Показываем что идёт проверка sessionStorage.setItem('pab_user',JSON.stringify({login:'admin',name:'Администратор',role:'Руководитель',freq:'0,month',email:'admin@telecom.kz',branch:'АО Казахтелеком',dept:'ЦА',region:'Центральный',oblast:'—',city:'г. Астана'}));
var btn=document.getElementById('lb');btn.textContent='Проверка...';btn.disabled=true; location.href='app.html';return;
// Проверка через Supabase }
var SBU="https://znexbjafkvyjffffbhlf.supabase.co",SBK="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InpuZXhiamFma3Z5amZmZmZiaGxmIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc4MDY0NDE4MiwiZXhwIjoyMDk2MjIwMTgyfQ.5pOYTkL5eCmpSHBY3EwKof6NVKt7tL4Fn8xUAKM8itE";
fetch(SBU+"/rest/v1/users?login=eq."+encodeURIComponent(u),{headers:{"apikey":SBK,"Authorization":"Bearer "+SBK}}).then(function(r){return r.json()}).then(function(d){if(d.length>0&&d[0].pass===p){var ud=d[0];doAppLogin(u,ud);users[u]={pass:ud.pass,name:ud.name,email:ud.email,role:ud.role,freq:ud.freq,branch:ud.branch,dept:ud.dept,region:ud.region,oblast:ud.oblast,city:ud.city};localStorage.setItem('pab_users',JSON.stringify(users))}else{btn.textContent='Войти';btn.disabled=false;document.getElementById('lerr').style.display='block'}}).catch(function(){btn.textContent='Войти';btn.disabled=false;document.getElementById('lerr').style.display='block'}); // 2. Проверяем localStorage
var users={};
try{users=JSON.parse(localStorage.getItem('pab_users')||'{}');}catch(e){}
if(users[u]&&users[u].pass===p){
sessionStorage.setItem('pab_user',JSON.stringify({login:u,name:users[u].name,role:users[u].role,freq:users[u].freq||'',email:users[u].email||'',branch:users[u].branch||'',dept:users[u].dept||'',region:users[u].region||'',oblast:users[u].oblast||'',city:users[u].city||''}));
location.href='app.html';return;
}
// 3. Проверяем Supabase
var btn=document.getElementById('btnLogin');btn.textContent='Проверка...';
fetch('https://znexbjafkvyjffffbhlf.supabase.co/rest/v1/users?login=eq.'+encodeURIComponent(u),{
headers:{'apikey':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InpuZXhiamFma3Z5amZmZmZiaGxmIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc4MDY0NDE4MiwiZXhwIjoyMDk2MjIwMTgyfQ.5pOYTkL5eCmpSHBY3EwKof6NVKt7tL4Fn8xUAKM8itE','Authorization':'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InpuZXhiamFma3Z5amZmZmZiaGxmIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc4MDY0NDE4MiwiZXhwIjoyMDk2MjIwMTgyfQ.5pOYTkL5eCmpSHBY3EwKof6NVKt7tL4Fn8xUAKM8itE'}
}).then(function(r){return r.json()}).then(function(d){
if(d.length>0&&d[0].pass===p){
var ud=d[0];users[u]={pass:ud.pass,name:ud.name,email:ud.email,role:ud.role,freq:ud.freq,branch:ud.branch,dept:ud.dept,region:ud.region,oblast:ud.oblast,city:ud.city};
localStorage.setItem('pab_users',JSON.stringify(users));
sessionStorage.setItem('pab_user',JSON.stringify({login:u,name:ud.name,role:ud.role,freq:ud.freq||'',email:ud.email||'',branch:ud.branch||'',dept:ud.dept||'',region:ud.region||'',oblast:ud.oblast||'',city:ud.city||''}));
location.href='app.html';
}else{btn.textContent='Войти';err.textContent='Неверный логин или пароль';err.style.display='block';}
}).catch(function(e){btn.textContent='Войти';err.textContent='Ошибка соединения';err.style.display='block';});
}; };
document.getElementById('lp').onkeydown=function(e){if(e.key==='Enter')document.getElementById('lb').onclick()}; document.getElementById('lp').onkeydown=function(e){if(e.key==='Enter')document.getElementById('btnLogin').onclick();};
document.getElementById('rbb').onclick=function(){
var l=document.getElementById('rl').value.trim().toLowerCase(),p=document.getElementById('rp').value.trim(),n=document.getElementById('rn').value.trim(),em=document.getElementById('re').value.trim(),r=document.getElementById('rr').value,fr=document.getElementById('rf').value,br=document.getElementById('rb').value.trim(),dp=document.getElementById('rd').value.trim(),rg=document.getElementById('rg').value.trim(),ob=document.getElementById('ro').value.trim(),ct=document.getElementById('rc').value.trim(); // РЕГИСТРАЦИЯ
var e=document.getElementById('rerr'),ok=document.getElementById('rok');ok.style.display='none';if(!l||l.length<2){e.textContent='Логин мин. 2 символа';e.style.display='block';return}if(!p||p.length<3){e.textContent='Пароль мин. 3 символа';e.style.display='block';return}if(!n){e.textContent='Укажите ФИО';e.style.display='block';return}if(!r){e.textContent='Выберите должность';e.style.display='block';return}if(!em||em.indexOf('@')<0){e.textContent='Укажите Email';e.style.display='block';return}if(!br){e.textContent='Укажите филиал';e.style.display='block';return}if(!rg){e.textContent='Укажите регион';e.style.display='block';return}if(!ct){e.textContent='Укажите город';e.style.display='block';return}if(!dp){e.textContent='Укажите подразделение';e.style.display='block';return}if(!fr){e.textContent='Укажите периодичность ПАБ';e.style.display='block';return} document.getElementById('btnReg').onclick=function(){
var users={};try{users=JSON.parse(localStorage.getItem('pab_users')||'{}')}catch(e){}if(users[l]){e.textContent='Логин занят';e.style.display='block';return}e.style.display='none'; users[l]={pass:p,name:n,email:em,role:r,freq:fr,branch:br,dept:dp,region:rg,oblast:ob,city:ct};localStorage.setItem('pab_users',JSON.stringify(users)); var l=document.getElementById('rLogin').value.trim().toLowerCase();
// Отправка в Supabase var p=document.getElementById('rPass').value.trim();
fetch("https://znexbjafkvyjffffbhlf.supabase.co/rest/v1/users",{method:"POST",headers:{"apikey":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InpuZXhiamFma3Z5amZmZmZiaGxmIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc4MDY0NDE4MiwiZXhwIjoyMDk2MjIwMTgyfQ.5pOYTkL5eCmpSHBY3EwKof6NVKt7tL4Fn8xUAKM8itE","Authorization":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InpuZXhiamFma3Z5amZmZmZiaGxmIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc4MDY0NDE4MiwiZXhwIjoyMDk2MjIwMTgyfQ.5pOYTkL5eCmpSHBY3EwKof6NVKt7tL4Fn8xUAKM8itE","Content-Type":"application/json","Prefer":"resolution=merge-duplicates"},body:JSON.stringify({login:l,pass:p,name:n,email:em,role:r,freq:fr,branch:br,dept:dp,region:rg,oblast:ob,city:ct})}).then(function(r){if(!r.ok){console.error("Supabase reg error:",r.status);alert("⚠️ Регистрация локально OK, но не сохранена в облако. С другого устройства вход будет недоступен.")}}).catch(function(e){console.error(e);alert("⚠️ Регистрация локально OK, но нет связи с облаком.")}); var n=document.getElementById('rName').value.trim();
ok.style.display='block';document.getElementById('lu').value=l; setTimeout(function(){ok.style.display='none';document.getElementById('tL').onclick()},2000) var em=document.getElementById('rEmail').value.trim();
var r=document.getElementById('rRole').value;
var fr=document.getElementById('rFreq').value;
var br=document.getElementById('rBranch').value.trim();
var dp=document.getElementById('rDept').value.trim();
var rg=document.getElementById('rRegion').value.trim();
var ob=document.getElementById('rOblast').value.trim();
var ct=document.getElementById('rCity').value.trim();
var err=document.getElementById('regErr'),ok=document.getElementById('regOk');
err.style.display='none';ok.style.display='none';
if(!l||l.length<2){err.textContent='Логин мин. 2 символа';err.style.display='block';return}
if(!p||p.length<3){err.textContent='Пароль мин. 3 символа';err.style.display='block';return}
if(!n){err.textContent='Укажите ФИО';err.style.display='block';return}
if(!em||em.indexOf('@')<0){err.textContent='Укажите Email';err.style.display='block';return}
if(!r){err.textContent='Выберите должность';err.style.display='block';return}
if(!fr){err.textContent='Выберите периодичность';err.style.display='block';return}
if(!br||!dp||!rg||!ct){err.textContent='Заполните все поля';err.style.display='block';return}
// Проверяем localStorage
var users={};try{users=JSON.parse(localStorage.getItem('pab_users')||'{}');}catch(e){}
if(users[l]){err.textContent='Логин уже занят';err.style.display='block';return}
// Сохраняем локально
users[l]={pass:p,name:n,email:em,role:r,freq:fr,branch:br,dept:dp,region:rg,oblast:ob,city:ct};
localStorage.setItem('pab_users',JSON.stringify(users));
// Отправляем в Supabase
var btn=document.getElementById('btnReg');btn.textContent='Сохранение...';
fetch('https://znexbjafkvyjffffbhlf.supabase.co/rest/v1/users',{
method:'POST',
headers:{'apikey':'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InpuZXhiamFma3Z5amZmZmZiaGxmIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc4MDY0NDE4MiwiZXhwIjoyMDk2MjIwMTgyfQ.5pOYTkL5eCmpSHBY3EwKof6NVKt7tL4Fn8xUAKM8itE','Authorization':'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InpuZXhiamFma3Z5amZmZmZiaGxmIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc4MDY0NDE4MiwiZXhwIjoyMDk2MjIwMTgyfQ.5pOYTkL5eCmpSHBY3EwKof6NVKt7tL4Fn8xUAKM8itE','Content-Type':'application/json','Prefer':'resolution=merge-duplicates'},
body:JSON.stringify({login:l,pass:p,name:n,email:em,role:r,freq:fr,branch:br,dept:dp,region:rg,oblast:ob,city:ct})
}).then(function(r){
btn.textContent='Зарегистрироваться';
if(r.ok){ok.style.display='block';document.getElementById('lu').value=l;setTimeout(function(){ok.style.display='none';document.getElementById('tLogin').click()},2000)}
else{alert('Сохранено локально. Supabase вернул ошибку '+r.status+'. С другого устройства вход может не работать.');ok.style.display='block';document.getElementById('lu').value=l;setTimeout(function(){ok.style.display='none';document.getElementById('tLogin').click()},2000)}
}).catch(function(){btn.textContent='Зарегистрироваться';alert('Сохранено локально. Supabase недоступен.');ok.style.display='block';document.getElementById('lu').value=l;setTimeout(function(){ok.style.display='none';document.getElementById('tLogin').click()},2000)});
}; };
document.getElementById('testBtn').onclick=function(){
var SBK="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InpuZXhiamFma3Z5amZmZmZiaGxmIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc4MDY0NDE4MiwiZXhwIjoyMDk2MjIwMTgyfQ.5pOYTkL5eCmpSHBY3EwKof6NVKt7tL4Fn8xUAKM8itE";
fetch("https://znexbjafkvyjffffbhlf.supabase.co/rest/v1/users?select=login",{headers:{"apikey":SBK,"Authorization":"Bearer "+SBK}}).then(function(r){return r.json()}).then(function(d){if(Array.isArray(d))alert("✅ Supabase работает!\nПользователей: "+d.length+"\nЛогины: "+d.map(function(x){return x.login}).join(", "));else alert("❌ Ошибка: "+JSON.stringify(d))}).catch(function(e){alert("❌ Нет соединения: "+e)});
};
function testSupabase(){document.getElementById('testBtn').click();}
</script> </script>
</body> </body>
</html> </html>