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

101 lines
2.5 KiB
Handlebars
Raw Normal View History

{{!
Copyright (c) HashiCorp, Inc.
[COMPLIANCE] License changes (#18443) * Adding explicit MPL license for sub-package This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Adding explicit MPL license for sub-package This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Updating the license from MPL to Business Source License Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at <Blog URL>, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl. * add missing license headers * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 --------- Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
2023-08-11 13:12:13 +00:00
SPDX-License-Identifier: BUSL-1.1
}}
{{#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>
<Hds::Link::Standalone
data-test-home
@route='index'
@text='Go back'
@icon='chevron-left'
@iconPosition='trailing'
@size='small'
/>
</li>
<li>
<Hds::Link::Standalone
data-test-home
@text='Read the documentation'
@href="{{env 'CONSUL_DOCS_URL'}}"
@iconPosition='trailing'
@icon='docs-link'
@size='small'
/>
</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>
<Hds::Link::Standalone
@text='Read the documentation'
@href="{{env 'CONSUL_DOCS_URL'}}/acl/index.html"
@icon='docs-link'
@iconPosition='trailing'
@size='small'
/>
</li>
<li>
<Hds::Link::Standalone
@text='Follow the guide'
@href="{{env 'CONSUL_DOCS_LEARN_URL'}}/consul/security-networking/production-acls"
@icon='learn-link'
@iconPosition='trailing'
@size='small'
/>
</li>
</BlockSlot>
</EmptyState>
{{/if}}