open-nomad/ui/app/templates/components/job-page/parts/title.hbs
2021-10-12 16:36:10 -04:00

40 lines
1.2 KiB
Handlebars

<h1 class="title with-flex">
<div data-test-job-name>
{{or this.title this.job.name}}
{{#if @job.meta.structured.pack}}
<span data-test-pack-tag class="tag is-hollow">
{{x-icon "box" class= "test"}}
<span>Pack</span>
</span>
{{/if}}
<span class="bumper-left tag {{this.job.statusClass}}" data-test-job-status>{{this.job.status}}</span>
{{yield}}
</div>
<div>
{{#if (not (eq this.job.status "dead"))}}
<div class="two-step-button">
<Exec::OpenButton @job={{this.job}} />
</div>
<TwoStepButton
data-test-stop
@alignRight={{true}}
@idleText="Stop"
@cancelText="Cancel"
@confirmText="Yes, Stop"
@confirmationMessage="Are you sure you want to stop this job?"
@awaitingConfirmation={{this.stopJob.isRunning}}
@onConfirm={{perform this.stopJob}} />
{{else}}
<TwoStepButton
data-test-start
@alignRight={{true}}
@idleText="Start"
@cancelText="Cancel"
@confirmText="Yes, Start"
@confirmationMessage="Are you sure you want to start this job?"
@awaitingConfirmation={{this.startJob.isRunning}}
@onConfirm={{perform this.startJob}} />
{{/if}}
</div>
</h1>