N

VPN MANAGEMENT

System Online

Generate License Key

Managed Servers

Server Name Type Status Actions
SG-VIP-Node-1 VLESS (3x-ui) Active
JP-Outline-2 Outline Active
document.getElementById('keyForm').addEventListener('submit', async (e) => { e.preventDefault(); const type = document.getElementById('protocol').value; const dataLimit = document.getElementById('dataLimit').value; const daysLimit = document.getElementById('daysLimit').value; const btn = e.target.querySelector('button[type="submit"]'); const originalBtnHTML = btn.innerHTML; // Loading ပြရန် btn.innerHTML = ' Generating...'; try { const response = await fetch('https://api.ngashein.shop/admin/keys/generate', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ type: type, data_limit_gb: parseFloat(dataLimit), days_limit: parseInt(daysLimit) }) }); const result = await response.json(); if (response.ok) { document.getElementById('keyResult').classList.remove('hidden'); document.getElementById('generatedKey').innerText = result.key; } else { alert("Error: " + (result.detail || "Something went wrong")); } } catch (error) { console.error("Error:", error); alert("API နဲ့ ချိတ်ဆက်လို့မရပါ။ FastAPI Backend (Port 8000) Run ထားသလား စစ်ဆေးပါ။"); } finally { btn.innerHTML = originalBtnHTML; } });