From 78ed615db3061aeb24ec9f175bd06b334fb88676 Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Tue, 11 Nov 2025 17:19:07 +0000 Subject: [PATCH] Create Staff Admin tools page cgen-9474faae6ff94df7b3fbc4c1e1fd033d --- client/pages/StaffAdmin.tsx | 346 ++++++++++++++++++++++++++++++++++++ 1 file changed, 346 insertions(+) create mode 100644 client/pages/StaffAdmin.tsx diff --git a/client/pages/StaffAdmin.tsx b/client/pages/StaffAdmin.tsx new file mode 100644 index 00000000..ff2a6ef7 --- /dev/null +++ b/client/pages/StaffAdmin.tsx @@ -0,0 +1,346 @@ +import { useState } from "react"; +import { useNavigate } from "react-router-dom"; +import Layout from "@/components/Layout"; +import { Button } from "@/components/ui/button"; +import { + Card, + CardContent, + CardHeader, + CardTitle, + CardDescription, +} from "@/components/ui/card"; +import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { Badge } from "@/components/ui/badge"; +import { Alert, AlertDescription } from "@/components/ui/alert"; +import { + Shield, + Users, + Settings, + Key, + BarChart3, + AlertTriangle, + ExternalLink, +} from "lucide-react"; + +export default function StaffAdmin() { + const navigate = useNavigate(); + const [activeTab, setActiveTab] = useState("users"); + const [newApiKey, setNewApiKey] = useState(""); + const [apiKeys] = useState([ + { + id: 1, + name: "Discord Integration", + key: "aethex_sk_****...****", + created: "2024-01-15", + lastUsed: "2024-01-20", + }, + { + id: 2, + name: "Analytics", + key: "aethex_sk_****...****", + created: "2024-01-10", + lastUsed: "2024-01-21", + }, + ]); + + return ( + +
+
+ {/* Header */} +
+
+

+ Administration +

+

+ + System configuration and management +

+
+ +
+ + {/* Tabs */} + + + + + + + Users + + + + Permissions + + + + Settings + + + + API Keys + + + + Audit Log + + + + {/* Users Tab */} + + + + + This interface allows management of AeThex users + + + +
+
+ + +
+ +
+
+
+
+

+ Total Users +

+

+ All registered accounts +

+
+

+ 2,487 +

+
+
+
+

+ Active Users +

+

+ Signed in this week +

+
+

+ 1,234 +

+
+
+
+

+ New This Month +

+

+ Recent sign-ups +

+
+

+ 287 +

+
+
+
+
+
+ + {/* Permissions Tab */} + +
+
+
+

Owner

+

Full system access

+
+ + 2 members + +
+
+
+
+

Admin

+

+ Management access +

+
+ + 5 members + +
+
+
+
+
+

Editor

+

Edit content

+
+ + 12 members + +
+
+
+
+ + {/* Settings Tab */} + +
+ + + System Settings + + +
+ +

+ Enable to restrict access during updates +

+ +
+
+
+
+
+ + {/* API Keys Tab */} + +
+
+ +
+ setNewApiKey(e.target.value)} + /> + +
+
+ +
+

Active Keys

+
+ {apiKeys.map((key) => ( +
+
+
+

+ {key.name} +

+

+ {key.key} +

+

+ Created: {key.created} | Last used:{" "} + {key.lastUsed} +

+
+ +
+
+ ))} +
+
+
+
+ + {/* Audit Log Tab */} + +
+
+ {[ + { + action: "User created", + details: "john.doe@example.com", + time: "2 hours ago", + user: "admin", + }, + { + action: "Settings updated", + details: "Discord integration enabled", + time: "5 hours ago", + user: "admin", + }, + { + action: "API key generated", + details: "Analytics key created", + time: "1 day ago", + user: "operations", + }, + ].map((log, i) => ( +
+
+

+ {log.action} +

+

+ {log.details} +

+
+
+

{log.time}

+ + {log.user} + +
+
+ ))} +
+
+
+
+
+
+
+
+
+ ); +}