vault/ui/lib/kubernetes/addon/components/page/configure.hbs
Jordan Reimer b0ce08bb4b
Button Conversion Part 1 (#23633)
* adds codemod for transforming button element to hds component

* runs button codemod on kmip and kubernetes enginges

* manully updates kuberenetes roles button

* runs button codemod on ldap engine

* manually updates remaining ldap buttons

* updates button codemod to check if all child nodes were included in text arg construction

* runs button codemod on kv engine

* adds comment for future kv button update

* Update ui/lib/kv/addon/components/page/secret/details.hbs

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>

* updates remaining instance of toolbar-link class on button and adds class name transform to button codemod

* adds display inline override to hds button

* updates hds button display override to inline-flex

* updates ldap account check in button to tertiary

* updates ldap library check out icon to tertiary and adds icon

---------

Co-authored-by: claire bontempo <68122737+hellobontempo@users.noreply.github.com>
2023-10-13 09:38:57 -06:00

114 lines
3.8 KiB
Handlebars
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{!
Copyright (c) HashiCorp, Inc.
SPDX-License-Identifier: BUSL-1.1
~}}
<PageHeader as |p|>
<p.top>
<Page::Breadcrumbs @breadcrumbs={{@breadcrumbs}} />
</p.top>
<p.levelLeft>
<h1 class="title is-3">
Configure Kubernetes
</h1>
</p.levelLeft>
</PageHeader>
<hr class="is-marginless has-background-gray-200" />
<p class="has-top-margin-m">
To customize your configuration, specify the type of Kubernetes cluster that credentials will be generated for.
</p>
<div class="is-flex-row has-top-margin-s">
<RadioCard
class="has-fixed-width"
@title="Local cluster"
@description="Generate credentials for the local Kubernetes cluster that Vault is running on, using Vaults service account."
@icon="kubernetes-color"
@value={{false}}
@groupValue={{@model.disableLocalCaJwt}}
@onChange={{this.onRadioSelect}}
data-test-radio-card="local"
/>
<RadioCard
class="has-fixed-width"
@title="Manual configuration"
@description="Generate credentials for an external Kubernetes cluster, using a service account that you specify."
@icon="vault"
@iconClass="has-text-black"
@value={{true}}
@groupValue={{@model.disableLocalCaJwt}}
@onChange={{this.onRadioSelect}}
data-test-radio-card="manual"
/>
</div>
<div class="has-top-margin-m" data-test-config>
{{#if @model.disableLocalCaJwt}}
<MessageError @errorMessage={{this.error}} />
{{#each @model.formFields as |attr|}}
<FormField @attr={{attr}} @model={{@model}} @modelValidations={{this.modelValidations}} />
{{/each}}
{{else if (eq this.inferredState "success")}}
<Icon @name="check-circle-fill" class="has-text-success" />
<span>Configuration values were inferred successfully.</span>
{{else if (eq this.inferredState "error")}}
<Icon @name="x-square-fill" class="has-text-danger" />
<span class="has-text-danger">
Vault could not infer a configuration from your environment variables. Check your configuration file to edit or delete
them, or configure manually.
</span>
{{else}}
<p>
Configuration values can be inferred from the pod and your local environment variables.
</p>
<div>
<Hds::Button
@text="Get config values"
@color="secondary"
@icon={{if this.fetchInferred.isRunning "loading"}}
class="has-top-margin-s"
disabled={{this.fetchInferred.isRunning}}
{{on "click" (perform this.fetchInferred)}}
/>
</div>
{{/if}}
</div>
<hr class="has-background-gray-200 has-top-margin-l" />
<div class="has-top-margin-s has-bottom-margin-s is-flex">
<Hds::Button @text="Save" data-test-config-save disabled={{this.isDisabled}} {{on "click" (perform this.save)}} />
<Hds::Button
@text="Back"
@color="secondary"
class="has-left-margin-xs"
data-test-config-cancel
disabled={{or this.save.isRunning this.fetchInferred.isRunning}}
{{on "click" this.cancel}}
/>
{{#if this.alert}}
<AlertInline @type="danger" @paddingTop={{true}} @message={{this.alert}} @mimicRefresh={{true}} data-test-alert />
{{/if}}
</div>
{{#if this.showConfirm}}
<Hds::Modal id="kubernetes-edit-config-modal" @onClose={{fn (mut this.showConfirm) false}} @color="warning" as |M|>
<M.Header @icon="alert-triangle">
Edit configuration
</M.Header>
<M.Body data-test-edit-config-body>
<p>
Making changes to your configuration may affect how Vault will reach the Kubernetes API and authenticate with it. Are
you sure?
</p>
</M.Body>
<M.Footer as |F|>
<Hds::ButtonSet>
<Hds::Button data-test-config-confirm {{on "click" (perform this.save)}} @text="Confirm" />
<Hds::Button {{on "click" F.close}} @color="secondary" @text="Cancel" />
</Hds::ButtonSet>
</M.Footer>
</Hds::Modal>
{{/if}}