open-vault/ui/app/templates/components/pki-cert-show.hbs
Angel Garbarino 2e35e9578c
UI/obscure secret on input (#11284)
* new font and add as font-family to be used in masked-input

* clean up logic

* refactor for displayOnly

* start cert masking

* work on certificates

* upload cert work

* fix global styling

* fix styling for class no longer used

* make mask by default and remove option

* glimmerize start and certificate on LDAP a file field

* glimmerize actions

* first part of glimmerizing text-file still need to do some clean up

* not doing awesome over here

* getting ready to un-glimmer

* unglimmerize

* remove placeholder based on conversations with design

* clean up text-file

* cleanup

* fix class bindings

* handle class binding

* set up for test

* fix elementId

* track down index

* update masked-input test

* add more to the masked-input test

* test-file test

* fix broken test

* clear old style

* clean up

* remove pgp key masked font, this really needs to be refactored to text-file component

* changelog

* cover other certificate view

* add allowCopy

* address some pr styling comments

* improve test coverage

* fix some issues

* add attr.options.masked
2021-04-22 08:58:37 -06:00

57 lines
2.1 KiB
Handlebars

<PageHeader as |p|>
<p.top>
<KeyValueHeader @baseKey={{hash display=model.id id=model.idForNav}} @path="vault.cluster.secrets.backend.list" @mode={{mode}} @root={{root}} @showCurrent={{true}} />
</p.top>
<p.levelLeft>
<h1 class="title is-3" data-test-secret-header="true">
PKI Certificate
</h1>
</p.levelLeft>
</PageHeader>
<div class="box is-fullwidth is-sideless is-paddingless is-marginless">
<MessageError @model={{model}} />
{{#each model.attrs as |attr|}}
{{#if (eq attr.type "object")}}
<InfoTableRow @label={{capitalize (or attr.options.label (humanize (dasherize attr.name)))}} @value={{stringify (get model attr.name)}} />
{{else}}
{{#if attr.options.masked}}
<InfoTableRow @label={{capitalize (or attr.options.label (humanize (dasherize attr.name)))}} @value={{get model attr.name}}>
<MaskedInput
@value={{get model attr.name}}
@displayOnly={{true}}
@allowCopy={{true}}
/>
</InfoTableRow>
{{else}}
<InfoTableRow @label={{capitalize (or attr.options.label (humanize (dasherize attr.name)))}} @value={{get model attr.name}} />
{{/if}}
{{/if}}
{{/each}}
</div>
<div class="field is-grouped is-grouped-split box is-fullwidth is-bottomless">
<div class="field is-grouped">
<div class="control">
<CopyButton @clipboardText={{model.toCreds}} @class="button is-primary" @buttonType="button" @success={{action (set-flash-message "Credentials copied!")}}>
Copy credentials
</CopyButton>
</div>
<div class="control">
<LinkTo @route="vault.cluster.secrets.backend.list-root" @query={{hash tab="certs"}} class="button">
Back
</LinkTo>
</div>
</div>
{{#if (and (not model.revocationTime) model.canRevoke)}}
<ConfirmAction
@buttonClasses="button"
@onConfirmAction={{action "delete"}}
@confirmTitle="Revoke this cert?"
@confirmMessage="Any services using this cert may be affected."
@confirmButtonText="Revoke"
>
Revoke
</ConfirmAction>
{{/if}}
</div>