open-nomad/ui/app/templates/components/job-row.hbs
Phil Renaud ffb4c63af7
[ui] Adds meta to job list stub and displays a pack logo on the jobs index (#14833)
* Adds meta to job list stub and displays a pack logo on the jobs index

* Changelog

* Modifying struct for optional meta param

* Explicitly ask for meta anytime I look up a job from index or job page

* Test case for the endpoint

* adding meta field to API struct and ommitting from response if empty

* passthru method added to api/jobs.list

* Meta param listed in docs for jobs list

* Update api/jobs.go

Co-authored-by: Tim Gross <tgross@hashicorp.com>

Co-authored-by: Tim Gross <tgross@hashicorp.com>
2022-11-02 16:58:24 -04:00

68 lines
1.4 KiB
Handlebars

<td data-test-job-name
{{keyboard-shortcut
enumerated=true
action=(action "gotoJob" @job)
}}
>
<LinkTo
@route="jobs.job.index"
@model={{this.job.idWithNamespace}}
class="is-primary"
>
{{this.job.name}}
{{#if this.job.meta.structured.pack}}
<span data-test-pack-tag class="tag is-pack">
{{x-icon "box" class= "test"}}
<span>Pack</span>
</span>
{{/if}}
</LinkTo>
</td>
{{#if this.system.shouldShowNamespaces}}
<td data-test-job-namespace>
{{this.job.namespace.name}}
</td>
{{/if}}
{{#if (eq @context "child")}}
<td data-test-job-submit-time>
{{format-month-ts this.job.submitTime}}
</td>
{{/if}}
<td data-test-job-status>
<span class="tag {{this.job.statusClass}}">
{{this.job.status}}
</span>
</td>
<td data-test-job-type>
{{this.job.displayType}}
</td>
<td data-test-job-priority>
{{this.job.priority}}
</td>
<td data-test-job-task-groups>
{{#if this.job.taskGroupCount}}
{{this.job.taskGroupCount}}
{{else}}
--
{{/if}}
</td>
<td data-test-job-allocations>
<div class="inline-chart">
{{#if this.job.hasChildren}}
{{#if (gt this.job.totalChildren 0)}}
<ChildrenStatusBar @job={{this.job}} @isNarrow={{true}} />
{{else}}
<em class="is-faded">
No Children
</em>
{{/if}}
{{else}}
<AllocationStatusBar
@allocationContainer={{this.job}}
@isNarrow={{true}}
/>
{{/if}}
</div>
</td>