diff --git a/app/(dashboard)/l4-proxy-hosts/L4ProxyHostsClient.tsx b/app/(dashboard)/l4-proxy-hosts/L4ProxyHostsClient.tsx index 874fdd86..65a02ebd 100644 --- a/app/(dashboard)/l4-proxy-hosts/L4ProxyHostsClient.tsx +++ b/app/(dashboard)/l4-proxy-hosts/L4ProxyHostsClient.tsx @@ -2,15 +2,17 @@ import { useEffect, useRef, useState } from "react"; import { useRouter, usePathname, useSearchParams } from "next/navigation"; -import { Card, Chip, IconButton, Stack, Switch, Tooltip, Typography } from "@mui/material"; -import EditIcon from "@mui/icons-material/Edit"; -import DeleteIcon from "@mui/icons-material/Delete"; -import ContentCopyIcon from "@mui/icons-material/ContentCopy"; +import { Pencil, Trash2, Copy } from "lucide-react"; import type { L4ProxyHost } from "@/src/lib/models/l4-proxy-hosts"; import { toggleL4ProxyHostAction } from "./actions"; -import { PageHeader } from "@/src/components/ui/PageHeader"; -import { SearchField } from "@/src/components/ui/SearchField"; -import { DataTable } from "@/src/components/ui/DataTable"; +import { PageHeader } from "@/components/ui/PageHeader"; +import { SearchField } from "@/components/ui/SearchField"; +import { DataTable } from "@/components/ui/DataTable"; +import { Badge } from "@/components/ui/badge"; +import { Button } from "@/components/ui/button"; +import { Switch } from "@/components/ui/switch"; +import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; +import { Card, CardContent } from "@/components/ui/card"; import { CreateL4HostDialog, EditL4HostDialog, DeleteL4HostDialog } from "@/src/components/l4-proxy-hosts/L4HostDialogs"; import { L4PortsApplyBanner } from "@/src/components/l4-proxy-hosts/L4PortsApplyBanner"; @@ -77,9 +79,7 @@ export default function L4ProxyHostsClient({ hosts, pagination, initialSearch }: id: "name", label: "Name", render: (host: L4ProxyHost) => ( - - {host.name} - + {host.name} ), }, { @@ -87,40 +87,33 @@ export default function L4ProxyHostsClient({ hosts, pagination, initialSearch }: label: "Protocol", width: 80, render: (host: L4ProxyHost) => ( - + + {host.protocol.toUpperCase()} + ), }, { id: "listen", label: "Listen", render: (host: L4ProxyHost) => ( - - {host.listen_address} - + {host.listen_address} ), }, { id: "matcher", label: "Matcher", render: (host: L4ProxyHost) => ( - - {formatMatcher(host)} - + {formatMatcher(host)} ), }, { id: "upstreams", label: "Upstreams", render: (host: L4ProxyHost) => ( - + {host.upstreams[0]} {host.upstreams.length > 1 && ` +${host.upstreams.length - 1} more`} - + ), }, { @@ -129,96 +122,129 @@ export default function L4ProxyHostsClient({ hosts, pagination, initialSearch }: align: "right" as const, width: 150, render: (host: L4ProxyHost) => ( - + handleToggleEnabled(host.id, e.target.checked)} - size="small" - color="success" + onCheckedChange={(checked) => handleToggleEnabled(host.id, checked)} /> - - { - setDuplicateHost(host); - setCreateOpen(true); - }} - color="info" - > - - + + + { + setDuplicateHost(host); + setCreateOpen(true); + }} + > + + + + Duplicate - - setEditHost(host)} color="primary"> - - + + + setEditHost(host)} + > + + + + Edit - - setDeleteHost(host)} color="error"> - - + + + setDeleteHost(host)} + > + + + + Delete - + ), }, ]; const mobileCard = (host: L4ProxyHost) => ( - - - - - - {host.name} - - - - - handleToggleEnabled(host.id, e.target.checked)} - size="small" - color="success" - /> - - { - setDuplicateHost(host); - setCreateOpen(true); - }} - color="info" - > - - - - - setEditHost(host)} color="primary"> - - - - - setDeleteHost(host)} color="error"> - - - - - - - {host.listen_address} {"\u2192"} {host.upstreams[0]} - {host.upstreams.length > 1 ? ` +${host.upstreams.length - 1}` : ""} - - + + + + + + {host.name} + + {host.protocol.toUpperCase()} + + + + handleToggleEnabled(host.id, checked)} + /> + + + { + setDuplicateHost(host); + setCreateOpen(true); + }} + > + + + + Duplicate + + + + setEditHost(host)} + > + + + + Edit + + + + setDeleteHost(host)} + > + + + + Delete + + + + + {host.listen_address} {"\u2192"} {host.upstreams[0]} + {host.upstreams.length > 1 ? ` +${host.upstreams.length - 1}` : ""} + + + ); return ( - + )} - + ); }