open-nomad/ui/app/templates/components/primary-metric.hbs
Buck Doyle 2998deac50
Convert to angle bracket invocation (#8075)
This is mostly a direct application of the ember-angle-brackets-codemod.
I manually restored newlines in multi-line component invocations, usually
preserving file line length except for now-non-positional link-to @route.

I needed to rename task to taskState in some cases to avoid Ember
Concurrency naming conflicts.
2020-06-01 14:03:56 -05:00

29 lines
1 KiB
Handlebars

<h4 data-test-primary-metric-title class="title is-5">{{metricLabel}}</h4>
<div class="primary-graphic">
<StatsTimeSeries @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>