Enhance admin dashboard analytics and system status

Added 'Year to Date' and 'Last Year' filters to analytics, and improved summary cards to show total revenue and orders for the selected period. Refactored SystemStatusCard to include a debug view with detailed system metrics and raw JSON response. Updated nav-item active state detection for more precision and improved navigation handling. Removed redundant recent activity card from admin status page.
This commit is contained in:
g
2025-11-28 19:22:14 +00:00
parent 4b0bd2cf8c
commit 3f8826cbc4
4 changed files with 133 additions and 85 deletions

View File

@@ -3,6 +3,7 @@ import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/com
import { Badge } from "@/components/ui/badge";
import { Server, Database, Cpu, HardDrive, Activity } from "lucide-react";
import { fetchServer } from "@/lib/api";
import SystemStatusCard from "@/components/admin/SystemStatusCard";
interface SystemStatus {
uptimeSeconds: number;
@@ -74,6 +75,8 @@ export default async function AdminStatusPage() {
<p className="text-sm text-muted-foreground mt-1">Monitor system health and performance metrics</p>
</div>
<SystemStatusCard />
<div className="grid gap-4 lg:gap-6 sm:grid-cols-2 lg:grid-cols-3">
{/* Server Status */}
<Card>
@@ -172,39 +175,6 @@ export default async function AdminStatusPage() {
</CardContent>
</Card>
</div>
{/* Recent Activity */}
<Card>
<CardHeader>
<CardTitle>Recent System Activity</CardTitle>
<CardDescription>Latest system events and changes</CardDescription>
</CardHeader>
<CardContent>
<div className="space-y-4">
<div className="flex items-center space-x-4">
<div className="w-2 h-2 bg-green-500 rounded-full"></div>
<div className="flex-1">
<p className="text-sm font-medium">System health check completed</p>
<p className="text-xs text-muted-foreground">2 minutes ago</p>
</div>
</div>
<div className="flex items-center space-x-4">
<div className="w-2 h-2 bg-blue-500 rounded-full"></div>
<div className="flex-1">
<p className="text-sm font-medium">Database backup completed</p>
<p className="text-xs text-muted-foreground">1 hour ago</p>
</div>
</div>
<div className="flex items-center space-x-4">
<div className="w-2 h-2 bg-yellow-500 rounded-full"></div>
<div className="flex-1">
<p className="text-sm font-medium">High memory usage detected</p>
<p className="text-xs text-muted-foreground">3 hours ago</p>
</div>
</div>
</div>
</CardContent>
</Card>
</div>
);
}