Files
nomad/ui/app/templates/components/job-page/parts/children.hbs
Phil Renaud 5d2688a257 [ui] Two small UI quality of life changes (#19377)
* Jobs index without groups

* Download button only appears if you have content in your template

* No longer need to test for the group count in jobs index
2023-12-08 11:21:14 -05:00

93 lines
2.5 KiB
Handlebars
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
~}}
<div class="boxed-section-head">
Job Launches
{{#if this.job.parameterized}}
{{#if (can "dispatch job" namespace=this.job.namespace)}}
<LinkTo
data-test-dispatch-button
@route="jobs.job.dispatch"
class="button is-primary is-compact pull-right"
>
Dispatch Job
</LinkTo>
{{else}}
<button
data-test-dispatch-button
class="button is-disabled is-primary is-compact pull-right tooltip multiline"
aria-label="You dont have permission to dispatch jobs"
disabled
type="button"
>
Dispatch Job
</button>
{{/if}}
{{/if}}
</div>
<div
class="boxed-section-body {{if this.sortedChildren.length "is-full-bleed"}}"
>
{{#if this.sortedChildren}}
<ListPagination
@source={{this.sortedChildren}}
@size={{this.pageSize}}
@page={{this.currentPage}} as |p|
>
<ListTable
@source={{p.list}}
@sortProperty={{this.sortProperty}}
@sortDescending={{this.sortDescending}}
@class="with-foot" as |t|
>
<t.head data-test-jobs-header>
<t.sort-by @prop="name">
Name
</t.sort-by>
<t.sort-by @prop="submitTime" data-test-jobs-submit-time-header>
Submitted At
</t.sort-by>
<t.sort-by @prop="status">
Status
</t.sort-by>
<th class="is-3">
Summary
</th>
</t.head>
<t.body @key="model.id" as |row|>
<JobRow data-test-job-row @job={{row.model}} @context="child" />
</t.body>
</ListTable>
<div class="table-foot">
<PageSizeSelect @onChange={{action this.resetPagination}} />
<nav class="pagination">
<div class="pagination-numbers">
{{p.startsAt}}
{{p.endsAt}}
of
{{this.sortedChildren.length}}
</div>
<p.prev @class="pagination-previous">
{{x-icon "chevron-left"}}
</p.prev>
<p.next @class="pagination-next">
{{x-icon "chevron-right"}}
</p.next>
<ul class="pagination-list"></ul>
</nav>
</div>
</ListPagination>
{{else}}
<div class="empty-message">
<h3 class="empty-message-headline">
No Job Launches
</h3>
<p class="empty-message-body">
No remaining living job launches.
</p>
</div>
{{/if}}
</div>