{#if layout.racks.length === 0}
No rack placements yet
Open a machine or device and fill in the Rack section (rack name + U position) to see it here.
{:else}
{#each layout.racks as rack (rack.name)}
{rack.name}
{rack.heightU}U
{#each Array.from({ length: rack.heightU }, (_, i) => rack.heightU - i) as unit (unit)}
{unit}
{/each} {#each rack.slots as slot (`${slot.kind}:${slot.name}`)}
1 ? `–U${slot.unit + slot.heightU - 1}` : ''}`} on:click={() => dispatch('select', { kind: slot.kind, name: slot.name })} > {#if resolveIconPath(slot.iconKey)}
{/if}
{slot.name}
{slot.subtitle}
{slot.heightU}U
{/each}
{/each}
{#if layout.unracked.length > 0}
{layout.unracked.length} {layout.unracked.length === 1 ? 'entity is' : 'entities are'} not rack-mounted
{#each layout.unracked as entity (`${entity.kind}:${entity.name}`)}
dispatch('select', { kind: entity.kind, name: entity.name })} > {#if resolveIconPath(entity.iconKey)}
{:else}
{entity.kind === 'machine' ? '🖥' : '○'}
{/if}
{entity.name}
{entity.subtitle || entity.kind}
{/each}
{/if} {/if}