open-nomad/ui/app/templates/components/topo-viz.hbs
2020-10-15 02:54:14 -07:00

22 lines
761 B
Handlebars

<div class="topo-viz" {{did-insert this.loadNodes}} {{did-insert this.captureElement}}>
{{#if this.isLoaded}}
{{#each this.datacenters as |dc|}}
<TopoViz::Datacenter
@datacenter={{dc.name}}
@nodes={{dc.nodes}}
@heightScale={{this.heightScale}}
@onAllocationSelect={{this.associateAllocations}}
@activeTaskGroup={{this.activeTaskGroup}}
@activeJobId={{this.activeJobId}} />
{{/each}}
{{#if this.activeAllocation}}
<svg class="chart topo-viz-edges" {{window-resize this.computedActiveEdges}}>
{{#each this.activeEdges as |edge|}}
<line class="edge" x1={{edge.x1}} y1={{edge.y1}} x2={{edge.x2}} y2={{edge.y2}} />
{{/each}}
</svg>
{{/if}}
{{/if}}
</div>