open-nomad/ui/app/templates/components/primary-metric.hbs
Buck Doyle 244157786a
Add explicit this to templates (#8388)
This is the result of running the no-implicit-this-codemod, some manual fixes,
and the addition of a linting rule to prevent future ambiguity.
2020-07-09 15:19:07 -05:00

29 lines
1.1 KiB
Handlebars

<h4 data-test-primary-metric-title class="title is-5">{{this.metricLabel}}</h4>
<div class="primary-graphic">
<StatsTimeSeries @data={{this.data}} @chartClass={{this.chartClass}} />
</div>
<div class="columns secondary-graphic">
<div class="column">
<div class="inline-chart" data-test-percentage-bar>
<progress
class="progress {{this.chartClass}} is-small"
value="{{this.data.lastObject.percent}}"
max="1">
{{this.data.lastObject.percent}}
</progress>
</div>
</div>
<div class="column is-minimum">
<span class="nowrap" data-test-percentage>{{format-percentage this.data.lastObject.percent total=1}}</span>
</div>
</div>
<div class="annotation" data-test-absolute-value>
{{#if (eq this.metric "cpu")}}
<strong>{{this.data.lastObject.used}} Mhz</strong> / {{this.reservedAmount}} Mhz reserved
{{else if (eq this.metric "memory")}}
<strong>{{format-bytes this.data.lastObject.used}}</strong> / {{this.reservedAmount}} MiB reserved
{{else}}
<strong>{{this.data.lastObject.used}}</strong> / {{this.reservedAmount}} reserved
{{/if}}
</div>