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")}}
|
2019-03-29 23:40:12 +00:00
|
|
|
Create an SSH role
|
2021-12-17 03:44:29 +00:00
|
|
|
{{else if (eq this.mode "edit")}}
|
2019-03-29 23:40:12 +00:00
|
|
|
Edit SSH role
|
2018-06-12 21:06:37 +00:00
|
|
|
{{else}}
|
2021-12-17 03:44:29 +00:00
|
|
|
SSH 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-02-14 16:04:46 +00:00
|
|
|
<Toolbar>
|
|
|
|
<ToolbarActions>
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if this.model.canDelete}}
|
|
|
|
<ConfirmAction @buttonClasses="toolbar-link" @onConfirmAction={{action "delete"}}>
|
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 (eq this.model.keyType "otp")}}
|
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"
|
2021-12-17 03:44:29 +00:00
|
|
|
@data-test-backend-credentials={{true}}
|
|
|
|
@replace={{true}}
|
2019-02-14 16:04:46 +00:00
|
|
|
>
|
2021-12-17 03:44:29 +00:00
|
|
|
Generate Credential
|
|
|
|
</ToolbarSecretLink>
|
2019-02-14 16:04:46 +00:00
|
|
|
{{else}}
|
2021-12-17 03:44:29 +00:00
|
|
|
<ToolbarSecretLink @secret={{this.model.id}} @mode="sign" @data-test-backend-credentials={{true}} @replace={{true}}>
|
2019-02-14 16:04:46 +00:00
|
|
|
Sign Keys
|
|
|
|
</ToolbarSecretLink>
|
|
|
|
{{/if}}
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if (or this.model.canUpdate this.model.canDelete)}}
|
|
|
|
<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}}
|
2019-02-14 16:04:46 +00:00
|
|
|
</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="SSH 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-ssh-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-fullwidth is-sideless is-paddingless is-marginless">
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#each this.model.showFields as |attr|}}
|
2021-05-26 18:29:52 +00:00
|
|
|
{{#if (eq attr.type "object")}}
|
2021-12-17 03:44:29 +00:00
|
|
|
<InfoTableRow
|
|
|
|
@label={{capitalize (or attr.options.label (humanize (dasherize attr.name)))}}
|
|
|
|
@value={{stringify (get this.model attr.name)}}
|
|
|
|
/>
|
2021-05-26 18:29:52 +00:00
|
|
|
{{else}}
|
2021-12-17 03:44:29 +00:00
|
|
|
<InfoTableRow
|
|
|
|
@label={{capitalize (or attr.options.label (humanize (dasherize attr.name)))}}
|
|
|
|
@value={{get this.model attr.name}}
|
|
|
|
/>
|
2021-05-26 18:29:52 +00:00
|
|
|
{{/if}}
|
|
|
|
{{/each}}
|
|
|
|
</div>
|
2021-12-17 03:44:29 +00:00
|
|
|
{{/if}}
|