consul/ui/packages/consul-ui/app/templates/dc/show/serverstatus.hbs

224 lines
6.1 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
}}
<Route
@name={{routeName}}
as |route|>
<DataLoader
@src={{
uri '/${partition}/${nspace}/${dc}/datacenter'
(hash
partition=route.params.partition
nspace=route.params.nspace
dc=route.params.dc
)
}}
as |loader|>
{{#let
loader.data
as |item|}}
<BlockSlot @name="error">
<ErrorState
@error={{loader.error}}
@login={{route.model.app.login.open}}
/>
</BlockSlot>
<BlockSlot @name="disconnected" as |after|>
{{#if (eq loader.error.status "404")}}
<Hds::Toast
@color='warning'
{{notification
sticky=true
}} as |T|>
<T.Title>Warning!</T.Title>
<T.Description>This service has been deregistered and no longer exists in the catalog.</T.Description>
</Hds::Toast>
{{else if (eq loader.error.status "403")}}
<Hds::Toast
@color='critical'
{{notification
sticky=true
}} as |T|>
<T.Title>Error!</T.Title>
<T.Description>You no longer have access to this service.</T.Description>
</Hds::Toast>
{{else}}
<Hds::Toast
@color='warning'
{{notification
sticky=true
}} as |T|>
<T.Title>Warning!</T.Title>
<T.Description>An error was returned whilst loading this data, refresh to try again.</T.Description>
</Hds::Toast>
{{/if}}
</BlockSlot>
<BlockSlot @name="loaded">
<div class="tab-section">
<section
class={{class-map
'server-failure-tolerance'
}}
>
<header>
<h2>
{{compute (fn route.t 'tolerance.header')}}
</h2>
<Hds::Link::Standalone
@icon='docs-link'
@iconPosition='trailing'
@text={{compute (fn route.t 'tolerance.link-text')}}
@href='{{concat (env 'CONSUL_DOCS_URL') (compute (fn route.t 'tolerance.link'))}}'
/>
</header>
<section
class={{class-map
(array 'immediate-tolerance')
}}
>
<header>
<h3>
{{compute (fn route.t 'tolerance.immediate.header')}}
</h3>
</header>
<dl
class={{class-map
(array 'warning' (and
(eq item.FailureTolerance 0)
(eq item.OptimisticFailureTolerance 0)
))
}}
>
<dt>
{{compute (fn route.t 'tolerance.immediate.body')}}
</dt>
<dd>
{{item.FailureTolerance}}
</dd>
</dl>
</section>
{{#if (can 'read zones')}}
<section
class={{class-map
(array 'optimistic-tolerance')
}}
>
<header>
<h3>
{{compute (fn route.t 'tolerance.optimistic.header')}}
<span
{{tooltip 'With > 30 seconds between server failures, Consul can restore the Immediate Fault Tolerance by replacing failed active voters with healthy back-up voters when using redundancy zones.'}}
>
</span>
</h3>
</header>
<dl
class={{class-map
(array 'warning' (eq item.OptimisticFailureTolerance 0))
}}
>
<dt>
{{compute (fn route.t 'tolerance.optimistic.body')}}
</dt>
<dd>
{{item.OptimisticFailureTolerance}}
</dd>
</dl>
</section>
{{/if}}
</section>
{{#if (gt item.RedundancyZones.length 0)}}
<section
class={{class-map
'redundancy-zones'
}}
>
<header>
<h2>
{{pluralize (t 'common.consul.redundancyzone')}}
</h2>
</header>
{{#each item.RedundancyZones as |item|}}
{{#if (gt item.Servers.length 0) }}
<section>
<header>
<h3>
{{item.Name}}
</h3>
<dl
class={{class-map
(array 'warning' (eq item.FailureTolerance 0))
}}
>
<dt
>{{t 'common.consul.failuretolerance'}}</dt>
<dd>{{item.FailureTolerance}}</dd>
</dl>
</header>
<Consul::Server::List
@items={{item.Servers}}
/>
</section>
{{/if}}
{{/each}}
{{#if (gt item.Default.Servers.length 0)}}
<section>
<header>
<h3>
{{compute (fn route.t 'unassigned')}}
</h3>
</header>
<Consul::Server::List
@items={{item.Default.Servers}}
/>
</section>
{{/if}}
</section>
{{else}}
<section>
<header>
<h2>
{{compute (fn route.t 'servers')}}
</h2>
</header>
<Consul::Server::List
@items={{item.Default.Servers}}
/>
</section>
{{/if}}
{{#if (gt item.ReadReplicas.length 0)}}
<section>
<header>
<h2>
{{pluralize (t 'common.consul.readreplica')}}
</h2>
</header>
<Consul::Server::List
@items={{item.ReadReplicas}}
/>
</section>
{{/if}}
</div>
</BlockSlot>
{{/let}}
</DataLoader>
</Route>