github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/app/templates/components/job-page/parts/recent-allocations.hbs (about)

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