diff --git a/panel/public/assets/js/reseller.js b/panel/public/assets/js/reseller.js index 993ce88..b850251 100644 --- a/panel/public/assets/js/reseller.js +++ b/panel/public/assets/js/reseller.js @@ -13,6 +13,8 @@ async function initReseller() { } _rUser = res.data; document.getElementById('user-name').textContent = _rUser.username || 'Reseller'; + document.getElementById('auth-check').style.display = 'none'; + document.getElementById('main-layout').style.display = ''; return true; } @@ -56,10 +58,10 @@ async function rDashboard(el) { `; const res = await Nova.api('accounts', 'list', { params:{ limit:5 }}); - const accts = res?.data?.accounts || []; + const accts = res?.data || []; document.getElementById('r-stats').innerHTML = [ - { label: 'Total Accounts', val: res?.data?.total || 0, icon: 'ni-accounts' }, + { label: 'Total Accounts', val: res?.meta?.total || accts.length, icon: 'ni-accounts' }, { label: 'Active', val: accts.filter(a=>a.status==='active').length, icon: 'ni-stats' }, { label: 'Suspended', val: accts.filter(a=>a.status==='suspended').length, icon: 'ni-suspend' }, ].map(s => `
@@ -95,9 +97,10 @@ async function loadRAccounts(search = '') { const el = document.getElementById('r-accounts-list'); if (!el) return; const res = await Nova.api('accounts', 'list', { params: search ? { search } : {}}); - if (!res?.success || !res.data.accounts.length) { el.innerHTML = '
No accounts found.
'; return; } + const acctRows = res?.data || []; + if (!res?.success || !acctRows.length) { el.innerHTML = '
No accounts found.
'; return; } el.innerHTML = ` - ${res.data.accounts.map(a => ` + ${acctRows.map(a => ` @@ -326,6 +329,11 @@ window.resellerNav = (page) => { document.addEventListener('DOMContentLoaded', async () => { const ok = await initReseller(); if (!ok) return; + document.getElementById('logout-btn')?.addEventListener('click', async e => { + e.preventDefault(); + await Nova.api('auth', 'logout', { method: 'POST' }); + location.href = '/'; + }); renderRNav(); window.resellerNav('dashboard'); }); @@ -338,7 +346,7 @@ async function rDocker(el) { Nova.api('accounts', 'list', { params: { limit: 200 } }), ]); const stacks = stRes?.data?.stacks || []; - const accts = acctRes?.data?.accounts || []; + const accts = acctRes?.data || []; el.innerHTML = ` diff --git a/panel/public/reseller/index.php b/panel/public/reseller/index.php index bcf4cd2..12e69d4 100644 --- a/panel/public/reseller/index.php +++ b/panel/public/reseller/index.php @@ -61,11 +61,11 @@ $_pname = novacpx_panel_name('NovaCPX');
- -
-
-
- + + +
+
+
diff --git a/panel/public/user/index.php b/panel/public/user/index.php index 4339953..307c99b 100644 --- a/panel/public/user/index.php +++ b/panel/public/user/index.php @@ -188,11 +188,11 @@ svg.ring circle { transition: stroke-dashoffset .5s; }
- -
-
-
- + + +
+
+
UsernameDomainPackageDiskStatusActions
${a.username} ${a.domain} ${a.package_name || '—'}