2018-06-12 21:06:37 +00:00
|
|
|
<PageHeader as |p|>
|
|
|
|
<p.levelLeft>
|
2022-01-10 17:08:05 +00:00
|
|
|
<h1 class="title is-3 title-with-icon" data-test-mount-form-header="true">
|
2021-12-17 03:44:29 +00:00
|
|
|
{{#if this.showEnable}}
|
2022-12-16 21:26:43 +00:00
|
|
|
{{#let (find-by "type" @mountModel.type @mountTypes) as |typeInfo|}}
|
2022-01-10 17:08:05 +00:00
|
|
|
<Icon @name={{or typeInfo.glyph typeInfo.type}} @size="24" class="has-text-grey-light" />
|
2022-12-16 21:26:43 +00:00
|
|
|
{{#if (eq @mountType "secret")}}
|
2019-03-29 23:40:12 +00:00
|
|
|
{{concat "Enable " typeInfo.displayName " Secrets Engine"}}
|
2022-12-16 21:26:43 +00:00
|
|
|
{{else}}
|
|
|
|
{{concat "Enable " typeInfo.displayName " Authentication Method"}}
|
2018-08-28 05:03:55 +00:00
|
|
|
{{/if}}
|
2022-03-21 20:36:21 +00:00
|
|
|
{{/let}}
|
2022-12-16 21:26:43 +00:00
|
|
|
{{else if (eq @mountType "secret")}}
|
2019-03-29 23:40:12 +00:00
|
|
|
Enable a Secrets Engine
|
2022-12-16 21:26:43 +00:00
|
|
|
{{else}}
|
|
|
|
Enable an Authentication Method
|
2018-06-12 21:06:37 +00:00
|
|
|
{{/if}}
|
|
|
|
</h1>
|
|
|
|
</p.levelLeft>
|
|
|
|
</PageHeader>
|
2022-12-16 21:26:43 +00:00
|
|
|
|
|
|
|
<div class="box is-sideless is-fullwidth is-marginless">
|
|
|
|
<NamespaceReminder @mode="enable" @noun={{if (eq @mountType "secret") "Secret Engine" "Auth Method"}} />
|
|
|
|
<MessageError @errorMessage={{this.errorMessage}} />
|
|
|
|
{{#if @mountModel.type}}
|
|
|
|
<form {{on "submit" (perform this.mountBackend)}}>
|
2021-12-17 03:44:29 +00:00
|
|
|
<FormFieldGroups
|
2022-12-16 21:26:43 +00:00
|
|
|
@model={{@mountModel}}
|
2021-12-17 03:44:29 +00:00
|
|
|
@renderGroup="default"
|
2022-12-16 21:26:43 +00:00
|
|
|
@onChange={{this.onTypeChange}}
|
2022-04-13 21:51:44 +00:00
|
|
|
@modelValidations={{this.modelValidations}}
|
2022-06-10 01:15:49 +00:00
|
|
|
@onKeyUp={{this.onKeyUp}}
|
2021-12-17 03:44:29 +00:00
|
|
|
/>
|
2022-12-16 21:26:43 +00:00
|
|
|
<FormFieldGroups @model={{@mountModel}} @renderGroup="Method Options" />
|
|
|
|
|
|
|
|
<div class="field is-grouped box is-fullwidth is-bottomless">
|
|
|
|
<div class="control">
|
|
|
|
<button
|
|
|
|
type="submit"
|
|
|
|
data-test-mount-submit="true"
|
|
|
|
class="button is-primary {{if this.mountBackend.isRunning 'loading'}}"
|
|
|
|
disabled={{this.mountBackend.isRunning}}
|
|
|
|
>
|
|
|
|
{{#if (eq @mountType "secret")}}
|
|
|
|
Enable Engine
|
|
|
|
{{else}}
|
|
|
|
Enable Method
|
|
|
|
{{/if}}
|
|
|
|
</button>
|
2018-08-28 05:03:55 +00:00
|
|
|
</div>
|
2022-05-25 18:22:36 +00:00
|
|
|
<div class="control">
|
2022-12-16 21:26:43 +00:00
|
|
|
<button data-test-mount-back type="button" class="button" {{on "click" (fn this.setMountType "")}}>
|
|
|
|
Back
|
|
|
|
</button>
|
2022-05-25 18:22:36 +00:00
|
|
|
</div>
|
2022-12-16 21:26:43 +00:00
|
|
|
{{#if this.invalidFormAlert}}
|
|
|
|
<div class="control">
|
|
|
|
<AlertInline @type="danger" @paddingTop={{true}} @message={{this.invalidFormAlert}} @mimicRefresh={{true}} />
|
|
|
|
</div>
|
|
|
|
{{/if}}
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
{{else}}
|
|
|
|
{{! Type not yet set, show type options }}
|
|
|
|
<MountBackend::TypeForm @setMountType={{this.setMountType}} @mountType={{@mountType}} />
|
|
|
|
{{/if}}
|
|
|
|
</div>
|