open-nomad/ui/app/templates/components/primary-metric.hbs
2021-01-26 10:53:26 -08: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>