2018-06-12 21:06:37 +00:00
|
|
|
<PageHeader as |p|>
|
|
|
|
<p.top>
|
2018-08-16 17:48:24 +00:00
|
|
|
<nav class="breadcrumb">
|
|
|
|
<li>
|
|
|
|
{{#link-to "vault.cluster.policies" policyType data-test-policy-list-link=true}}
|
|
|
|
<span class="sep">/</span>
|
2019-03-29 23:40:12 +00:00
|
|
|
{{uppercase policyType}} policies
|
2018-08-16 17:48:24 +00:00
|
|
|
{{/link-to}}
|
|
|
|
</li>
|
|
|
|
</nav>
|
2018-06-12 21:06:37 +00:00
|
|
|
</p.top>
|
|
|
|
<p.levelLeft>
|
|
|
|
<h1 class="title is-3">
|
|
|
|
{{model.id}}
|
|
|
|
{{#if model.enforcementLevel}}
|
|
|
|
<span class="tag is-medium" aria-label="Enforcement level: {{model.enforcementLevel}}">
|
|
|
|
{{model.enforcementLevel}}
|
|
|
|
</span>
|
|
|
|
{{/if}}
|
|
|
|
</h1>
|
|
|
|
</p.levelLeft>
|
|
|
|
</PageHeader>
|
2019-02-14 16:04:46 +00:00
|
|
|
{{#if (and (not-eq model.id "root") (or capabilities.canUpdate capabilities.canDelete))}}
|
|
|
|
<Toolbar>
|
|
|
|
<ToolbarActions>
|
2019-04-29 15:19:03 +00:00
|
|
|
<ToolbarLink
|
2019-02-14 16:04:46 +00:00
|
|
|
@params={{array 'vault.cluster.policy.show' model.id}}
|
2019-04-29 15:19:03 +00:00
|
|
|
@data-test-policy-edit-toggle=true
|
2019-02-14 16:04:46 +00:00
|
|
|
>
|
|
|
|
Back to policy
|
2019-04-29 15:19:03 +00:00
|
|
|
</ToolbarLink>
|
2019-02-14 16:04:46 +00:00
|
|
|
<div class="toolbar-separator" />
|
|
|
|
{{#if (and (not-eq model.id "default") capabilities.canDelete)}}
|
|
|
|
{{#confirm-action
|
2019-04-29 15:19:03 +00:00
|
|
|
buttonClasses="toolbar-link"
|
2019-02-14 16:04:46 +00:00
|
|
|
onConfirmAction=(action "deletePolicy" model)
|
|
|
|
confirmMessage=(concat "Are you sure you want to delete " model.id "?")
|
|
|
|
data-test-policy-delete=true
|
|
|
|
}}
|
2019-05-13 19:05:25 +00:00
|
|
|
Delete
|
|
|
|
<Chevron @isButton={{true}} />
|
2019-02-14 16:04:46 +00:00
|
|
|
{{/confirm-action}}
|
|
|
|
{{/if}}
|
|
|
|
</ToolbarActions>
|
|
|
|
</Toolbar>
|
|
|
|
{{/if}}
|
2018-04-03 14:16:57 +00:00
|
|
|
<form {{action "savePolicy" model on="submit"}}>
|
|
|
|
<div class="box is-bottomless is-fullwidth is-marginless">
|
2018-08-16 17:48:24 +00:00
|
|
|
{{message-error model=model}}
|
|
|
|
<NamespaceReminder @mode="edit" @noun="policy" />
|
2019-02-14 16:04:46 +00:00
|
|
|
<label for="policy" class="is-label">Policy</label>
|
2018-04-03 14:16:57 +00:00
|
|
|
<div class="field">
|
|
|
|
{{ivy-codemirror
|
|
|
|
value=model.policy
|
|
|
|
valueUpdated=(action (mut model.policy))
|
|
|
|
options=(hash
|
|
|
|
lineNumbers=true
|
|
|
|
tabSize=2
|
|
|
|
mode='ruby'
|
|
|
|
theme='hashi'
|
|
|
|
extraKeys=(hash
|
|
|
|
Shift-Enter=(action "savePolicy" model)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
<div class="box is-shadowless is-fullwidth has-short-padding">
|
|
|
|
<p class="help-text has-text-grey-dark is-size-7">
|
|
|
|
You can use Alt+Tab (Option+Tab on MacOS) in the code editor to skip to the next field
|
|
|
|
</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{{#each model.additionalAttrs as |attr|}}
|
|
|
|
{{form-field data-test-field attr=attr model=model}}
|
|
|
|
{{/each}}
|
|
|
|
<div class="field is-grouped is-grouped-split is-fullwidth box is-bottomless">
|
|
|
|
<div class="field is-grouped">
|
|
|
|
{{#if capabilities.canUpdate}}
|
|
|
|
<div class="control">
|
|
|
|
<button
|
|
|
|
type="submit"
|
|
|
|
disabled={{buttonDisabled}}
|
|
|
|
class="button is-primary"
|
|
|
|
data-test-policy-save=true
|
|
|
|
>
|
|
|
|
Save
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
<div class="control">
|
2018-08-16 17:48:24 +00:00
|
|
|
{{#link-to "vault.cluster.policy.show" model.id replace=true class="button"}}
|
2018-04-03 14:16:57 +00:00
|
|
|
Cancel
|
2018-08-16 17:48:24 +00:00
|
|
|
{{/link-to}}
|
2018-04-03 14:16:57 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|