@davoodmehraban89 / Factor-easy-2 Mirror · read-only / commits / 42de2ee
Fork 0

سامانه صدور فاکتور و حسابداری

Mirrored from https://github.com/davoodmehraban89/Factor-easy.git

Synced Dec 3, 17:00 UTC

Update diag.html

davoodmehraban89 committed Sep 22, 2026 at 08:34 UTC 42de2ee13821c2c929397fdecbe6bda53569f2ee
1 file changed +46
diag.html
+46
@@ -1 +1,47 @@
1 +<!DOCTYPE html>
2 +<html lang="fa" dir="rtl"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
3 +<title>تشخیص اتصال فینورا</title>
4 +<style>body{font-family:system-ui,Tahoma,sans-serif;padding:16px;max-width:680px;margin:auto;line-height:1.9}
5 +.ok{color:#059669;font-weight:bold}.bad{color:#dc2626;font-weight:bold}.box{border:1px solid #cbd5e1;border-radius:10px;padding:10px;margin:10px 0}
6 +pre{background:#f1f5f9;padding:10px;border-radius:8px;white-space:pre-wrap;direction:ltr;text-align:left;font-size:12px}
7 +button{padding:12px 18px;font-size:16px;border-radius:10px;border:0;background:#2563eb;color:#fff}</style></head>
8 +<body>
9 +<h2>تشخیص اتصال به سرور فینورا</h2>
10 +<p>این صفحه فقط ۳ درخواست بی‌خطر می‌فرستد و هیچ داده‌ای نمی‌سازد. VPN را روشن کن و دکمه را بزن.</p>
11 +<button id="go">شروع آزمایش</button>
12 +<div id="out"></div>
13 +<pre id="rep"></pre>
14 +<script>
15 +const U='https://hcsixhqbyuhpshfwqpjx.supabase.co';
16 +const K='sb_publishable_2y8IsGdhqeLDPkEp7mBF4w_X4yji16D';
17 +const out=document.getElementById('out'),rep=document.getElementById('rep');
18 +let lines=[];
19 +function row(title,ok,detail){
20 + out.insertAdjacentHTML('beforeend','<div class="box"><span class="'+(ok?'ok':'bad')+'">'+(ok?'✔ ':'✘ ')+title+'</span></div>');
21 + lines.push((ok?'OK ':'FAIL ')+title+' :: '+detail);rep.textContent=lines.join('\n');
22 +}
23 +async function t(name,fn){
24 + const s=performance.now();
25 + try{const d=await fn();row(name,true,d+' ('+Math.round(performance.now()-s)+'ms)');return true;}
26 + catch(e){row(name,false,(e&&e.name)+': '+(e&&e.message)+' ('+Math.round(performance.now()-s)+'ms)');return false;}
27 +}
28 +document.getElementById('go').onclick=async()=>{
29 + out.innerHTML='';lines=[];
30 + lines.push('UA: '+navigator.userAgent);lines.push('online: '+navigator.onLine);lines.push('time: '+new Date().toISOString());rep.textContent=lines.join('\n');
31 + const a=await t('۱) رسیدن به سرور (TCP/TLS)',async()=>{await fetch(U+'/auth/v1/health',{mode:'no-cors',cache:'no-store'});return 'reachable';});
32 + const b=await t('۲) درخواست مرورگری با کلید (CORS)',async()=>{
33 + const r=await fetch(U+'/auth/v1/settings',{headers:{apikey:K},cache:'no-store'});const j=await r.json();
34 + return 'status '+r.status+' disable_signup='+j.disable_signup+' mailer_autoconfirm='+j.mailer_autoconfirm+' email_provider='+(j.external&&j.external.email);});
35 + const c=await t('۳) درخواست POST مثل ثبت‌نام (بدون ساخت کاربر)',async()=>{
36 + const r=await fetch(U+'/auth/v1/signup',{method:'POST',headers:{apikey:K,'Content-Type':'application/json'},body:'{}'});
37 + const x=await r.text();return 'status '+r.status+' body='+x.slice(0,160);});
38 + let msg='';
39 + if(!a)msg='به خود سرور نمی‌رسد: مشکل شبکه/VPN/فیلترینگ است، نه کد فینورا.';
40 + else if(!b)msg='سرور در دسترس است ولی درخواست مرورگری با کلید مسدود می‌شود (VPN، افزونه/مسدودکننده یا شبکه).';
41 + else if(!c)msg='خواندن کار می‌کند ولی POST مسدود می‌شود؛ احتمالاً فیلتر شبکه یا VPN.';
42 + else msg='شبکه سالم است. مشکل در کد یا تنظیمات است؛ متن گزارش زیر را برای من بفرست.';
43 + out.insertAdjacentHTML('beforeend','<div class="box"><b>نتیجه:</b> '+msg+'</div>');
44 + lines.push('VERDICT: '+msg);rep.textContent=lines.join('\n');
45 +};
46 +</script></body></html>
47