open-nomad/ui/app/components/primary-metric/task.hbs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
1.1 KiB
Handlebars
Raw Normal View History

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: MPL-2.0
}}
2021-03-22 07:46:37 +00:00
<div data-test-primary-metric class="primary-metric" ...attributes
2021-03-19 21:34:00 +00:00
{{did-insert this.start}}
2021-03-22 07:46:37 +00:00
{{did-update this.start @taskState @metric}}>
2021-03-19 21:34:00 +00:00
<h4 data-test-primary-metric-title class="title is-5">
{{#if (eq this.metric "cpu")}} CPU
{{else if (eq this.metric "memory")}} Memory
{{else}} {{this.metric}} {{/if}}
</h4>
<div class="primary-graphic">
<StatsTimeSeries @data={{this.data}} @chartClass={{this.chartClass}} />
</div>
<PrimaryMetric::CurrentValue @chartClass={{this.chartClass}} @percent={{this.data.lastObject.percent}} />
<div class="annotation" data-test-absolute-value>
{{#if (eq this.metric "cpu")}}
<strong>{{format-scheduled-hertz this.data.lastObject.used}}</strong> / {{format-scheduled-hertz this.reservedAmount}} Total
2021-03-19 21:34:00 +00:00
{{else if (eq this.metric "memory")}}
<strong>{{format-scheduled-bytes this.data.lastObject.used}}</strong> / {{format-scheduled-bytes this.reservedAmount start="MiB"}} Total
2021-03-19 21:34:00 +00:00
{{else}}
<strong>{{this.data.lastObject.used}}</strong> / {{this.reservedAmount}} Total
{{/if}}
</div>
</div>