mirror of
https://github.com/kemko/nomad.git
synced 2026-01-03 08:55:43 +03:00
31 lines
1.3 KiB
Handlebars
31 lines
1.3 KiB
Handlebars
{{!
|
|
Copyright (c) HashiCorp, Inc.
|
|
SPDX-License-Identifier: BUSL-1.1
|
|
~}}
|
|
|
|
<button {{action "toggleOpen"}} class="toggle-button {{if this.hasPendingAllocations "is-loading"}}" data-test-task-group-name type="button">
|
|
<Hds::Icon @name={{if this.isOpen "chevron-down" "chevron-right"}} @isInline={{true}} class="icon-vertical-bump-down" />
|
|
{{this.taskGroup.name}}
|
|
</button>
|
|
{{#if this.isOpen}}
|
|
<ul class="task-list">
|
|
{{#each this.sortedTasks as |task|}}
|
|
{{#if this.shouldOpenInNewWindow}}
|
|
<a {{on "click" (action "openInNewWindow" this.taskGroup.job this.taskGroup task)}} href="#" class="task-item" data-test-task>
|
|
<Exec::TaskContents
|
|
@task={{task}}
|
|
@active={{and this.currentRouteIsThisTaskGroup (eq task.name this.activeTaskName)}}
|
|
@shouldOpenInNewWindow={{this.shouldOpenInNewWindow}} />
|
|
</a>
|
|
{{else}}
|
|
<LinkTo @route="exec.task-group.task" @models={{array this.taskGroup.job.plainId this.taskGroup.name task.name}} class="task-item" data-test-task={{true}}>
|
|
<Exec::TaskContents
|
|
@task={{task}}
|
|
@active={{and this.currentRouteIsThisTaskGroup (eq task.name this.activeTaskName)}}
|
|
@shouldOpenInNewWindow={{this.shouldOpenInNewWindow}} />
|
|
</LinkTo>
|
|
{{/if}}
|
|
{{/each}}
|
|
</ul>
|
|
{{/if}}
|