headscale api changes tags in node object for version 0.28 (#216)

This commit is contained in:
Hans-Joachim Michl 2026-03-08 23:15:09 +01:00 committed by GitHub
parent a7f79824bf
commit 878027b9ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 7 additions and 7 deletions

View file

@ -4,9 +4,7 @@ export class Device {
public givenName: string = '';
public lastSeen: string = '';
public ipAddresses: string[] = [];
public forcedTags: string[] = [];
public validTags: string[] = [];
public invalidTags: string[] = [];
public tags: string[] = [];
public approvedRoutes: string[] = [];
public availableRoutes: string[] = [];
public subnetRoutes: string[] = [];

View file

@ -23,7 +23,7 @@
// only run if we have search contents set
if (get(deviceSearchStore)) {
let searcher = new Fuse(get(deviceStore), {
keys: ['id', 'givenName', 'name', 'forcedTags', 'validTags', 'user.name']
keys: ['id', 'givenName', 'name', 'tags', 'user.name']
});
// search using the searchstore term, and take the resultant array contents and set it to userFilterStore

View file

@ -6,7 +6,7 @@
export let device = new Device();
function updateTagsAction(tag: String) {
let tagList = device.forcedTags;
let tagList = device.tags;
// remove tag we're trying to remove
tagList = tagList.filter(element => element !== tag);
@ -18,12 +18,14 @@
$alertStore = error;
});
}
</script>
<div class="flex gap-1">
<span><NewDeviceTag {device}/></span>
{#each device.forcedTags as tag}
{#each device.tags as tag}
<span class="btn btn-xs btn-primary normal-case">{tag.replace("tag:","")}
<!-- Cancel symbol -->
<button on:click|stopPropagation={() => {updateTagsAction(tag)}}

View file

@ -9,7 +9,7 @@
export let device = new Device();
function updateTagsAction() {
let tagList = device.forcedTags;
let tagList = device.tags;
tagList.push(`tag:${newTag}`);
// remove duplicates
tagList = [...new Set(tagList)];