diff --git a/app/(dashboard)/OverviewClient.tsx b/app/(dashboard)/OverviewClient.tsx index 1f0993fc..9b20bee0 100644 --- a/app/(dashboard)/OverviewClient.tsx +++ b/app/(dashboard)/OverviewClient.tsx @@ -1,9 +1,8 @@ "use client"; import Link from "next/link"; -import Grid from "@mui/material/Grid"; -import { Card, CardActionArea, CardContent, Paper, Stack, Typography, Box } from "@mui/material"; -import BarChartIcon from "@mui/icons-material/BarChart"; +import { Card, CardContent } from "@/components/ui/card"; +import { BarChart2 } from "lucide-react"; import { ReactNode } from "react"; type StatCard = { @@ -35,155 +34,111 @@ export default function OverviewClient({ recentEvents: RecentEvent[]; }) { return ( - - - +
+
+ Control Center - - +

Welcome back, {userName} - - +

+

Everything you need to orchestrate Caddy proxies, certificates, and secure edge services lives here. - - +

+
- +
{stats.map((stat) => ( - - + - - - - {stat.icon} - - - {stat.count} - - - {stat.label} - - - - - + +
+ {stat.icon} +
+ + {stat.count} + + + {stat.label} + +
+ + ))} {/* Traffic (24h) card */} - - - - - - - - {trafficSummary ? ( - <> - - {trafficSummary.totalRequests.toLocaleString()} - - - Traffic (24h) - {trafficSummary.totalRequests > 0 && ( - 0 ? "error.light" : "text.secondary", fontSize: "0.8em" }}> - · {trafficSummary.blockedPercent}% blocked - - )} - - - ) : ( - <> - - Traffic (24h) - - )} - - - - - - - - - Recent Activity - - {recentEvents.length === 0 ? ( - + + +
+ +
+ {trafficSummary ? ( + <> + + {trafficSummary.totalRequests.toLocaleString()} + + + Traffic (24h) + {trafficSummary.totalRequests > 0 && ( + 0 ? "text-red-400" : "text-muted-foreground"}`} + > + · {trafficSummary.blockedPercent}% blocked + + )} + + + ) : ( + <> + + Traffic (24h) + + )} +
+ + +
+ +
+

Recent Activity

+ {recentEvents.length === 0 ? ( +
No activity recorded yet. - +
) : ( - +
{recentEvents.map((event, index) => ( - - {event.summary} - + {event.summary} + {new Date(event.created_at).toLocaleString()} - - + +
))} -
+
)} - - +
+ ); } diff --git a/app/(dashboard)/access-lists/AccessListsClient.tsx b/app/(dashboard)/access-lists/AccessListsClient.tsx index 82babb69..1c848f2c 100644 --- a/app/(dashboard)/access-lists/AccessListsClient.tsx +++ b/app/(dashboard)/access-lists/AccessListsClient.tsx @@ -1,23 +1,12 @@ "use client"; -import { - Box, - Button, - Card, - CardContent, - Divider, - IconButton, - List, - ListItem, - ListItemSecondaryAction, - ListItemText, - Pagination, - Stack, - TextField, - Typography -} from "@mui/material"; -import DeleteIcon from "@mui/icons-material/Delete"; -import type { AccessList } from "@/src/lib/models/access-lists"; +import { Trash2 } from "lucide-react"; +import { Button } from "@/components/ui/button"; +import { Card, CardContent } from "@/components/ui/card"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { Separator } from "@/components/ui/separator"; +import type { AccessList } from "@/lib/models/access-lists"; import { addAccessEntryAction, createAccessListAction, @@ -38,128 +27,157 @@ export default function AccessListsClient({ lists, pagination }: Props) { const searchParams = useSearchParams(); const pageCount = Math.ceil(pagination.total / pagination.perPage); - function handlePageChange(_: React.ChangeEvent, page: number) { + function handlePageChange(page: number) { const params = new URLSearchParams(searchParams.toString()); params.set("page", String(page)); router.push(`${pathname}?${params.toString()}`); } - return ( - - - - Access Lists - - Protect proxy hosts with HTTP basic authentication credentials. - - + return ( +
+
+

Access Lists

+

Protect proxy hosts with HTTP basic authentication credentials.

+
+ +
{lists.map((list) => ( - - updateAccessListAction(list.id, formData)} spacing={2}> - - Access List - - - - -