From 40a2eb41863327aab6eab1c545b4297eae9b61d2 Mon Sep 17 00:00:00 2001
From: Aarnav Tale
Date: Sun, 25 May 2025 10:26:50 -0400
Subject: [PATCH] fix: show tags on machine page
---
app/routes/machines/machine.tsx | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/app/routes/machines/machine.tsx b/app/routes/machines/machine.tsx
index 9ef6cb8..637d6be 100644
--- a/app/routes/machines/machine.tsx
+++ b/app/routes/machines/machine.tsx
@@ -47,9 +47,13 @@ export async function loader({
const lookup = await context.agents?.lookup([machine.node.nodeKey]);
const [node] = mapNodes([machine.node], lookup);
+ const tags = Array.from(
+ new Set([...node.validTags, ...node.forcedTags]),
+ ).sort();
return {
node,
+ tags,
users,
magic,
agent: context.agents?.agentID(),
@@ -62,7 +66,8 @@ export async function action(request: ActionFunctionArgs) {
}
export default function Page() {
- const { node, magic, users, agent, stats } = useLoaderData();
+ const { node, tags, magic, users, agent, stats } =
+ useLoaderData();
const [showRouting, setShowRouting] = useState(false);
const uiTags = useMemo(() => {
@@ -113,7 +118,7 @@ export default function Page() {
{mapTagsToComponents(node, uiTags)}
- {node.validTags.map((tag) => (
+ {tags.map((tag) => (
))}