github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/ui/app/templates/components/topo-viz/node.hbs (about) 1 <div data-test-topo-viz-node class="topo-viz-node {{unless this.allocations.length "is-empty"}}" {{did-insert this.reloadNode}}> 2 {{#unless @isDense}} 3 <p data-test-label class="label"> 4 {{#if @node.node.isDraining}} 5 <span data-test-status-icon class="tooltip" aria-label="Client is draining">{{x-icon "clock-outline" class="is-info"}}</span> 6 {{else if (not @node.node.isEligible)}} 7 <span data-test-status-icon class="tooltip" aria-label="Client is ineligible">{{x-icon "lock-closed" class="is-warning"}}</span> 8 {{/if}} 9 <strong>{{@node.node.name}}</strong> 10 <span class="bumper-left">{{this.count}} Allocs</span> 11 <span class="bumper-left is-faded">{{@node.memory}} MiB, {{@node.cpu}} MHz</span> 12 </p> 13 {{/unless}} 14 <svg 15 data-test-topo-node-svg 16 class="chart" 17 height="{{this.totalHeight}}px" 18 {{did-insert this.render}} 19 {{did-update this.updateRender}} 20 {{window-resize this.render}} 21 {{on "mouseout" this.allocationBlur}}> 22 <defs> 23 <clipPath id="{{this.maskId}}"> 24 <rect class="mask" x="0" y="0" width="{{this.dimensionsWidth}}px" height="{{this.maskHeight}}px" rx="2px" ry="2px" /> 25 </clipPath> 26 </defs> 27 <rect 28 data-test-node-background 29 class="node-background {{if @node.isSelected "is-selected"}} {{if @isDense "is-interactive"}}" 30 width="100%" 31 height="{{this.totalHeight}}px" 32 rx="2px" 33 ry="2px" 34 {{on "click" this.selectNode}} /> 35 {{#if this.allocations.length}} 36 <g 37 class="dimensions {{if this.activeAllocation "is-active"}}" 38 transform="translate({{this.paddingLeft}},{{this.padding}})" 39 width="{{this.dimensionsWidth}}px" 40 height="{{this.maskHeight}}px" 41 pointer-events="all" 42 {{on "mouseleave" this.clearHighlight}} 43 > 44 <g class="memory"> 45 {{#if this.data.memoryLabel}} 46 <text class="label" aria-label="Memory" transform="translate({{this.data.memoryLabel.x}},{{this.data.memoryLabel.y}})">M</text> 47 {{/if}} 48 {{#if this.data.memoryRemainder}} 49 <rect 50 class="dimension-background" 51 x="{{this.data.memoryRemainder.x}}px" 52 width="{{this.data.memoryRemainder.width}}px" 53 height="{{this.height}}px" /> 54 {{/if}} 55 {{#each this.data.memory key="allocation.id" as |memory|}} 56 <g 57 data-test-memory-rect="{{memory.allocation.allocation.id}}" 58 class="bar {{memory.className}} {{if (eq this.activeAllocation memory.allocation) "is-active"}} {{if memory.allocation.isSelected "is-selected"}}" 59 clip-path="url(#{{this.maskId}})" 60 data-allocation-id="{{memory.allocation.allocation.id}}" 61 {{on "mouseenter" (fn this.highlightAllocation memory.allocation)}} 62 {{on "click" (fn this.selectAllocation memory.allocation)}}> 63 <rect 64 width="{{memory.width}}px" 65 height="{{if memory.allocation.isSelected this.selectedHeight this.height}}px" 66 x="{{memory.x}}px" 67 y="{{if memory.allocation.isSelected 0.5 0}}px" 68 class="layer-0" /> 69 {{#if (or (eq memory.className "starting") (eq memory.className "pending"))}} 70 <rect 71 width="{{memory.width}}px" 72 height="{{if memory.allocation.isSelected this.selectedHeight this.height}}px" 73 x="{{memory.x}}px" 74 y="{{if memory.allocation.isSelected 0.5 0}}px" 75 class="layer-1" /> 76 {{/if}} 77 </g> 78 {{/each}} 79 </g> 80 <g class="cpu"> 81 {{#if this.data.cpuLabel}} 82 <text class="label" aria-label="CPU" transform="translate({{this.data.cpuLabel.x}},{{this.data.cpuLabel.y}})">C</text> 83 {{/if}} 84 {{#if this.data.cpuRemainder}} 85 <rect 86 class="dimension-background" 87 x="{{this.data.cpuRemainder.x}}px" 88 y="{{this.yOffset}}px" 89 width="{{this.data.cpuRemainder.width}}px" 90 height="{{this.height}}px" /> 91 {{/if}} 92 {{#each this.data.cpu key="allocation.id" as |cpu|}} 93 <g 94 data-test-cpu-rect="{{cpu.allocation.allocation.id}}" 95 class="bar {{cpu.className}} {{if (eq this.activeAllocation cpu.allocation) "is-active"}} {{if cpu.allocation.isSelected "is-selected"}}" 96 clip-path="url(#{{this.maskId}})" 97 data-allocation-id="{{cpu.allocation.allocation.id}}" 98 {{on "mouseenter" (fn this.highlightAllocation cpu.allocation)}} 99 {{on "click" (fn this.selectAllocation cpu.allocation)}}> 100 <rect 101 width="{{cpu.width}}px" 102 height="{{if cpu.allocation.isSelected this.selectedHeight this.height}}px" 103 x="{{cpu.x}}px" 104 y="{{if cpu.allocation.isSelected this.selectedYOffset this.yOffset}}px" 105 class="layer-0" /> 106 {{#if (or (eq cpu.className "starting") (eq cpu.className "pending"))}} 107 <rect 108 width="{{cpu.width}}px" 109 height="{{if cpu.allocation.isSelected this.selectedHeight this.height}}px" 110 x="{{cpu.x}}px" 111 y="{{if cpu.allocation.isSelected this.selectedYOffset this.yOffset}}px" 112 class="layer-1" /> 113 {{/if}} 114 </g> 115 {{/each}} 116 </g> 117 </g> 118 {{else}} 119 <g class="empty-text"><text data-test-empty-message>Empty Client</text></g> 120 {{/if}} 121 </svg> 122 </div> 123