mirror of
https://github.com/tale/headplane.git
synced 2026-07-26 15:58:14 +00:00
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:
@@ -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>
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user