consul/ui/packages/consul-ui/app/components/error-state/index.hbs

90 lines
2.2 KiB
Handlebars
Raw Normal View History

{{#if (not-eq @error.status "403")}}
<EmptyState
class={{concat "status-" @error.status}}
@login={{@login}}
>
<BlockSlot @name="header">
<h2>
{{or @error.message "Consul returned an error"}}
</h2>
</BlockSlot>
{{#if @error.status }}
<BlockSlot @name="subheader">
<h3
data-test-status={{@error.status}}
>
Error {{@error.status}}
</h3>
</BlockSlot>
{{/if}}
<BlockSlot @name="body">
<p>
{{#if @error.detail}}
{{@error.detail}}
{{else}}
You may have visited a URL that is loading an unknown resource, so you can try going back to the root or try re-submitting your ACL Token/SecretID by going back to ACLs.
{{/if}}
</p>
</BlockSlot>
<BlockSlot @name="actions">
<li class="back-link">
<Action
data-test-home
@href={{href-to 'index'}}
>
Go back
</Action>
</li>
<li class="docs-link">
<Action
@href="{{env 'CONSUL_DOCS_URL'}}"
@external={{true}}
>
Read the documentation
</Action>
</li>
</BlockSlot>
</EmptyState>
{{else}}
<EmptyState
class={{concat "status-" @error.status}}
@login={{@login}}
>
<BlockSlot @name="header">
<h2
data-test-status={{@error.status}}
>
You are not authorized
</h2>
</BlockSlot>
<BlockSlot @name="subheader">
<h3>
Error {{@error.status}}
</h3>
</BlockSlot>
<BlockSlot @name="body">
<p>
You must be granted permissions to view this data. Ask your administrator if you think you should have access.
</p>
</BlockSlot>
<BlockSlot @name="actions">
<li class="docs-link">
<Action
@href="{{env 'CONSUL_DOCS_URL'}}/acl/index.html"
@external={{true}}
>
Read the documentation
</Action>
</li>
<li class="learn-link">
<Action
@href="{{env 'CONSUL_DOCS_LEARN_URL'}}/consul/security-networking/production-acls"
@external={{true}}
>
Follow the guide
</Action>
</li>
</BlockSlot>
</EmptyState>
{{/if}}