Address tags incompatiblity introduced in 0.28.0-beta.2

From change (#2993)[https://github.com/juanfont/headscale/pull/2993]
This commit is contained in:
Paul Kronenwetter
2026-01-22 14:06:46 -05:00
parent a710995f97
commit c61a9119a7
5 changed files with 5 additions and 10 deletions
@@ -71,7 +71,7 @@ export default function MachineRow({
</p>
<div className="flex gap-1 flex-wrap mt-1.5">
{mapTagsToComponents(node, uiTags)}
{node.validTags.map((tag) => (
{node.tags.map((tag) => (
<Chip key={tag} text={tag} />
))}
</div>
+1 -1
View File
@@ -21,7 +21,7 @@ export default function Tags({
setIsOpen,
existingTags,
}: TagsProps) {
const [tags, setTags] = useState(machine.forcedTags);
const [tags, setTags] = useState(machine.tags);
const [tag, setTag] = useState('tag:');
const tagIsInvalid = useMemo(() => {
return tag.length === 0 || !tag.startsWith('tag:') || tags.includes(tag);
+1 -1
View File
@@ -41,7 +41,7 @@ export async function loader({ request, params, context }: Route.LoaderArgs) {
const lookup = await context.agents?.lookup([node.nodeKey]);
const [enhancedNode] = mapNodes([node], lookup);
const tags = Array.from(
new Set([...node.validTags, ...node.forcedTags]),
new Set([...node.tags]),
).sort();
return {
+1 -3
View File
@@ -22,9 +22,7 @@ export interface Machine {
| 'REGISTER_METHOD_CLI'
| 'REGISTER_METHOD_OIDC';
forcedTags: string[];
invalidTags: string[];
validTags: string[];
tags: string[];
givenName: string;
online: boolean;
+1 -4
View File
@@ -56,10 +56,7 @@ export function mapNodes(
export function sortNodeTags(nodes: Machine[]): string[] {
return Array.from(
new Set(
nodes.flatMap(({ validTags, forcedTags }) => [
...validTags,
...forcedTags,
]),
nodes.flatMap((node) => node.tags),
),
).sort();
}