diff --git a/app/dashboard/admin/alerts/page.tsx b/app/dashboard/admin/alerts/page.tsx
new file mode 100644
index 0000000..02f0e99
--- /dev/null
+++ b/app/dashboard/admin/alerts/page.tsx
@@ -0,0 +1,313 @@
+import React from "react";
+import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
+import { Badge } from "@/components/ui/badge";
+import { Button } from "@/components/ui/button";
+import { Alert, AlertDescription } from "@/components/ui/alert";
+import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
+import { AlertTriangle, CheckCircle, XCircle, Clock, Bell, Shield } from "lucide-react";
+
+export default function AdminAlertsPage() {
+ // Mock data for system alerts
+ const alerts = [
+ {
+ id: "1",
+ type: "security",
+ severity: "high",
+ title: "Suspicious Login Attempts",
+ description: "Multiple failed login attempts detected from IP 192.168.1.100",
+ timestamp: "2024-01-20 14:30:00",
+ status: "active",
+ affectedUsers: 3
+ },
+ {
+ id: "2",
+ type: "system",
+ severity: "medium",
+ title: "High Memory Usage",
+ description: "Server memory usage has exceeded 85% for the past hour",
+ timestamp: "2024-01-20 13:45:00",
+ status: "resolved",
+ affectedUsers: 0
+ },
+ {
+ id: "3",
+ type: "payment",
+ severity: "high",
+ title: "Payment Processing Error",
+ description: "Bitcoin payment gateway experiencing delays",
+ timestamp: "2024-01-20 12:15:00",
+ status: "active",
+ affectedUsers: 12
+ },
+ {
+ id: "4",
+ type: "user",
+ severity: "low",
+ title: "New Vendor Registration",
+ description: "New vendor 'tech_supplies' has registered and requires approval",
+ timestamp: "2024-01-20 11:20:00",
+ status: "pending",
+ affectedUsers: 1
+ },
+ {
+ id: "5",
+ type: "security",
+ severity: "critical",
+ title: "Potential Security Breach",
+ description: "Unusual API access patterns detected from multiple IPs",
+ timestamp: "2024-01-20 10:30:00",
+ status: "investigating",
+ affectedUsers: 0
+ }
+ ];
+
+ const getSeverityColor = (severity: string) => {
+ switch (severity) {
+ case "critical": return "destructive";
+ case "high": return "destructive";
+ case "medium": return "secondary";
+ case "low": return "outline";
+ default: return "outline";
+ }
+ };
+
+ const getStatusColor = (status: string) => {
+ switch (status) {
+ case "active": return "destructive";
+ case "resolved": return "default";
+ case "pending": return "secondary";
+ case "investigating": return "outline";
+ default: return "outline";
+ }
+ };
+
+ const getTypeIcon = (type: string) => {
+ switch (type) {
+ case "security": return
Monitor system alerts and security notifications
+Require attention
+Immediate action needed
+Successfully resolved
+Average resolution time
+Manage user bans and suspensions
+Currently banned
+Permanent suspensions
+Time-limited bans
+Awaiting review
+Send invitations to new vendors to join the platform
+{inviteLink}
+ john.doe@example.com
+Sent 2 hours ago
+jane.smith@example.com
+Accepted 1 day ago
+bob.wilson@example.com
+Expired 3 days ago
+Monitor and manage platform orders
+{error}
+Monitor and manage platform orders
+All platform orders
+Vendor accepted
+Payment received
+Successfully delivered
+Restricted area. Only admin1 can access.
diff --git a/app/dashboard/admin/settings/page.tsx b/app/dashboard/admin/settings/page.tsx new file mode 100644 index 0000000..1a4b055 --- /dev/null +++ b/app/dashboard/admin/settings/page.tsx @@ -0,0 +1,333 @@ +import React from "react"; +import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { Switch } from "@/components/ui/switch"; +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; +import { Textarea } from "@/components/ui/textarea"; +import { Separator } from "@/components/ui/separator"; +import { Settings, Shield, Bell, Database, Globe, Key, Save } from "lucide-react"; + +export default function AdminSettingsPage() { + return ( +Configure system settings and preferences
++ Temporarily disable public access +
++ Require 2FA for all admin accounts +
++ Auto-logout after inactivity +
++ Restrict admin access to specific IPs +
++ Send alerts via email +
++ Notify on security events +
++ Notify on system issues +
++ Notify on high-value orders +
++ Automatically backup database +
++ Log all API requests +
+Monitor system health and performance metrics
+{error}
+Monitor system health and performance metrics
++ Last checked: {new Date().toLocaleTimeString()} +
++ Total collections: 4 +
++ Total: {systemStatus ? formatBytes(systemStatus.memory.heapTotal) : 'N/A'} +
++ {systemStatus ? `${systemStatus.counts.orders} orders, ${systemStatus.counts.products} products` : 'N/A'} +
++ {systemStatus ? `V8: ${systemStatus.versions.v8}` : 'N/A'} +
+System health check completed
+2 minutes ago
+Database backup completed
+1 hour ago
+High memory usage detected
+3 hours ago
+Manage vendor accounts and permissions
+{error}
+Manage vendor accounts and permissions
+Registered vendors
++ {vendors.length > 0 ? Math.round((activeVendors.length / vendors.length) * 100) : 0}% active rate +
++ {vendors.length > 0 ? Math.round((suspendedVendors.length / vendors.length) * 100) : 0}% suspension rate +
+Administrative access
+