2020-10-12 05:58:44 +00:00
|
|
|
<div data-topo-viz-node class="topo-viz-node {{unless this.allocations.length "is-empty"}}" {{did-insert this.reloadNode}}>
|
2020-09-29 23:46:56 +00:00
|
|
|
{{#unless @isDense}}
|
2020-10-12 05:58:44 +00:00
|
|
|
<p data-test-label class="label">
|
2020-10-10 19:33:48 +00:00
|
|
|
{{#if @node.node.isDraining}}
|
2020-10-12 05:58:44 +00:00
|
|
|
<span data-test-status-icon class="tooltip" aria-label="Client is draining">{{x-icon "clock-outline" class="is-info"}}</span>
|
2020-10-10 19:33:48 +00:00
|
|
|
{{else if (not @node.node.isEligible)}}
|
2020-10-12 05:58:44 +00:00
|
|
|
<span data-test-status-icon class="tooltip" aria-label="Client is ineligible">{{x-icon "lock-closed" class="is-warning"}}</span>
|
2020-10-10 19:33:48 +00:00
|
|
|
{{/if}}
|
|
|
|
<strong>{{@node.node.name}}</strong>
|
2020-09-29 23:46:56 +00:00
|
|
|
<span class="bumper-left">{{this.count}} Allocs</span>
|
|
|
|
<span class="bumper-left is-faded">{{@node.memory}} MiB, {{@node.cpu}} Mhz</span>
|
|
|
|
</p>
|
|
|
|
{{/unless}}
|
2020-09-24 01:10:11 +00:00
|
|
|
<svg class="chart" height="{{this.totalHeight}}px" {{did-insert this.render}} {{did-update this.updateRender}} {{window-resize this.render}}>
|
2020-09-04 07:43:27 +00:00
|
|
|
<defs>
|
|
|
|
<clipPath id="{{this.maskId}}">
|
|
|
|
<rect class="mask" x="0" y="0" width="{{this.dimensionsWidth}}px" height="{{this.maskHeight}}px" rx="2px" ry="2px" />
|
|
|
|
</clipPath>
|
|
|
|
</defs>
|
2020-10-12 05:58:44 +00:00
|
|
|
<rect
|
|
|
|
data-test-node-background
|
|
|
|
class="node-background {{if @node.isSelected "is-selected"}} {{if @isDense "is-interactive"}}"
|
|
|
|
width="100%"
|
|
|
|
height="{{this.totalHeight}}px"
|
|
|
|
rx="2px"
|
|
|
|
ry="2px"
|
|
|
|
{{on "click" this.selectNode}} />
|
2020-09-11 04:17:09 +00:00
|
|
|
{{#if this.allocations.length}}
|
|
|
|
<g
|
|
|
|
class="dimensions {{if this.activeAllocation "is-active"}}"
|
|
|
|
transform="translate({{this.paddingLeft}},{{this.padding}})"
|
|
|
|
width="{{this.dimensionsWidth}}px"
|
|
|
|
height="{{this.maskHeight}}px"
|
|
|
|
pointer-events="all"
|
|
|
|
{{on "mouseout" this.clearHighlight}}
|
|
|
|
>
|
|
|
|
<g class="memory">
|
2020-09-11 07:56:14 +00:00
|
|
|
{{#if this.data.memoryLabel}}
|
|
|
|
<text class="label" aria-label="Memory" transform="translate({{this.data.memoryLabel.x}},{{this.data.memoryLabel.y}})">M</text>
|
|
|
|
{{/if}}
|
2020-09-11 04:17:09 +00:00
|
|
|
{{#if this.data.memoryRemainder}}
|
2020-09-11 02:29:25 +00:00
|
|
|
<rect
|
2020-09-11 04:17:09 +00:00
|
|
|
class="dimension-background"
|
|
|
|
x="{{this.data.memoryRemainder.x}}px"
|
|
|
|
width="{{this.data.memoryRemainder.width}}px"
|
|
|
|
height="{{this.height}}px" />
|
|
|
|
{{/if}}
|
2020-09-17 07:30:45 +00:00
|
|
|
{{#each this.data.memory key="allocation.id" as |memory|}}
|
2020-09-11 04:17:09 +00:00
|
|
|
<g
|
2020-10-12 05:58:44 +00:00
|
|
|
data-test-memory-rect="{{memory.allocation.allocation.id}}"
|
2020-09-24 01:10:11 +00:00
|
|
|
class="bar {{memory.className}} {{if (eq this.activeAllocation memory.allocation) "is-active"}} {{if memory.allocation.isSelected "is-selected"}}"
|
2020-09-11 04:17:09 +00:00
|
|
|
clip-path="url(#{{this.maskId}})"
|
2020-09-24 01:10:11 +00:00
|
|
|
data-allocation-id="{{memory.allocation.allocation.id}}"
|
2020-09-11 04:17:09 +00:00
|
|
|
{{on "mouseenter" (fn this.highlightAllocation memory.allocation)}}
|
|
|
|
{{on "click" (fn this.selectAllocation memory.allocation)}}>
|
2020-09-11 02:29:25 +00:00
|
|
|
<rect
|
|
|
|
width="{{memory.width}}px"
|
2020-09-24 01:10:11 +00:00
|
|
|
height="{{if memory.allocation.isSelected this.selectedHeight this.height}}px"
|
2020-09-11 02:29:25 +00:00
|
|
|
x="{{memory.x}}px"
|
2020-09-24 01:10:11 +00:00
|
|
|
y="{{if memory.allocation.isSelected 0.5 0}}px"
|
2020-09-11 04:17:09 +00:00
|
|
|
class="layer-0" />
|
|
|
|
{{#if (or (eq memory.className "starting") (eq memory.className "pending"))}}
|
|
|
|
<rect
|
|
|
|
width="{{memory.width}}px"
|
2020-09-24 01:10:11 +00:00
|
|
|
height="{{if memory.allocation.isSelected this.selectedHeight this.height}}px"
|
2020-09-11 04:17:09 +00:00
|
|
|
x="{{memory.x}}px"
|
2020-09-24 01:10:11 +00:00
|
|
|
y="{{if memory.allocation.isSelected 0.5 0}}px"
|
2020-09-11 04:17:09 +00:00
|
|
|
class="layer-1" />
|
|
|
|
{{/if}}
|
|
|
|
</g>
|
|
|
|
{{/each}}
|
|
|
|
</g>
|
|
|
|
<g class="cpu">
|
2020-09-11 07:56:14 +00:00
|
|
|
{{#if this.data.cpuLabel}}
|
|
|
|
<text class="label" aria-label="CPU" transform="translate({{this.data.cpuLabel.x}},{{this.data.cpuLabel.y}})">C</text>
|
|
|
|
{{/if}}
|
2020-09-11 04:17:09 +00:00
|
|
|
{{#if this.data.cpuRemainder}}
|
2020-09-11 02:29:25 +00:00
|
|
|
<rect
|
2020-09-11 04:17:09 +00:00
|
|
|
class="dimension-background"
|
|
|
|
x="{{this.data.cpuRemainder.x}}px"
|
|
|
|
y="{{this.yOffset}}px"
|
|
|
|
width="{{this.data.cpuRemainder.width}}px"
|
|
|
|
height="{{this.height}}px" />
|
|
|
|
{{/if}}
|
2020-09-17 07:30:45 +00:00
|
|
|
{{#each this.data.cpu key="allocation.id" as |cpu|}}
|
2020-09-11 04:17:09 +00:00
|
|
|
<g
|
2020-10-12 05:58:44 +00:00
|
|
|
data-test-cpu-rect="{{cpu.allocation.allocation.id}}"
|
2020-09-24 01:10:11 +00:00
|
|
|
class="bar {{cpu.className}} {{if (eq this.activeAllocation cpu.allocation) "is-active"}} {{if cpu.allocation.isSelected "is-selected"}}"
|
2020-09-11 04:17:09 +00:00
|
|
|
clip-path="url(#{{this.maskId}})"
|
2020-09-24 01:10:11 +00:00
|
|
|
data-allocation-id="{{cpu.allocation.allocation.id}}"
|
2020-09-11 04:17:09 +00:00
|
|
|
{{on "mouseenter" (fn this.highlightAllocation cpu.allocation)}}
|
|
|
|
{{on "click" (fn this.selectAllocation cpu.allocation)}}>
|
2020-09-11 02:29:25 +00:00
|
|
|
<rect
|
|
|
|
width="{{cpu.width}}px"
|
2020-09-24 01:10:11 +00:00
|
|
|
height="{{if cpu.allocation.isSelected this.selectedHeight this.height}}px"
|
2020-09-11 02:29:25 +00:00
|
|
|
x="{{cpu.x}}px"
|
2020-09-24 01:10:11 +00:00
|
|
|
y="{{if cpu.allocation.isSelected this.selectedYOffset this.yOffset}}px"
|
2020-09-11 04:17:09 +00:00
|
|
|
class="layer-0" />
|
|
|
|
{{#if (or (eq cpu.className "starting") (eq cpu.className "pending"))}}
|
|
|
|
<rect
|
|
|
|
width="{{cpu.width}}px"
|
2020-09-24 01:10:11 +00:00
|
|
|
height="{{if cpu.allocation.isSelected this.selectedHeight this.height}}px"
|
2020-09-11 04:17:09 +00:00
|
|
|
x="{{cpu.x}}px"
|
2020-09-24 01:10:11 +00:00
|
|
|
y="{{if cpu.allocation.isSelected this.selectedYOffset this.yOffset}}px"
|
2020-09-11 04:17:09 +00:00
|
|
|
class="layer-1" />
|
|
|
|
{{/if}}
|
|
|
|
</g>
|
|
|
|
{{/each}}
|
|
|
|
</g>
|
2020-09-04 07:43:27 +00:00
|
|
|
</g>
|
2020-10-10 19:20:41 +00:00
|
|
|
{{else}}
|
2020-10-12 05:58:44 +00:00
|
|
|
<text data-test-empty-message class="empty-text">Empty Client</text>
|
2020-09-11 04:17:09 +00:00
|
|
|
{{/if}}
|
2020-09-04 07:43:27 +00:00
|
|
|
</svg>
|
2020-09-03 02:37:13 +00:00
|
|
|
</div>
|
2020-09-04 07:43:27 +00:00
|
|
|
|