open-nomad/ui/app/templates/components/lifecycle-chart.hbs
Jasmine Dahilig a9004faa11
UI: Add representations for task lifecycles (#7659)
This adds details about task lifecycles to allocations, task groups,
and tasks. It includes a live-updating timeline-like chart on allocations.
2020-04-30 08:15:19 -05:00

34 lines
1.1 KiB
Handlebars

{{#if (gt lifecyclePhases.length 1)}}
<div class="boxed-section" data-test-lifecycle-chart>
<div class="boxed-section-head">
Task Lifecycle {{if taskStates "Status" "Configuration"}}
</div>
<div class="boxed-section-body lifecycle-chart">
<div class="lifecycle-phases">
{{#each lifecyclePhases as |phase|}}
<div class="lifecycle-phase {{if phase.isActive "is-active"}} {{if (eq phase.name "Main") "main" "prestart"}}" data-test-lifecycle-phase>
<div class="name" data-test-name>{{phase.name}}</div>
</div>
{{/each}}
<svg class="divider">
<line x1="0" y1="0" x2="0" y2="100%" />
</svg>
</div>
<div class="lifecycle-chart-rows">
{{#if tasks}}
{{#each sortedLifecycleTasks as |task|}}
{{lifecycle-chart-row task=task}}
{{/each}}
{{else}}
{{#each sortedLifecycleTaskStates as |state|}}
{{lifecycle-chart-row taskState=state task=state.task}}
{{/each}}
{{/if}}
</div>
</div>
</div>
{{/if}}