dashboard stats

This commit is contained in:
usmannasir 2025-05-24 21:30:37 +05:00
parent 40ea6830d8
commit c6644a1a5d
2 changed files with 18 additions and 12 deletions

View File

@ -17,8 +17,8 @@
<!-- Info Cards Row -->
<div style="display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 30px;">
<!-- Total Sites Card -->
<div style="flex: 1; min-width: 200px; max-width: 300px;">
<div style="background: linear-gradient(135deg, #007bff 0%, #00c6ff 100%); color: #fff; padding: 20px; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,123,255,0.3); height: 100%;">
<a href="{% url 'loadWebsitesHome' %}" style="flex: 1; min-width: 200px; max-width: 300px; text-decoration: none;">
<div style="background: linear-gradient(135deg, #007bff 0%, #00c6ff 100%); color: #fff; padding: 20px; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,123,255,0.3); height: 100%; cursor: pointer;">
<div style="display: flex; align-items: center;">
<div style="font-size: 2.5rem; margin-right: 15px; opacity: 0.9;"><i class="fa fa-globe"></i></div>
<div>
@ -27,10 +27,10 @@
</div>
</div>
</div>
</div>
</a>
<!-- WordPress Sites Card -->
<div style="flex: 1; min-width: 200px; max-width: 300px;">
<div style="background: linear-gradient(135deg, #6f42c1 0%, #b993ff 100%); color: #fff; padding: 20px; border-radius: 15px; box-shadow: 0 4px 15px rgba(111,66,193,0.3); height: 100%;">
<a href="{% url 'loadWebsitesHome' %}?wp=1" style="flex: 1; min-width: 200px; max-width: 300px; text-decoration: none;">
<div style="background: linear-gradient(135deg, #6f42c1 0%, #b993ff 100%); color: #fff; padding: 20px; border-radius: 15px; box-shadow: 0 4px 15px rgba(111,66,193,0.3); height: 100%; cursor: pointer;">
<div style="display: flex; align-items: center;">
<div style="font-size: 2.5rem; margin-right: 15px; opacity: 0.9;"><i class="fa fa-wordpress"></i></div>
<div>
@ -39,10 +39,10 @@
</div>
</div>
</div>
</div>
</a>
<!-- Total Databases Card -->
<div style="flex: 1; min-width: 200px; max-width: 300px;">
<div style="background: linear-gradient(135deg, #17a2b8 0%, #6fe7dd 100%); color: #fff; padding: 20px; border-radius: 15px; box-shadow: 0 4px 15px rgba(23,162,184,0.3); height: 100%;">
<a href="{% url 'loadDatabaseHome' %}" style="flex: 1; min-width: 200px; max-width: 300px; text-decoration: none;">
<div style="background: linear-gradient(135deg, #17a2b8 0%, #6fe7dd 100%); color: #fff; padding: 20px; border-radius: 15px; box-shadow: 0 4px 15px rgba(23,162,184,0.3); height: 100%; cursor: pointer;">
<div style="display: flex; align-items: center;">
<div style="font-size: 2.5rem; margin-right: 15px; opacity: 0.9;"><i class="fa fa-database"></i></div>
<div>
@ -51,10 +51,10 @@
</div>
</div>
</div>
</div>
</a>
<!-- Total Emails Card -->
<div style="flex: 1; min-width: 200px; max-width: 300px;">
<div style="background: linear-gradient(135deg, #ff9800 0%, #ffc107 100%); color: #fff; padding: 20px; border-radius: 15px; box-shadow: 0 4px 15px rgba(255,152,0,0.3); height: 100%;">
<a href="{% url 'loadEmailHome' %}" style="flex: 1; min-width: 200px; max-width: 300px; text-decoration: none;">
<div style="background: linear-gradient(135deg, #ff9800 0%, #ffc107 100%); color: #fff; padding: 20px; border-radius: 15px; box-shadow: 0 4px 15px rgba(255,152,0,0.3); height: 100%; cursor: pointer;">
<div style="display: flex; align-items: center;">
<div style="font-size: 2.5rem; margin-right: 15px; opacity: 0.9;"><i class="fa fa-envelope"></i></div>
<div>
@ -63,7 +63,7 @@
</div>
</div>
</div>
</div>
</a>
</div>
<!-- Graphs Section -->

View File

@ -18,6 +18,8 @@ from django.views.decorators.csrf import ensure_csrf_cookie
from plogical.processUtilities import ProcessUtilities
from plogical.httpProc import httpProc
from websiteFunctions.models import Websites, WPSites
from databases.models import Databases
from mailServer.models import EUsers
# Create your views here.
@ -426,9 +428,13 @@ def getDashboardStats(request):
try:
total_sites = Websites.objects.count()
total_wp_sites = WPSites.objects.count()
total_dbs = Databases.objects.count()
total_emails = EUsers.objects.count()
data = {
'total_sites': total_sites,
'total_wp_sites': total_wp_sites,
'total_dbs': total_dbs,
'total_emails': total_emails,
'status': 1
}
return HttpResponse(json.dumps(data), content_type='application/json')