open-nomad/ui/app/templates/components/allocation-row.hbs

77 lines
2.9 KiB
Handlebars
Raw Normal View History

2018-05-02 21:01:34 +00:00
<td data-test-indicators class="is-narrow">
2018-05-11 18:35:48 +00:00
{{#if allocation.unhealthyDrivers.length}}
<span data-test-icon="unhealthy-driver" class="tooltip text-center" aria-label="Allocation depends on unhealthy drivers">
2018-05-11 18:35:48 +00:00
{{x-icon "warning" class="is-warning"}}
</span>
{{/if}}
2018-05-02 21:01:34 +00:00
{{#if allocation.nextAllocation}}
<span data-test-icon="reschedule" class="tooltip text-center" aria-label="Allocation was rescheduled">
2018-05-02 21:01:34 +00:00
{{x-icon "history" class="is-faded"}}
</span>
{{/if}}
</td>
<td data-test-short-id>
{{#link-to "allocations.allocation" allocation class="is-primary"}}
2017-09-19 14:47:10 +00:00
{{allocation.shortId}}
{{/link-to}}
2017-09-19 14:47:10 +00:00
</td>
<td data-test-create-time>{{moment-format allocation.createTime "MM/DD HH:mm:ss"}}</td>
<td data-test-modify-time>{{moment-from-now allocation.modifyTime}}</td>
<td data-test-client-status class="is-one-line">
2017-09-19 14:47:10 +00:00
<span class="color-swatch {{allocation.clientStatus}}" /> {{allocation.clientStatus}}
</td>
{{#if (eq context "job")}}
<td data-test-job-version>{{allocation.jobVersion}}</td>
<td data-test-client>{{#link-to "clients.client" allocation.node}}{{allocation.node.shortId}}{{/link-to}}</td>
2017-09-19 14:47:10 +00:00
{{else if (eq context "node")}}
<td>
{{#if (or allocation.job.isPending allocation.job.isReloading)}}
...
{{else}}
{{#link-to "jobs.job" allocation.job (query-params jobNamespace=allocation.job.namespace.id) data-test-job}}{{allocation.job.name}}{{/link-to}}
<span class="is-faded" data-test-task-group>/ {{allocation.taskGroup.name}}</span>
{{/if}}
2017-09-19 14:47:10 +00:00
</td>
<td data-test-job-version class="is-1">{{allocation.jobVersion}}</td>
2017-09-19 14:47:10 +00:00
{{/if}}
<td data-test-cpu class="is-1 has-text-centered">
2018-03-22 21:34:57 +00:00
{{#if (and (not stats) fetchStats.isRunning)}}
2017-09-19 14:47:10 +00:00
...
2018-03-22 21:34:57 +00:00
{{else if (not allocation)}}
{{! nothing when there's no allocation}}
{{else if statsError}}
<span class="tooltip text-center" aria-label="Couldn't collect stats">
{{x-icon "warning" class="is-warning"}}
</span>
2017-09-19 14:47:10 +00:00
{{else}}
<div class="inline-chart is-small tooltip" aria-label="{{stats.cpuUsed}} / {{stats.reservedCPU}} MHz">
2017-09-19 14:47:10 +00:00
<progress
class="progress is-info is-small"
2018-03-22 21:34:57 +00:00
value="{{stats.percentCPU}}"
2017-09-19 14:47:10 +00:00
max="1">
2018-03-22 21:34:57 +00:00
{{stats.percentCPU}}
2017-09-19 14:47:10 +00:00
</progress>
</div>
{{/if}}
</td>
<td data-test-mem class="is-1 has-text-centered">
2018-03-22 21:34:57 +00:00
{{#if (and (not stats) fetchStats.isRunning)}}
2017-09-19 14:47:10 +00:00
...
2018-03-22 21:34:57 +00:00
{{else if (not allocation)}}
{{! nothing when there's no allocation}}
{{else if statsError}}
<span class="tooltip is-small text-center" aria-label="Couldn't collect stats">
{{x-icon "warning" class="is-warning"}}
</span>
2017-09-19 14:47:10 +00:00
{{else}}
2018-03-22 21:34:57 +00:00
<div class="inline-chart tooltip" aria-label="{{format-bytes stats.memoryUsed}} / {{stats.reservedMemory}} MiB">
2017-09-19 14:47:10 +00:00
<progress
class="progress is-danger is-small"
2018-03-22 21:34:57 +00:00
value="{{stats.percentMemory}}"
2017-09-19 14:47:10 +00:00
max="1">
2018-03-22 21:34:57 +00:00
{{stats.percentMemory}}
2017-09-19 14:47:10 +00:00
</progress>
</div>
{{/if}}
</td>