open-vault/ui/app/templates/vault/cluster/policy/show.hbs
2019-05-08 23:42:40 -06:00

76 lines
2.1 KiB
Handlebars

<PageHeader as |p|>
<p.top>
<nav class="breadcrumb">
<li>
{{#link-to "vault.cluster.policies" policyType data-test-policy-list-link=true}}
<span class="sep">&#x0002f;</span>
{{uppercase policyType}} policies
{{/link-to}}
</li>
</nav>
</p.top>
<p.levelLeft>
<h1 class="title is-3" data-test-policy-name="true">
{{model.id}}
{{#if model.enforcementLevel}}
<span class="tag" aria-label="Enforcement level: {{model.enforcementLevel}}">
{{model.enforcementLevel}}
</span>
{{/if}}
</h1>
</p.levelLeft>
</PageHeader>
<Toolbar>
<ToolbarActions>
<ToolbarDownloadButton
@classNames="toolbar-link"
@actionText="Download policy"
@extension={{if (eq policyType "acl") model.format "sentinel"}}
@filename=model.name
@data=model.policy
/>
{{#if (and (not-eq model.id "root") (or capabilities.canUpdate capabilities.canDelete))}}
<ToolbarLink
@params={{array 'vault.cluster.policy.edit' model.id}}
@data-test-policy-edit-toggle=true
>
Edit policy
</ToolbarLink>
{{/if}}
</ToolbarActions>
</Toolbar>
<div class="box is-bottomless is-fullwidth is-marginless">
<div class="field">
<label for="policy" class="is-label">
Policy
{{#if (eq policyType "acl")}}
<span class="tag is-white is-size-9 has-text-grey" data-test-acl-format>
({{uppercase model.format}} format)
</span>
{{/if}}
</label>
{{ivy-codemirror
value=model.policy
options=(hash
readOnly=true
lineNumbers=true
tabSize=2
mode='ruby'
theme='hashi'
)
}}
</div>
{{#if model.paths}}
<div class="field box is-shadowless no-bottom-padding is-marginless">
<h2 class="title is-6">Paths</h2>
<ul data-test-egp-paths>
{{#each model.paths as |path|}}
<li class="box has-slim-padding no-top-shadow is-marginless">
<code class="has-text-black">{{path}}</code>
</li>
{{/each}}
</ul>
</div>
{{/if}}
</div>