update tags in deployment table

This commit is contained in:
kv
2024-01-17 00:45:19 -08:00
parent 25eb29946b
commit 71571e2625
2 changed files with 11 additions and 3 deletions

View File

@@ -39,7 +39,7 @@ export const Layout = () => {
<Link to={"/"} className="text-2xl tracking-widest">
MONITOR
</Link>
<div className="flex gap-4">
<div className="flex gap-2">
<ResourceTypeDropdown />
{type && <ResourcesDropdown />}
</div>
@@ -171,7 +171,7 @@ export const ResourceCard = ({
<CardContent className="text-sm text-muted-foreground">
<Components.Info id={id} />
</CardContent>
<CardFooter className="flex items-center justify-end gap-2">
<CardFooter className="flex items-center gap-2">
<ResourceTags target={{ type, id }} />
</CardFooter>
</Card>

View File

@@ -121,6 +121,8 @@ export const Deployment: RequiredResourceComponents = {
},
Table: () => {
const deployments = useRead("ListDeployments", {}).data;
const all_tags = useRead("ListTags", {}).data;
return (
<DataTable
data={deployments ?? []}
@@ -145,7 +147,13 @@ export const Deployment: RequiredResourceComponents = {
// header: "Description",
// accessorKey: "description",
// },
{ header: "Tags", accessorFn: ({ tags }) => tags.join(", ") },
{
header: "Tags",
accessorFn: ({ tags }) =>
tags
.map((t) => all_tags?.find((tg) => tg._id?.$oid === t)?.name)
.join(", "),
},
{
header: "Server",
cell: ({ row }) => {