mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-10-02 20:54:32 +02:00
Migrate plotgrid, adapt parent components with new snippets
This commit is contained in:
@@ -12,26 +12,19 @@
|
||||
Col,
|
||||
} from "@sveltestrap/sveltestrap";
|
||||
|
||||
export let itemsPerRow
|
||||
export let items
|
||||
|
||||
/* Migtation Notes
|
||||
* Requirements
|
||||
* - Parent Components must be already Migrated
|
||||
* - TODO: Job.root.svelte, Node.root.svelte
|
||||
* - DONE: Analysis, Status, User
|
||||
*
|
||||
* How-To
|
||||
* - Define "Plot-Slotcode" as SV5 Snippet with argument "item" in parent (!)
|
||||
* - Pass new snippet as argument/prop to here
|
||||
* - @render snippet in items-loop with argument == item
|
||||
*/
|
||||
/* Svelte 5 Props */
|
||||
let {
|
||||
items,
|
||||
itemsPerRow,
|
||||
gridContent
|
||||
} = $props();
|
||||
</script>
|
||||
|
||||
<Row cols={{ xs: 1, sm: 2, md: 3, lg: itemsPerRow}}>
|
||||
{#each items as item}
|
||||
<Col class="px-1">
|
||||
<slot {item}/>
|
||||
<!-- Note: Ignore '@' Error in IDE -->
|
||||
{@render gridContent(item)}
|
||||
</Col>
|
||||
{/each}
|
||||
</Row>
|
||||
|
@@ -182,6 +182,6 @@
|
||||
|
||||
</script>
|
||||
|
||||
<div class="cc-plot">
|
||||
<canvas bind:this={canvasElement} width="{width}" height="{height}"></canvas>
|
||||
<div class="cc-plot" bind:clientWidth={width}>
|
||||
<canvas bind:this={canvasElement} {width} {height}></canvas>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user