open-nomad/ui/app/components/das/recommendation-row.hbs
Buck Doyle 20ec481090
Add DAS subroute and copy button (#9201)
This continues iteration on the DAS UI by adding the ability to directly
navigate to a recommendation summary by (namespaced) slug and a copy
button for the direct navigation link.

It includes a change to CopyButton allowing it to take a block that’s
rendered within the button.

It also changes some instances of multi-relationship traversal to use
in-summary attributes, such as summary.jobNamespace instead of
summary.job.namespace.name.
2020-11-04 12:22:24 -06:00

48 lines
1.3 KiB
Handlebars

{{#if @summary.taskGroup.allocations.length}}
{{!-- Prevent storing aggregate diffs until allocation count is known --}}
<tr
class="recommendation-row"
...attributes
data-test-recommendation-summary-row
{{did-insert this.storeDiffs}}
>
<td>
<div data-test-slug>
<span class='job'>{{@summary.taskGroup.job.name}}</span>
/
<span class='task-group'>{{@summary.taskGroup.name}}</span>
</div>
<div class='namespace'>
Namespace: <span data-test-namespace>{{@summary.jobNamespace}}</span>
</div>
</td>
<td data-test-date>
{{format-month-ts @summary.submitTime}}
</td>
<td data-test-allocation-count>
{{@summary.taskGroup.count}}
</td>
<td data-test-cpu>
{{#if this.cpu.delta}}
{{this.cpu.signedDiff}}
<span class='percent'>{{this.cpu.percentDiff}}</span>
{{/if}}
</td>
<td data-test-memory>
{{#if this.memory.delta}}
{{this.memory.signedDiff}}
<span class='percent'>{{this.memory.percentDiff}}</span>
{{/if}}
</td>
<td data-test-aggregate-cpu>
{{#if this.cpu.delta}}
{{this.cpu.signedAggregateDiff}}
{{/if}}
</td>
<td data-test-aggregate-memory>
{{#if this.memory.delta}}
{{this.memory.signedAggregateDiff}}
{{/if}}
</td>
</tr>
{{/if}}