Skip to content

Commit

Permalink
Read from localStorage to display a copyable access token and secret
Browse files Browse the repository at this point in the history
  • Loading branch information
philrenaud committed Jan 23, 2025
1 parent f82f520 commit dd3e008
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ui/packages/consul-ui/app/templates/settings.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,26 @@ as |item|}}
<A.Title>Local Storage</A.Title>
<A.Description>These settings are immediately saved to local storage and persisted through browser usage.</A.Description>
</Hds::Alert>

<DataSource
@src={{uri "settings://consul:token"}}
@onchange={{action (mut token) value="data"}}
@onerror={{action (mut error) value="error"}}
/>
{{#if token}}
<Hds::Alert @type="inline" @color="highlight" class="mb-3 mt-2" @icon="token" as |A|>
<A.Title>Your Access Token</A.Title>
<A.Description>
<Hds::Form::MaskedInput::Field readonly @isContentMasked={{false}} @hasCopyButton={{true}} @value={{token.AccessorID}} as |F|>
<F.Label>Accessor ID</F.Label>
</Hds::Form::MaskedInput::Field>
<Hds::Form::MaskedInput::Field readonly @hasCopyButton={{true}} @value={{token.SecretID}} as |F|>
<F.Label>Secret ID</F.Label>
</Hds::Form::MaskedInput::Field>
</A.Description>
</Hds::Alert>
{{/if}}

<form>
{{#if (not (env 'CONSUL_UI_DISABLE_REALTIME'))}}
<Disclosure as |disclosure|>
Expand Down

0 comments on commit dd3e008

Please sign in to comment.