๐Ÿ›ก๏ธ Admin Panel

SXMTOOLS Management Dashboard

๐Ÿ‘ฅ
0
Total Users
โญ
0
Premium Users
๐Ÿ“ฅ
0
Total Downloads
๐Ÿ“Š
0
Today's Downloads

๐Ÿ”ง System Status

Database: Connected
API: Healthy
Email: Active
Server: Running

๐Ÿงน Maintenance Tools

Clean up orphaned subscriptions from Dodo Payments (subscriptions that belong to deleted users)

๐Ÿ‘ฅ Users Management

Username Email Plan Verified Downloads Joined Actions
Loading...

๐Ÿ“ฆ Downloads Management

Add downloadable applications for the Downloads page

๐Ÿ“‹ Recent Activity Logs

[Loading...] Fetching recent logs...
// Cleanup orphaned subscriptions async function cleanupOrphanedSubscriptions() { const statusEl = document.getElementById('cleanupStatus'); const resultsEl = document.getElementById('cleanupResults'); if (!confirm('This will cancel all subscriptions in Dodo Payments that belong to deleted users. Continue?')) { return; } try { statusEl.textContent = '๐Ÿ”„ Running cleanup... This may take a moment.'; statusEl.style.color = '#f59e0b'; resultsEl.style.display = 'none'; const response = await fetch('/api/admin/cleanup-orphaned-subscriptions', { method: 'POST', credentials: 'include', headers: { 'Content-Type': 'application/json' } }); const data = await response.json(); if (response.ok) { statusEl.textContent = 'โœ… Cleanup completed successfully!'; statusEl.style.color = '#10b981'; // Show results resultsEl.style.display = 'block'; document.getElementById('cleanupTotal').textContent = data.summary.totalSubscriptions; document.getElementById('cleanupOrphaned').textContent = data.summary.orphanedFound; document.getElementById('cleanupCancelled').textContent = data.summary.successfullyCancelled; document.getElementById('cleanupErrors').textContent = data.summary.errors; // Show details const detailsEl = document.getElementById('cleanupDetails'); let detailsHTML = ''; if (data.orphaned.length > 0) { detailsHTML += '
Orphaned Subscriptions:
'; } if (data.errors.length > 0) { detailsHTML += '
Errors:
'; } if (data.orphaned.length === 0) { detailsHTML = '

๐ŸŽ‰ No orphaned subscriptions found! Everything is clean.

'; } detailsEl.innerHTML = detailsHTML; } else { statusEl.textContent = 'โŒ Cleanup failed: ' + (data.error || 'Unknown error'); statusEl.style.color = '#ef4444'; } } catch (error) { statusEl.textContent = 'โŒ Error: ' + error.message; statusEl.style.color = '#ef4444'; } } // Initialize checkAdminAccess();