feat: table style update

This commit is contained in:
Derock 2024-04-21 22:36:27 -04:00
parent 1a104b38ee
commit 92b414b50d
No known key found for this signature in database
7 changed files with 32 additions and 11 deletions

View file

@ -32,7 +32,7 @@ export default function ProjectHomeLayout({
})); }));
return ( return (
<div className="hidden space-y-6 py-10 md:block"> <div className="block space-y-6 py-10">
<div className="flex flex-col space-y-8 lg:flex-row lg:space-x-12 lg:space-y-0"> <div className="flex flex-col space-y-8 lg:flex-row lg:space-x-12 lg:space-y-0">
<aside className="lg:w-1/5"> <aside className="lg:w-1/5">
<SidebarNav items={items} /> <SidebarNav items={items} />

View file

@ -24,7 +24,7 @@ import { api } from "~/trpc/react";
import { type RouterOutputs } from "~/trpc/shared"; import { type RouterOutputs } from "~/trpc/shared";
const formValidator = z.object({ const formValidator = z.object({
replicas: z.coerce.number().int().positive(), replicas: z.coerce.number().int().min(0),
maxReplicasPerNode: z.number().int().positive().nullable(), maxReplicasPerNode: z.number().int().positive().nullable(),
deployMode: z.enum(["replicated", "global"]), deployMode: z.enum(["replicated", "global"]),
zeroDowntime: z.boolean(), zeroDowntime: z.boolean(),

View file

@ -40,7 +40,7 @@ export default function ContainersPage({
<TableHead>Uptime</TableHead> <TableHead>Uptime</TableHead>
<TableHead>Node</TableHead> <TableHead>Node</TableHead>
<TableHead>CPU</TableHead> <TableHead>CPU</TableHead>
<TableHead>Memory</TableHead> <TableHead>Memory (used/limit)</TableHead>
<TableHead>Network (RX/TX)</TableHead> <TableHead>Network (RX/TX)</TableHead>
<TableHead className="text-right">Actions</TableHead> <TableHead className="text-right">Actions</TableHead>
</TableRow> </TableRow>

View file

@ -45,7 +45,7 @@ export function ContainerEntry({
return ( return (
<> <>
<TableRow className="!border-b-0"> <TableRow>
<TableCell <TableCell
className="cursor-pointer font-mono text-sm text-muted-foreground" className="cursor-pointer font-mono text-sm text-muted-foreground"
onClick={() => { onClick={() => {
@ -95,7 +95,7 @@ export function ContainerEntry({
<TableCell>{uptimeText ?? "N/A"}</TableCell> <TableCell>{uptimeText ?? "N/A"}</TableCell>
<TableCell>{mainContainer?.node ?? "unknown"}</TableCell> <TableCell>{mainContainer?.node ?? "unknown"}</TableCell>
<TableCell>{mainContainer?.cpu?.toFixed(2) ?? "?"}%</TableCell> <TableCell>{mainContainer?.cpu?.toFixed(2) ?? "0.00"}%</TableCell>
<TableCell> <TableCell>
{prettyBytes(mainContainer?.usedMemory ?? 0)} /{" "} {prettyBytes(mainContainer?.usedMemory ?? 0)} /{" "}
{prettyBytes(mainContainer?.totalMemory ?? 0)} {prettyBytes(mainContainer?.totalMemory ?? 0)}

View file

@ -7,8 +7,10 @@ import {
ContainerIcon, ContainerIcon,
GlobeIcon, GlobeIcon,
HomeIcon, HomeIcon,
NetworkIcon,
SaveAllIcon, SaveAllIcon,
ServerCogIcon, ServerCogIcon,
TextIcon,
} from "lucide-react"; } from "lucide-react";
import { SidebarNav, type SidebarNavProps } from "~/components/SidebarNav"; import { SidebarNav, type SidebarNavProps } from "~/components/SidebarNav";
import { useProject } from "../../_context/ProjectContext"; import { useProject } from "../../_context/ProjectContext";
@ -38,6 +40,12 @@ const sidebarNavItems = [
href: "/deployments", href: "/deployments",
icon: CloudyIcon, icon: CloudyIcon,
}, },
{
title: "Logs",
description: "Logs for this service.",
href: "/logs",
icon: TextIcon,
},
{ {
type: "divider", type: "divider",
@ -56,6 +64,12 @@ const sidebarNavItems = [
href: "/domains", href: "/domains",
icon: GlobeIcon, icon: GlobeIcon,
}, },
{
title: "Network",
description: "Network settings",
href: "/network",
icon: NetworkIcon,
},
{ {
title: "Environment", title: "Environment",
description: "Environment settings", description: "Environment settings",
@ -88,7 +102,7 @@ export default function ProjectHomeLayout({
})) as SidebarNavProps["items"]; })) as SidebarNavProps["items"];
return ( return (
<div className="hidden space-y-6 py-10 md:block"> <div className="space-y-6 py-10">
<div className="flex flex-col space-y-8 lg:flex-row lg:space-x-12 lg:space-y-0"> <div className="flex flex-col space-y-8 lg:flex-row lg:space-x-12 lg:space-y-0">
<aside className="lg:w-1/5"> <aside className="lg:w-1/5">
<SidebarNav items={items} /> <SidebarNav items={items} />

View file

@ -30,7 +30,7 @@ export function SidebarNav({ className, items, ...props }: SidebarNavProps) {
return ( return (
<nav <nav
className={cn( className={cn(
"flex space-x-2 lg:flex-col lg:space-x-0 lg:space-y-1", "flex flex-col space-x-2 lg:space-x-0 lg:space-y-1",
className, className,
)} )}
{...props} {...props}

View file

@ -20,7 +20,14 @@ const TableHeader = React.forwardRef<
HTMLTableSectionElement, HTMLTableSectionElement,
React.HTMLAttributes<HTMLTableSectionElement> React.HTMLAttributes<HTMLTableSectionElement>
>(({ className, ...props }, ref) => ( >(({ className, ...props }, ref) => (
<thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} /> <thead
ref={ref}
className={cn(
"rounded-xl border bg-card bg-clip-border px-4 [&_tr]:border-b",
className,
)}
{...props}
/>
)); ));
TableHeader.displayName = "TableHeader"; TableHeader.displayName = "TableHeader";
@ -110,11 +117,11 @@ TableCaption.displayName = "TableCaption";
export { export {
Table, Table,
TableHeader,
TableBody, TableBody,
TableCaption,
TableCell,
TableFooter, TableFooter,
TableHead, TableHead,
TableHeader,
TableRow, TableRow,
TableCell,
TableCaption,
}; };