open-nomad/ui/app/templates/components/allocation-row.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

75 lines
3 KiB
Handlebars

<td data-test-indicators class="is-narrow">
{{#if allocation.unhealthyDrivers.length}}
<span data-test-icon="unhealthy-driver" class="tooltip text-center" role="tooltip" aria-label="Allocation depends on unhealthy drivers">
{{x-icon "warning" class="is-warning"}}
</span>
{{/if}}
{{#if allocation.nextAllocation}}
<span data-test-icon="reschedule" class="tooltip text-center" role="tooltip" aria-label="Allocation was rescheduled">
{{x-icon "history" class="is-faded"}}
</span>
{{/if}}
{{#if allocation.wasPreempted}}
<span data-test-icon="preemption" class="tooltip text-center" role="tooltip" aria-label="Allocation was preempted">
{{x-icon "boot" class="is-faded"}}
</span>
{{/if}}
</td>
<td data-test-short-id>
<LinkTo @route="allocations.allocation" @model={{allocation}} class="is-primary">
{{allocation.shortId}}
</LinkTo>
</td>
{{#if (eq context "job")}}
<td data-test-task-group>
<LinkTo @route="jobs.job.task-group" @models={{array allocation.job allocation.taskGroupName}} @query={{hash jobNamespace=allocation.job.namespace.id}}>
{{allocation.taskGroupName}}
</LinkTo>
</td>
{{/if}}
<td data-test-create-time>{{format-month-ts allocation.createTime}}</td>
<td data-test-modify-time>
<span class="tooltip" aria-label="{{format-month-ts allocation.modifyTime}}">
{{moment-from-now allocation.modifyTime}}
</span>
</td>
<td data-test-client-status class="is-one-line">
<span class="color-swatch {{allocation.clientStatus}}" /> {{allocation.clientStatus}}
</td>
{{#if (eq context "volume")}}
<td data-test-client><LinkTo @route="clients.client" @model={{allocation.node}}>{{allocation.node.shortId}}</LinkTo></td>
{{/if}}
{{#if (or (eq context "taskGroup") (eq context "job"))}}
<td data-test-job-version>{{allocation.jobVersion}}</td>
<td data-test-client><LinkTo @route="clients.client" @model={{allocation.node}}>{{allocation.node.shortId}}</LinkTo></td>
{{else if (or (eq context "node") (eq context "volume"))}}
<td>
{{#if (or allocation.job.isPending allocation.job.isReloading)}}
...
{{else}}
<LinkTo @route="jobs.job" @model={{allocation.job}} @query={{hash jobNamespace=allocation.job.namespace.id}} data-test-job>{{allocation.job.name}}</LinkTo>
<span class="is-faded" data-test-task-group>/ {{allocation.taskGroup.name}}</span>
{{/if}}
</td>
<td data-test-job-version class="is-1">{{allocation.jobVersion}}</td>
{{/if}}
{{#if (not (eq context "volume"))}}
<td data-test-volume>{{if allocation.taskGroup.volumes.length "Yes"}}</td>
{{/if}}
<td data-test-cpu class="is-1 has-text-centered">
<AllocationStat
@metric="cpu"
@allocation={{allocation}}
@statsTracker={{stats}}
@isLoading={{fetchStats.isRunning}}
@error={{statsError}} />
</td>
<td data-test-mem class="is-1 has-text-centered">
<AllocationStat
@metric="memory"
@allocation={{allocation}}
@statsTracker={{stats}}
@isLoading={{fetchStats.isRunning}}
@error={{statsError}} />
</td>