open-nomad/ui/app/templates/components/job-page/parts/recent-allocations.hbs
Buck Doyle 2998deac50
Convert to angle bracket invocation (#8075)
This is mostly a direct application of the ember-angle-brackets-codemod.
I manually restored newlines in multi-line component invocations, usually
preserving file line length except for now-non-positional link-to @route.

I needed to rename task to taskState in some cases to avoid Ember
Concurrency naming conflicts.
2020-06-01 14:03:56 -05:00

48 lines
1.6 KiB
Handlebars

<div class="boxed-section">
<div class="boxed-section-head">
Recent Allocations
</div>
<div class="boxed-section-body {{if job.allocations.length "is-full-bleed"}}">
{{#if job.allocations.length}}
<ListTable
@source={{sortedAllocations}}
@sortProperty={{sortProperty}}
@sortDescending={{sortDescending}}
@class="with-foot" as |t|>
<t.head>
<th class="is-narrow"></th>
<th>ID</th>
<th>Task Group</th>
<th>Created</th>
<th>Modified</th>
<th>Status</th>
<th>Version</th>
<th>Client</th>
<th>Volume</th>
<th>CPU</th>
<th>Memory</th>
</t.head>
<t.body as |row|>
<AllocationRow
@data-test-allocation={{row.model.id}}
@allocation={{row.model}}
@context="job"
@onClick={{action "gotoAllocation" row.model}} />
</t.body>
</ListTable>
{{else}}
<div class="empty-message" data-test-empty-recent-allocations>
<h3 class="empty-message-headline" data-test-empty-recent-allocations-headline>No Allocations</h3>
<p class="empty-message-body" data-test-empty-recent-allocations-message>No allocations have been placed.</p>
</div>
{{/if}}
</div>
{{#if job.allocations.length}}
<div class="boxed-section-foot">
<p class="pull-right" data-test-view-all-allocations><LinkTo @route="jobs.job.allocations" @model={{job}}>
View all {{job.allocations.length}} {{pluralize "allocation" job.allocations.length}}
</LinkTo></p>
</div>
{{/if}}
</div>