2021-04-06 12:40:40 +00:00
|
|
|
<Route
|
|
|
|
@name={{routeName}}
|
|
|
|
as |route|>
|
2021-09-15 18:50:11 +00:00
|
|
|
<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|}}
|
2021-04-06 12:40:40 +00:00
|
|
|
<div class="tab-section">
|
2022-02-18 17:16:03 +00:00
|
|
|
|
|
|
|
<div
|
|
|
|
class="topology-notices"
|
|
|
|
>
|
|
|
|
<Disclosure
|
|
|
|
@expanded={{true}}
|
|
|
|
as |disclosure|
|
|
|
|
>
|
|
|
|
{{! Make a map of key=enabled to tell us which notices are enabled }}
|
|
|
|
{{! The `false` here is so we can easily open all the notices up by changing to `true` }}
|
|
|
|
{{#let
|
|
|
|
(from-entries (array
|
|
|
|
(array 'filtered-by-acls' (or false topology.FilteredByACLs))
|
|
|
|
(array 'default-allow' (or false (eq dc.DefaultACLPolicy 'allow')))
|
|
|
|
(array 'wildcard-intention' (or false topology.wildcardIntention))
|
|
|
|
(array 'not-defined-intention' (or false topology.notDefinedIntention))
|
|
|
|
(array 'no-dependencies' (or false (and topology.noDependencies (can 'use acls'))))
|
|
|
|
(array 'acls-disabled' (or false (and topology.noDependencies (not (can 'use acls')))))
|
|
|
|
))
|
|
|
|
as |notices|}}
|
|
|
|
|
|
|
|
{{! Make an array only of truthy values to we know how many notices are enabled }}
|
|
|
|
{{#let (without false
|
|
|
|
(values notices)
|
|
|
|
) as |noticesEnabled|}}
|
|
|
|
|
|
|
|
{{! Render any enabled notices }}
|
|
|
|
{{#each-in notices as |prop enabled|}}
|
|
|
|
{{#if enabled}}
|
|
|
|
<disclosure.Details
|
|
|
|
@auto={{false}}
|
|
|
|
as |details|>
|
|
|
|
<Notice
|
|
|
|
class="topology-metrics-notice"
|
|
|
|
id={{details.id}}
|
|
|
|
data-test-notice={{prop}}
|
|
|
|
@type={{if (contains prop (array 'filtered-by-acls' 'no-dependencies'))
|
|
|
|
'info'
|
|
|
|
'warning'
|
|
|
|
}}
|
|
|
|
as |notice|>
|
|
|
|
<notice.Header>
|
|
|
|
<h3>
|
|
|
|
{{compute (fn route.t 'notice.${prop}.header'
|
|
|
|
(hash
|
|
|
|
prop=prop
|
|
|
|
)
|
|
|
|
)}}
|
|
|
|
</h3>
|
|
|
|
</notice.Header>
|
|
|
|
{{#if disclosure.expanded}}
|
|
|
|
<notice.Body>
|
|
|
|
<p>
|
|
|
|
{{compute (fn route.t 'notice.${prop}.body'
|
|
|
|
(hash
|
|
|
|
prop=prop
|
|
|
|
)
|
|
|
|
)}}
|
|
|
|
</p>
|
|
|
|
</notice.Body>
|
|
|
|
{{/if}}
|
|
|
|
{{#let
|
|
|
|
(compute (fn route.t 'notice.${prop}.footer'
|
|
|
|
(hash
|
|
|
|
route_intentions=(href-to 'dc.services.show.intentions')
|
|
|
|
prop=prop
|
|
|
|
htmlSafe=true
|
|
|
|
)
|
|
|
|
))
|
|
|
|
as |footer|}}
|
|
|
|
{{#if (and disclosure.expanded (not-eq prop 'filtered-by-acls'))}}
|
|
|
|
<notice.Footer>
|
|
|
|
{{footer}}
|
|
|
|
</notice.Footer>
|
|
|
|
{{/if}}
|
|
|
|
{{/let}}
|
|
|
|
</Notice>
|
|
|
|
</disclosure.Details>
|
|
|
|
{{/if}}
|
|
|
|
{{/each-in}}
|
|
|
|
|
|
|
|
{{! If more than 2 notices are enabled let the user close them }}
|
|
|
|
{{#if (gt noticesEnabled.length 2)}}
|
|
|
|
<disclosure.Action
|
|
|
|
{{on 'click' disclosure.toggle}}
|
|
|
|
>
|
|
|
|
{{compute (fn route.t 'notices.${expanded}'
|
|
|
|
(hash
|
|
|
|
expanded=(if disclosure.expanded 'close' 'open')
|
|
|
|
)
|
|
|
|
)}}
|
|
|
|
</disclosure.Action>
|
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{/let}}
|
|
|
|
{{/let}}
|
|
|
|
</Disclosure>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
2021-09-15 18:50:11 +00:00
|
|
|
<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}}
|
2022-02-18 17:16:03 +00:00
|
|
|
|
2021-04-06 12:40:40 +00:00
|
|
|
<TopologyMetrics
|
|
|
|
@nspace={{nspace}}
|
2021-10-12 13:27:06 +00:00
|
|
|
@dc={{dc}}
|
2021-04-06 12:40:40 +00:00
|
|
|
@service={{items.firstObject}}
|
|
|
|
@topology={{topology}}
|
2021-05-25 15:02:38 +00:00
|
|
|
|
2021-11-25 10:47:07 +00:00
|
|
|
@metricsHref={{render-template config.data.dashboard_url_templates.service
|
|
|
|
(hash
|
|
|
|
Datacenter=dc.Name
|
|
|
|
Service=(hash
|
|
|
|
Name=items.firstObject.Name
|
|
|
|
Namespace=(or items.firstObject.Namespace '')
|
2021-12-01 11:05:57 +00:00
|
|
|
Partition=(or items.firstObject.Partition '')
|
2021-11-25 10:47:07 +00:00
|
|
|
)
|
|
|
|
)
|
|
|
|
}}
|
2021-04-06 12:40:40 +00:00
|
|
|
@isRemoteDC={{not dc.Local}}
|
2021-09-15 18:50:11 +00:00
|
|
|
@hasMetricsProvider={{gt config.data.metrics_provider.length 0}}
|
2021-04-06 12:40:40 +00:00
|
|
|
@oncreate={{route-action 'createIntention'}}
|
|
|
|
/>
|
2022-02-18 17:16:03 +00:00
|
|
|
|
2020-12-17 15:26:48 +00:00
|
|
|
{{/if}}
|
2021-09-15 18:50:11 +00:00
|
|
|
</DataSource>
|
2021-04-06 12:40:40 +00:00
|
|
|
</div>
|
2021-09-15 18:50:11 +00:00
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
|
|
|
</DataLoader>
|
2021-04-06 12:40:40 +00:00
|
|
|
</Route>
|