Migrate tags view

This commit is contained in:
Christoph Kluge 2025-06-05 10:51:32 +02:00
parent 1f103e5ef5
commit 24cf5047da
2 changed files with 13 additions and 6 deletions

View File

@ -24,15 +24,22 @@
init, init,
} from "./generic/utils.js"; } from "./generic/utils.js";
export let username; /* Svelte 5 Props */
export let isAdmin; let {
export let tagmap; username,
isAdmin,
presetTagmap,
} = $props();
/* Const Init */
const {} = init(); const {} = init();
const client = getContextClient(); const client = getContextClient();
let pendingChange = "none"; /* State Init */
let pendingChange = $state("none");
let tagmap = $state(presetTagmap)
/* Functions */
const removeTagMutation = ({ tagIds }) => { const removeTagMutation = ({ tagIds }) => {
return mutationStore({ return mutationStore({
client: client, client: client,
@ -96,7 +103,7 @@
<Button <Button
size="sm" size="sm"
color="danger" color="danger"
on:click={() => removeTag(tag, tagType)} onclick={() => removeTag(tag, tagType)}
> >
<Icon name="x" /> <Icon name="x" />
</Button> </Button>

View File

@ -7,7 +7,7 @@ mount(Tags, {
props: { props: {
username: username, username: username,
isAdmin: isAdmin, isAdmin: isAdmin,
tagmap: tagmap, presetTagmap: tagmap,
}, },
context: new Map([ context: new Map([
['cc-config', clusterCockpitConfig] ['cc-config', clusterCockpitConfig]