github.com/hernad/nomad@v1.6.112/ui/app/templates/components/allocation-row.hbs (about)

     1  {{!
     2    Copyright (c) HashiCorp, Inc.
     3    SPDX-License-Identifier: MPL-2.0
     4  ~}}
     5  
     6  <td data-test-indicators class="is-narrow">
     7    {{#if this.allocation.unhealthyDrivers.length}}
     8      <span
     9        data-test-icon="unhealthy-driver"
    10        class="tooltip text-center"
    11        role="tooltip"
    12        aria-label="Allocation depends on unhealthy drivers"
    13      >
    14        {{x-icon "alert-triangle" class="is-warning"}}
    15      </span>
    16    {{/if}}
    17    {{#if this.allocation.nextAllocation}}
    18      <span
    19        data-test-icon="reschedule"
    20        class="tooltip text-center"
    21        role="tooltip"
    22        aria-label="Allocation was rescheduled"
    23      >
    24        {{x-icon "history" class="is-faded"}}
    25      </span>
    26    {{/if}}
    27    {{#if this.allocation.wasPreempted}}
    28      <span
    29        data-test-icon="preemption"
    30        class="tooltip text-center"
    31        role="tooltip"
    32        aria-label="Allocation was preempted"
    33      >
    34        {{x-icon "boot" class="is-faded"}}
    35      </span>
    36    {{/if}}
    37  </td>
    38  <td data-test-short-id>
    39    <LinkTo
    40      @route="allocations.allocation"
    41      @model={{this.allocation.id}}
    42      class="is-primary"
    43    >
    44      {{this.allocation.shortId}}
    45    </LinkTo>
    46  </td>
    47  {{#if (eq this.context "job")}}
    48    <td data-test-task-group>
    49      <LinkTo
    50        @route="jobs.job.task-group"
    51        @models={{array
    52          (format-job-id this.allocation.job.id)
    53          this.allocation.taskGroupName
    54        }}
    55      >
    56        {{this.allocation.taskGroupName}}
    57      </LinkTo>
    58    </td>
    59  {{/if}}
    60  <td data-test-create-time>
    61    {{format-month-ts this.allocation.createTime}}
    62  </td>
    63  <td data-test-modify-time>
    64    <span
    65      class="tooltip"
    66      aria-label="{{format-month-ts this.allocation.modifyTime}}"
    67    >
    68      {{moment-from-now this.allocation.modifyTime}}
    69    </span>
    70  </td>
    71  <td data-test-client-status class="is-one-line">
    72    <span class="color-swatch {{this.allocation.clientStatus}}"></span>
    73    {{this.allocation.clientStatus}}
    74  </td>
    75  {{#if (eq this.context "volume")}}
    76    <td data-test-client>
    77      <Tooltip @text={{this.allocation.node.name}}>
    78        <LinkTo @route="clients.client" @model={{this.allocation.node}}>
    79          {{this.allocation.node.shortId}}
    80        </LinkTo>
    81      </Tooltip>
    82    </td>
    83  {{/if}}
    84  {{#if (or (eq this.context "taskGroup") (eq this.context "job"))}}
    85    <td data-test-job-version>
    86      {{this.allocation.jobVersion}}
    87    </td>
    88    <td data-test-client>
    89      <Tooltip @text={{this.allocation.node.name}}>
    90        <LinkTo @route="clients.client" @model={{this.allocation.node}}>
    91          {{this.allocation.node.shortId}}
    92        </LinkTo>
    93      </Tooltip>
    94    </td>
    95  {{else if (or (eq this.context "node") (eq this.context "volume"))}}
    96    <td>
    97      {{#if (or this.allocation.job.isPending this.allocation.job.isReloading)}}
    98        ...
    99      {{else}}
   100        <LinkTo
   101          @route="jobs.job"
   102          @model={{format-job-id this.allocation.job.id}}
   103          data-test-job
   104        >
   105          {{this.allocation.job.name}}
   106        </LinkTo>
   107        <span class="is-faded" data-test-task-group>
   108          /
   109          {{this.allocation.taskGroup.name}}
   110        </span>
   111      {{/if}}
   112    </td>
   113    <td data-test-job-version class="is-1">
   114      {{this.allocation.jobVersion}}
   115    </td>
   116  {{/if}}
   117  {{#if (not (eq this.context "volume"))}}
   118    <td data-test-volume>
   119      {{if this.allocation.taskGroup.volumes.length "Yes"}}
   120    </td>
   121  {{/if}}
   122  <td data-test-cpu class="is-1 has-text-centered">
   123    <AllocationStat
   124      @metric="cpu"
   125      @allocation={{this.allocation}}
   126      @statsTracker={{this.stats}}
   127      @isLoading={{this.fetchStats.isRunning}}
   128      @error={{this.statsError}}
   129    />
   130  </td>
   131  <td data-test-mem class="is-1 has-text-centered">
   132    <AllocationStat
   133      @metric="memory"
   134      @allocation={{this.allocation}}
   135      @statsTracker={{this.stats}}
   136      @isLoading={{this.fetchStats.isRunning}}
   137      @error={{this.statsError}}
   138    />
   139  </td>