open-vault/ui/app/templates/components/selectable-card-container.hbs
Angel Garbarino 793ad94d08
Add Core Usage Metrics Components to Storybook (#8401)
* add core usage metrics components to storybook, rename component from small to simple

* remove const from js file

* remove grid container knob from selectable-card
2020-03-02 10:12:34 -07:00

75 lines
2.2 KiB
Handlebars

{{#linked-block
"vault.cluster.metrics.http-requests"
class="grid-item-http"
}}
<SelectableCard
@cardTitle="Http Requests"
@total={{totalHttpRequests}}
@subText="This month"
@gridContainer={{gridContainer}}
>
{{#if (eq counters.httpsRequests.length 1)}}
<div class="is-paddingless is-marginless">
<div class="level-item">
<PopupMenu name="engine-menu">
<nav class="menu">
<ul class="menu-list">
<li class="action">
{{#link-to "vault.cluster.metrics.http-requests"}}
View Details
{{/link-to}}
</li>
</ul>
</nav>
</PopupMenu>
</div>
</div>
{{else}}
<div class="change-metric">
<Icon @glyph="arrow-up" @size="xlm" aria-hidden="true" class="change-metric-icon {{if (gt percentChange 0) "is-increase" "is-decrease"}}"/>
{{#if (gt percentChange 0)}}
<p class="has-text-grey is-size-4 amount-change">+{{percentChange}}%</p>
{{else}}
<p class="has-text-grey is-size-4 amount-change">{{percentChange}}%</p>
{{/if}}
<p class="has-text-grey is-size-6 item-c">Since last month</p>
</div>
<HttpRequestsBarChartSimple @counters={{filteredHttpsRequests}}/>
{{#link-to "vault.cluster.metrics.http-requests" class="card-details"}} View Details {{/link-to}}
{{/if}}
</SelectableCard>
{{/linked-block}}
<SelectableCard
@cardTitle="Entities"
@total={{counters.totalEntities}}
@subText="Total"
>
<div class="is-paddingless is-marginless">
<div class="level-item">
<PopupMenu name="engine-menu">
<nav class="menu">
<ul class="menu-list">
<li class="action">
{{#link-to "vault.cluster.access.identity" "entities" data-test-link=true }}
Manage entities
{{/link-to}}
</li>
<li class="action">
{{#link-to "vault.cluster.access.identity.create" "entities" }}
Create entity
{{/link-to}}
</li>
</ul>
</nav>
</PopupMenu>
</div>
</div>
</SelectableCard>
<SelectableCard
@cardTitle="Tokens"
@total={{counters.totalTokens}}
@subText="Total"
/>