mirror of
https://github.com/myronblair/novacpx
synced 2026-06-30 17:50:41 -05:00
fix: broken adminSubdomains/adminParked JS from bad patch; CORS PORT_* constants
This commit is contained in:
@@ -4644,31 +4644,28 @@ ${results.map(z=>`<tr>
|
||||
|
||||
// ══ ADMIN SUBDOMAINS PAGE ═════════════════════════════════════════════════
|
||||
window.adminSubdomains = async function() {
|
||||
Nova.loadPage('subdomains', window._novaPages); document.getElementById('page-title').textContent='All Subdomains'; document.getElementById('page-content').innerHTML=`, 'All Subdomains', `
|
||||
document.querySelectorAll('.sidebar-link').forEach(l=>l.classList.remove('active'));
|
||||
document.querySelector('[data-page="subdomains"]')?.classList.add('active');
|
||||
document.getElementById('page-title').textContent = 'All Subdomains';
|
||||
document.getElementById('page-content').innerHTML = `
|
||||
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem">
|
||||
<p class="text-muted" style="margin:0">All subdomains across all hosting accounts.</p>
|
||||
</div>
|
||||
<div class="card"><div id="admin-sub-list"><div class="loading">Loading…</div></div></div>`);
|
||||
`;
|
||||
<div class="card"><div id="admin-sub-list"><div class="loading">Loading…</div></div></div>`;
|
||||
const el = document.getElementById('admin-sub-list');
|
||||
const res = await Nova.api('accounts','list',{params:{per_page:200}});
|
||||
if (!res?.success || !res.data?.length) { el.innerHTML='<div class="empty">No accounts</div>'; return; }
|
||||
const accts = res.data;
|
||||
let rows = [];
|
||||
for (const acct of accts) {
|
||||
for (const acct of res.data) {
|
||||
const dr = await Nova.api('domains','list',{params:{account_id:acct.id}});
|
||||
if (!dr?.success) continue;
|
||||
dr.data.filter(d=>d.type==='subdomain').forEach(d => rows.push({...d, account_username: acct.username, account_domain: acct.domain}));
|
||||
dr.data.filter(d=>d.type==='subdomain').forEach(d=>rows.push({...d,acct_username:acct.username}));
|
||||
}
|
||||
if (!rows.length) { el.innerHTML='<div class="empty">No subdomains found.</div>'; return; }
|
||||
el.innerHTML = `<table class="table"><thead><tr><th>Account</th><th>Subdomain</th><th>SSL</th><th>Created</th><th></th></tr></thead><tbody>
|
||||
${rows.map(d=>`<tr>
|
||||
<td>${d.account_username}</td>
|
||||
<td><strong>${d.domain}</strong></td>
|
||||
<td>${d.ssl_enabled ? '<span class="badge badge-green">SSL</span>' : '—'}</td>
|
||||
<td style="font-size:.78rem">${(d.created_at||'').split('T')[0]}</td>
|
||||
<td></td>
|
||||
</tr>`).join('')}
|
||||
el.innerHTML = `<table class="table"><thead><tr><th>Account</th><th>Subdomain</th><th>SSL</th><th>Created</th></tr></thead><tbody>
|
||||
${rows.map(d=>`<tr><td>${d.acct_username}</td><td><strong>${d.domain}</strong></td>
|
||||
<td>${d.ssl_enabled?Nova.badge('SSL','green'):'—'}</td>
|
||||
<td style="font-size:.78rem">${(d.created_at||'').split('T')[0]}</td></tr>`).join('')}
|
||||
</tbody></table>`;
|
||||
};
|
||||
|
||||
@@ -4681,8 +4678,7 @@ window.adminParked = async function() {
|
||||
<div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:1rem">
|
||||
<p class="text-muted" style="margin:0">All parked/alias domains across all accounts.</p>
|
||||
</div>
|
||||
<div class="card"><div id="admin-park-list"><div class="loading">Loading…</div></div></div>`);
|
||||
`;
|
||||
<div class="card"><div id="admin-park-list"><div class="loading">Loading…</div></div></div>`;
|
||||
const el = document.getElementById('admin-park-list');
|
||||
const res = await Nova.api('accounts','list',{params:{per_page:200}});
|
||||
if (!res?.success || !res.data?.length) { el.innerHTML='<div class="empty">No accounts</div>'; return; }
|
||||
@@ -4691,15 +4687,13 @@ window.adminParked = async function() {
|
||||
const dr = await Nova.api('domains','list',{params:{account_id:acct.id}});
|
||||
if (!dr?.success) continue;
|
||||
const main = dr.data.find(d=>d.type==='main');
|
||||
dr.data.filter(d=>d.type==='parked'||d.type==='alias').forEach(d => rows.push({...d, account_username: acct.username, main_domain: main?.domain||acct.domain}));
|
||||
dr.data.filter(d=>d.type==='parked'||d.type==='alias').forEach(d=>rows.push({...d,acct_username:acct.username,main_domain:main?.domain||acct.domain}));
|
||||
}
|
||||
if (!rows.length) { el.innerHTML='<div class="empty">No parked domains found.</div>'; return; }
|
||||
el.innerHTML = `<table class="table"><thead><tr><th>Account</th><th>Parked Domain</th><th>Points To</th><th>Created</th></tr></thead><tbody>
|
||||
${rows.map(d=>`<tr>
|
||||
<td>${d.account_username}</td>
|
||||
<td><strong>${d.domain}</strong></td>
|
||||
${rows.map(d=>`<tr><td>${d.acct_username}</td><td><strong>${d.domain}</strong></td>
|
||||
<td style="color:var(--text-muted);font-size:.82rem">${d.main_domain}</td>
|
||||
<td style="font-size:.78rem">${(d.created_at||'').split('T')[0]}</td>
|
||||
</tr>`).join('')}
|
||||
<td style="font-size:.78rem">${(d.created_at||'').split('T')[0]}</td></tr>`).join('')}
|
||||
</tbody></table>`;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user