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

29 lines
1 KiB
Handlebars

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