2018-06-12 21:06:37 +00:00
|
|
|
<PageHeader as |p|>
|
|
|
|
<p.top>
|
2021-12-17 03:44:29 +00:00
|
|
|
<KeyValueHeader
|
|
|
|
@baseKey={{this.model}}
|
|
|
|
@path="vault.cluster.secrets.backend.list"
|
|
|
|
@mode={{this.mode}}
|
|
|
|
@root={{this.root}}
|
|
|
|
@showCurrent={{true}}
|
|
|
|
/>
|
2018-06-12 21:06:37 +00:00
|
|
|
</p.top>
|
|
|
|
<p.levelLeft>
|
|
|
|
<h1 class="title is-3" data-test-secret-header="true">
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if (eq this.mode "create")}}
|
2018-06-12 21:06:37 +00:00
|
|
|
Create a PKI Role
|
2021-12-17 03:44:29 +00:00
|
|
|
{{else if (eq this.mode "edit")}}
|
2018-06-12 21:06:37 +00:00
|
|
|
Edit PKI Role
|
|
|
|
{{else}}
|
2021-12-17 03:44:29 +00:00
|
|
|
PKI Role
|
|
|
|
<code>{{this.model.id}}</code>
|
2018-06-12 21:06:37 +00:00
|
|
|
{{/if}}
|
|
|
|
</h1>
|
|
|
|
</p.levelLeft>
|
|
|
|
</PageHeader>
|
2018-04-03 14:16:57 +00:00
|
|
|
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if (eq this.mode "show")}}
|
2019-05-17 17:29:21 +00:00
|
|
|
<Toolbar>
|
|
|
|
<ToolbarActions>
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if this.model.canDelete}}
|
|
|
|
<ConfirmAction @buttonClasses="toolbar-link" @onConfirmAction={{action "delete"}} data-test-role-delete="true">
|
2021-10-22 14:11:14 +00:00
|
|
|
Delete role
|
|
|
|
</ConfirmAction>
|
2021-12-17 03:44:29 +00:00
|
|
|
<div class="toolbar-separator"></div>
|
2021-10-22 14:11:14 +00:00
|
|
|
{{/if}}
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if this.model.canGenerate}}
|
2019-02-14 16:04:46 +00:00
|
|
|
<ToolbarSecretLink
|
2021-12-17 03:44:29 +00:00
|
|
|
@secret={{this.model.id}}
|
2019-02-14 16:04:46 +00:00
|
|
|
@mode="credentials"
|
|
|
|
@queryParams={{query-params action="issue"}}
|
2021-12-17 03:44:29 +00:00
|
|
|
@data-test-credentials-link={{true}}
|
2019-02-14 16:04:46 +00:00
|
|
|
>
|
|
|
|
Generate Certificate
|
|
|
|
</ToolbarSecretLink>
|
|
|
|
{{/if}}
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if this.model.canSign}}
|
2019-02-14 16:04:46 +00:00
|
|
|
<ToolbarSecretLink
|
2021-12-17 03:44:29 +00:00
|
|
|
@secret={{this.model.id}}
|
2019-02-14 16:04:46 +00:00
|
|
|
@mode="credentials"
|
|
|
|
@queryParams={{query-params action="sign"}}
|
2021-12-17 03:44:29 +00:00
|
|
|
@data-test-sign-link={{true}}
|
2019-02-14 16:04:46 +00:00
|
|
|
>
|
|
|
|
Sign Certificate
|
|
|
|
</ToolbarSecretLink>
|
|
|
|
{{/if}}
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if this.model.canEdit}}
|
|
|
|
<ToolbarSecretLink @secret={{this.model.id}} @mode="edit" @data-test-edit-link={{true}} @replace={{true}}>
|
2019-05-17 17:29:21 +00:00
|
|
|
Edit role
|
|
|
|
</ToolbarSecretLink>
|
|
|
|
{{/if}}
|
|
|
|
</ToolbarActions>
|
|
|
|
</Toolbar>
|
|
|
|
{{/if}}
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if (or (eq this.mode "edit") (eq this.mode "create"))}}
|
2021-05-26 18:29:52 +00:00
|
|
|
<form onsubmit={{action "createOrUpdate" "create"}}>
|
|
|
|
<div class="box is-sideless is-fullwidth is-marginless">
|
2021-12-17 03:44:29 +00:00
|
|
|
<MessageError @model={{this.model}} />
|
|
|
|
<NamespaceReminder @mode={{this.mode}} @noun="PKI role" />
|
|
|
|
<FormFieldGroupsLoop @model={{this.model}} @mode={{this.mode}} />
|
2021-05-26 18:29:52 +00:00
|
|
|
</div>
|
|
|
|
<div class="field is-grouped-split box is-fullwidth is-bottomless">
|
|
|
|
<div class="control">
|
2021-12-17 03:44:29 +00:00
|
|
|
<button type="submit" disabled={{this.buttonDisabled}} class="button is-primary" data-test-role-create={{true}}>
|
|
|
|
{{#if (eq this.mode "create")}}
|
2021-05-26 18:29:52 +00:00
|
|
|
Create role
|
2021-12-17 03:44:29 +00:00
|
|
|
{{else if (eq this.mode "edit")}}
|
2021-05-26 18:29:52 +00:00
|
|
|
Save
|
|
|
|
{{/if}}
|
|
|
|
</button>
|
2021-12-17 03:44:29 +00:00
|
|
|
<SecretLink @mode={{if (eq this.mode "create") "list" "show"}} @class="button" @secret={{this.model.id}}>
|
2021-05-26 18:29:52 +00:00
|
|
|
Cancel
|
|
|
|
</SecretLink>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
2018-04-03 14:16:57 +00:00
|
|
|
{{else}}
|
2021-05-26 18:29:52 +00:00
|
|
|
<div class="box is-sideless is-fullwidth is-marginless">
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#each this.model.fieldGroups as |fieldGroup|}}
|
2021-05-26 18:29:52 +00:00
|
|
|
{{#each-in fieldGroup as |group fields|}}
|
|
|
|
{{#if (or (eq group "default") (eq group "Options"))}}
|
|
|
|
{{#each fields as |attr|}}
|
2021-12-17 03:44:29 +00:00
|
|
|
<InfoTableRow
|
|
|
|
@alwaysRender={{true}}
|
|
|
|
@label={{capitalize (or attr.options.label (humanize (dasherize attr.name)))}}
|
|
|
|
@value={{get this.model attr.name}}
|
|
|
|
/>
|
2021-05-26 18:29:52 +00:00
|
|
|
{{/each}}
|
|
|
|
{{else}}
|
|
|
|
<div class="box is-sideless is-fullwidth is-marginless">
|
|
|
|
<h2 class="title is-5">
|
|
|
|
{{group}}
|
|
|
|
</h2>
|
|
|
|
{{#each fields as |attr|}}
|
2021-12-17 03:44:29 +00:00
|
|
|
<InfoTableRow
|
|
|
|
@alwaysRender={{true}}
|
|
|
|
@label={{capitalize (or attr.options.label (humanize (dasherize attr.name)))}}
|
|
|
|
@value={{get this.model attr.name}}
|
|
|
|
/>
|
2021-05-26 18:29:52 +00:00
|
|
|
{{/each}}
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
{{/each-in}}
|
|
|
|
{{/each}}
|
|
|
|
</div>
|
2021-12-17 03:44:29 +00:00
|
|
|
{{/if}}
|