open-nomad/ui/app/templates/components/forbidden-message.hbs
Phil Renaud 281f6a6fba
[ui] Make the not-auth'd messages in the app less token-centric (#15557)
* Make the not-auth'd messages in the app less token-centric

* new helper to conditionally capitalize handlebars strings
2022-12-20 11:02:44 -05:00

40 lines
1.3 KiB
Handlebars

<div data-test-error class="empty-message">
<h3 data-test-error-title class="empty-message-headline">Not Authorized</h3>
<p data-test-error-message class="empty-message-body">
{{#if this.token.secret}}
You currently lack the
{{#if this.permission}}
<code>{{this.permission}}</code>
{{else}}
required
{{/if}}
<LinkTo @route="settings.tokens">permission</LinkTo> for this resource.<br /> Contact your administrator if this is an error.
{{else}}
{{#if this.authMethods}}
Sign in with
{{#each this.authMethods as |authMethod|}}
<LinkTo @route="settings.tokens">{{authMethod.name}}</LinkTo>,
{{/each}}
or
{{/if}}
{{conditionally-capitalize "provide" (not this.authMethods.length)}} a <LinkTo @route="settings.tokens">token</LinkTo> with the
{{#if this.permission}}
<code>{{this.permission}}</code>
{{else}}
requisite
{{/if}}
permission to view this.
{{/if}}
</p>
{{#unless this.token.secret}}
<p class="empty-message-body">
If you have signed in via the Nomad CLI, authenticate with:
<div class='terminal-container'>
<pre class='terminal'><span class='prompt'>$</span> nomad ui -authenticate</pre>
</div>
</p>
{{/unless}}
</div>