2019-06-21 15:18:26 +00:00
|
|
|
<PageHeader as |p|>
|
|
|
|
<p.top>
|
|
|
|
<nav class="breadcrumb">
|
|
|
|
<ul>
|
|
|
|
<li>
|
|
|
|
<span class="sep">
|
|
|
|
/
|
|
|
|
</span>
|
|
|
|
{{#link-to
|
|
|
|
"vault.cluster.access.method.item.list"
|
2019-07-23 19:56:22 +00:00
|
|
|
itemType
|
2019-06-21 15:18:26 +00:00
|
|
|
}}
|
|
|
|
{{pluralize itemType}}
|
|
|
|
{{/link-to}}
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</p.top>
|
|
|
|
<p.levelLeft>
|
|
|
|
{{#if (eq mode "show")}}
|
|
|
|
<h1 class="title is-3">
|
|
|
|
{{model.id}}
|
|
|
|
</h1>
|
|
|
|
{{else}}
|
|
|
|
<h1 class="title is-3">
|
|
|
|
{{capitalize mode}}
|
|
|
|
{{singularize itemType}}
|
2019-07-01 20:35:18 +00:00
|
|
|
{{#if (eq mode "edit")}}
|
|
|
|
{{model.id}}
|
|
|
|
{{/if}}
|
2019-06-21 15:18:26 +00:00
|
|
|
</h1>
|
|
|
|
{{/if}}
|
|
|
|
</p.levelLeft>
|
|
|
|
</PageHeader>
|
2019-07-01 20:35:18 +00:00
|
|
|
{{#if (eq mode "show")}}
|
2019-06-21 15:18:26 +00:00
|
|
|
<Toolbar>
|
|
|
|
<ToolbarActions>
|
|
|
|
<ConfirmAction @buttonClasses="toolbar-link" @onConfirmAction={{action "deleteItem"}}
|
2019-10-17 23:19:14 +00:00
|
|
|
@confirmMessage={{concat "Are you sure you want to delete " itemType " " model.id "?"}} @cancelButtonText="Cancel"
|
2019-06-21 15:18:26 +00:00
|
|
|
data-test-secret-delete="true">
|
|
|
|
Delete
|
|
|
|
{{itemType}}
|
|
|
|
</ConfirmAction>
|
2019-07-23 19:56:22 +00:00
|
|
|
<ToolbarLink @params={{array "vault.cluster.access.method.item.edit" itemType model.id}}
|
2019-06-21 15:18:26 +00:00
|
|
|
@data-test-configure-link="true">
|
2019-07-23 19:56:22 +00:00
|
|
|
Edit {{singularize itemType}}
|
2019-06-21 15:18:26 +00:00
|
|
|
</ToolbarLink>
|
|
|
|
</ToolbarActions>
|
|
|
|
</Toolbar>
|
|
|
|
{{/if}}
|
|
|
|
{{#if (eq mode "show")}}
|
|
|
|
<FieldGroupShow @model={{model}} @showAllFields=true />
|
|
|
|
{{else}}
|
|
|
|
<form {{action (perform saveModel) on="submit"}}>
|
|
|
|
<div class="box is-sideless is-fullwidth is-marginless">
|
|
|
|
<NamespaceReminder @mode="save" @noun={{itemType}} />
|
|
|
|
<MessageError @model={{model}} />
|
|
|
|
<FormFieldGroups @model={{model}} @mode={{mode}} />
|
|
|
|
</div>
|
|
|
|
<div class="field is-grouped-split box is-fullwidth is-bottomless">
|
|
|
|
<div class="control">
|
|
|
|
<button type="submit" data-test-save-config="true"
|
|
|
|
class="button is-primary {{if saveModel.isRunning "loading"}}" disabled={{saveModel.isRunning}}>
|
|
|
|
Save
|
|
|
|
</button>
|
|
|
|
{{#if (eq mode "create")}}
|
|
|
|
{{#link-to 'vault.cluster.access.method.item.list' class="button" data-test-cancel-link=true}}
|
|
|
|
Cancel
|
|
|
|
{{/link-to}}
|
|
|
|
{{else}}
|
|
|
|
{{#link-to 'vault.cluster.access.method.item.show' model.id class="button" data-test-cancel-link=true}}
|
|
|
|
Cancel
|
|
|
|
{{/link-to}}
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
2019-10-17 23:19:14 +00:00
|
|
|
{{/if}}
|