Spaces:
Sleeping
Sleeping
Download static/js/admin_components/dashboard.js from Dilip8756/master-brain-api: direct link, hf CLI and curl.
- Browser
- Download file 852 Bytes
-
https://huggingface.co/spaces/Dilip8756/master-brain-api/resolve/main/static/js/admin_components/dashboard.js
- Command line
-
hf download hf://spaces/Dilip8756/master-brain-api/static/js/admin_components/dashboard.js
-
curl -L -o dashboard.js https://huggingface.co/spaces/Dilip8756/master-brain-api/resolve/main/static/js/admin_components/dashboard.js
852 Bytes
| /** | |
| * Admin Panel - Dashboard Logic | |
| */ | |
| async function loadDashboardStats() { | |
| try { | |
| const res = await fetch('/api/admin/stats'); | |
| const stats = await res.json(); | |
| document.getElementById('stat-pending-payments').innerText = stats.pending_payments; | |
| document.getElementById('stat-total-wallet').innerText = `₹${stats.total_wallet_balance}`; | |
| document.getElementById('stat-open-tickets').innerText = stats.open_tickets; | |
| document.getElementById('stat-active-users').innerText = stats.active_users; | |
| } catch (e) { | |
| console.error("Error loading dashboard stats:", e); | |
| } | |
| } | |
| function refreshDashboard() { | |
| loadDashboardStats(); | |
| if(typeof showToast === 'function') { | |
| showToast('success', 'Dashboard Refreshed', 'All data has been updated successfully'); | |
| } | |
| } |