feat: table style update
This commit is contained in:
parent
1a104b38ee
commit
92b414b50d
|
@ -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} />
|
||||||
|
|
|
@ -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(),
|
||||||
|
|
|
@ -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>
|
||||||
|
|
|
@ -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)}
|
||||||
|
|
|
@ -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} />
|
||||||
|
|
|
@ -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}
|
||||||
|
|
|
@ -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,
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue