From 60b95dcc2cfa201f2a1aee8fbcc34e8f2a8d2033 Mon Sep 17 00:00:00 2001 From: Dauren777 Date: Wed, 24 Jun 2026 09:06:46 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BD=D0=BE=D0=BF=D0=BA=D0=B0=20=C2=AB?= =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=B8=D1=82=D1=8C=20Supaba?= =?UTF-8?q?se=C2=BB=20=D0=BD=D0=B0=20=D1=81=D1=82=D1=80=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=86=D0=B5=20=D0=B2=D1=85=D0=BE=D0=B4=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/index.html b/index.html index 97c8a28..d206260 100644 --- a/index.html +++ b/index.html @@ -77,6 +77,17 @@ document.getElementById('rbb').onclick=function(){ 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, но нет связи с облаком.")}); ok.style.display='block';document.getElementById('lu').value=l;setTimeout(function(){ok.style.display='none';document.getElementById('tL').onclick()},2000) }; +function testSupabase(){ + var SBU="https://znexbjafkvyjffffbhlf.supabase.co",SBK="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InpuZXhiamFma3Z5amZmZmZiaGxmIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImlhdCI6MTc4MDY0NDE4MiwiZXhwIjoyMDk2MjIwMTgyfQ.5pOYTkL5eCmpSHBY3EwKof6NVKt7tL4Fn8xUAKM8itE"; + // Тест: получить список пользователей + fetch(SBU+"/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("❌ Нет соединения с Supabase: "+e.message)}); +}