2023-03-14 13:18:55 +00:00
{{ !
Copyright (c) HashiCorp, Inc.
2023-08-11 13:12:13 +00:00
SPDX-License-Identifier: BUSL-1.1
2023-03-14 13:18:55 +00:00
}}
2022-04-04 08:45:03 +00:00
<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" ) }}
2023-03-06 22:10:09 +00:00
<Hds::Toast
@color='warning'
2022-04-04 08:45:03 +00:00
{{ notification
sticky=true
2023-03-06 22:10:09 +00:00
}} 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>
2022-04-04 08:45:03 +00:00
{{ else if ( eq loader .error .status "403" ) }}
2023-03-06 22:10:09 +00:00
<Hds::Toast
@color='critical'
2022-04-04 08:45:03 +00:00
{{ notification
sticky=true
2023-03-06 22:10:09 +00:00
}} as |T|>
<T.Title>Error!</T.Title>
<T.Description>You no longer have access to this service.</T.Description>
</Hds::Toast>
2022-04-04 08:45:03 +00:00
{{ else }}
2023-03-06 22:10:09 +00:00
<Hds::Toast
@color='warning'
2022-04-04 08:45:03 +00:00
{{ notification
sticky=true
2023-03-06 22:10:09 +00:00
}} 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>
2022-04-04 08:45:03 +00:00
{{ / 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>
2023-02-22 21:05:15 +00:00
<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' ) ) }} '
/>
2022-04-04 08:45:03 +00:00
</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>
2022-04-14 15:58:19 +00:00
{{ # if ( can 'read zones' ) }}
2022-04-04 08:45:03 +00:00
<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>
2022-04-14 15:58:19 +00:00
{{ / if }}
2022-04-04 08:45:03 +00:00
</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>