github.com/hernad/nomad@v1.6.112/ui/app/templates/components/job-page/parts/recent-allocations.hbs (about) 1 {{! 2 Copyright (c) HashiCorp, Inc. 3 SPDX-License-Identifier: MPL-2.0 4 ~}} 5 6 <div class="boxed-section"> 7 <div class="boxed-section-head"> 8 Recent Allocations 9 <span class="pull-right is-padded"> 10 <Toggle 11 @isActive={{this.showSubTasks}} 12 @onToggle={{this.toggleShowSubTasks}} 13 title="Show tasks of allocations" 14 >Show Tasks</Toggle> 15 </span> 16 </div> 17 <div 18 class="boxed-section-body 19 {{if this.job.allocations.length "is-full-bleed"}}" 20 > 21 {{#if this.job.allocations.length}} 22 <ListTable 23 @source={{this.sortedAllocations}} 24 @sortProperty={{this.sortProperty}} 25 @sortDescending={{this.sortDescending}} 26 @class="with-foot {{if this.showSubTasks "with-collapsed-borders"}}" as |t| 27 > 28 <t.head> 29 <th class="is-narrow"></th> 30 <th> 31 ID 32 </th> 33 <th> 34 Task Group 35 </th> 36 <th> 37 Created 38 </th> 39 <th> 40 Modified 41 </th> 42 <th> 43 Status 44 </th> 45 <th> 46 Version 47 </th> 48 <th> 49 Client 50 </th> 51 <th> 52 Volume 53 </th> 54 <th> 55 CPU 56 </th> 57 <th> 58 Memory 59 </th> 60 </t.head> 61 <t.body as |row|> 62 <AllocationRow 63 @data-test-allocation={{row.model.id}} 64 @allocation={{row.model}} 65 @context="job" 66 @onClick={{action "gotoAllocation" row.model}} 67 @showSubTasks={{this.showSubTasks}} 68 {{keyboard-shortcut 69 enumerated=true 70 action=(action "gotoAllocation" row.model) 71 }} 72 /> 73 74 {{#if this.showSubTasks}} 75 {{#each row.model.states as |task|}} 76 <TaskSubRow @namespan="9" @taskState={{task}} @active={{eq @activeTask (concat task.allocation.id "-" task.name)}} @onSetActiveTask={{@setActiveTaskQueryParam}} /> 77 {{/each}} 78 {{/if}} 79 </t.body> 80 </ListTable> 81 {{else}} 82 <div class="empty-message" data-test-empty-recent-allocations> 83 <h3 84 class="empty-message-headline" 85 data-test-empty-recent-allocations-headline 86 > 87 No Allocations 88 </h3> 89 <p 90 class="empty-message-body" 91 data-test-empty-recent-allocations-message 92 > 93 No allocations have been placed. 94 </p> 95 </div> 96 {{/if}} 97 </div> 98 {{#if this.job.allocations.length}} 99 <div class="boxed-section-foot"> 100 <p class="pull-right" data-test-view-all-allocations> 101 <LinkTo @route="jobs.job.allocations" @model={{this.job}}> 102 View all 103 {{this.job.allocations.length}} 104 {{pluralize "allocation" this.job.allocations.length}} 105 </LinkTo> 106 </p> 107 </div> 108 {{/if}} 109 </div>