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

29 lines
1 KiB
Handlebars
Raw Normal View History

<h4 data-test-primary-metric-title class="title is-5">{{metricLabel}}</h4>
2018-09-14 17:20:33 +00:00
<div class="primary-graphic">
{{stats-time-series data=data chartClass=chartClass}}
</div>
2018-09-14 17:20:33 +00:00
<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>
2018-09-14 17:20:33 +00:00
{{#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>