open-consul/ui/packages/consul-ui/app/templates/dc/services/show/topology.hbs

121 lines
3.6 KiB
Handlebars

<Route
@name={{routeName}}
as |route|>
<DataLoader @src={{
uri '/${partition}/${nspace}/${dc}/topology/${name}/${kind}'
(hash
partition=route.params.partition
nspace=route.params.nspace
dc=route.params.dc
name=route.params.name
kind=(or route.model.items.firstObject.Service.Kind '')
)
}} as |loader|>
<BlockSlot @name="error">
<AppError
@error={{loader.error}}
@login={{route.model.app.login.open}}
/>
</BlockSlot>
<BlockSlot @name="loaded">
{{#let
route.params.nspace
route.model.dc
route.model.items
loader.data
as |nspace dc items topology|}}
<div class="tab-section">
{{#let (collapsible-notices topology.FilteredByACLs (eq dc.DefaultACLPolicy 'allow') topology.wildcardIntention topology.notDefinedIntention) as |collapsible| }}
<CollapsibleNotices @collapsible={{collapsible}}>
{{#if topology.FilteredByACLs}}
<TopologyMetrics::Notice
data-test-notice='filtered-by-acls'
@type="info"
@for="limited-access"
@action={{false}}
/>
{{/if}}
{{#if (eq dc.DefaultACLPolicy 'allow')}}
<TopologyMetrics::Notice
data-test-notice='default-allow'
@type="warning"
@for="default-allow"
@internal={{true}}
@action={{true}}
/>
{{/if}}
{{#if topology.wildcardIntention}}
<TopologyMetrics::Notice
data-test-notice='wildcard-intention'
@type="warning"
@for="wildcard-intention"
@internal={{true}}
@action={{true}}
/>
{{/if}}
{{#if topology.notDefinedIntention}}
<TopologyMetrics::Notice
data-test-notice='not-defined-intention'
@type="warning"
@for="not-defined-intention"
@link="{{env 'CONSUL_DOCS_URL'}}/connect/registration/service-registration#upstreams"
@internal={{false}}
@action={{true}}
/>
{{/if}}
{{#if (and topology.noDependencies (can 'use acls'))}}
<TopologyMetrics::Notice
data-test-notice='no-dependencies'
@type="info"
@for="no-dependencies"
@link="{{env 'CONSUL_DOCS_URL'}}/connect/registration/service-registration#upstream-configuration-reference"
@internal={{false}}
@action={{true}}
/>
{{/if}}
{{#if (and topology.noDependencies (not (can 'use acls')))}}
<TopologyMetrics::Notice
data-test-notice='acls-disabled'
@type="warning"
@for="acls-disabled"
@link="{{env 'CONSUL_DOCS_URL'}}/security/acl/acl-system#configuring-acls"
@internal={{false}}
@action={{true}}
/>
{{/if}}
</CollapsibleNotices>
{{/let}}
<DataSource
@src={{uri '/${partition}/${nspace}/${dc}/ui-config'
(hash
partition=route.params.partition
nspace=route.params.nspace
dc=route.params.dc
)
}}
as |config|>
{{#if config.data}}
<TopologyMetrics
@nspace={{nspace}}
@dc={{dc}}
@service={{items.firstObject}}
@topology={{topology}}
@metricsHref={{render-template config.data.dashboard_url_templates.service (hash
Datacenter=dc.Name
Service=items.firstObject
)}}
@isRemoteDC={{not dc.Local}}
@hasMetricsProvider={{gt config.data.metrics_provider.length 0}}
@oncreate={{route-action 'createIntention'}}
/>
{{/if}}
</DataSource>
</div>
{{/let}}
</BlockSlot>
</DataLoader>
</Route>