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}/service-instance/${id}/${node}/${name}'
|
|
|
|
(hash
|
|
|
|
partition=route.params.partition
|
|
|
|
nspace=route.params.nspace
|
|
|
|
dc=route.params.dc
|
|
|
|
id=route.params.id
|
|
|
|
node=route.params.node
|
|
|
|
name=route.params.name
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
as |loader|>
|
2020-12-17 16:35:01 +00:00
|
|
|
|
|
|
|
<BlockSlot @name="error">
|
2021-04-06 12:40:40 +00:00
|
|
|
<AppError
|
|
|
|
@error={{loader.error}}
|
|
|
|
@login={{route.model.app.login.open}}
|
|
|
|
/>
|
2020-02-19 19:26:38 +00:00
|
|
|
</BlockSlot>
|
2020-12-17 16:35:01 +00:00
|
|
|
|
2021-11-24 18:14:07 +00:00
|
|
|
<BlockSlot @name="disconnected" as |after|>
|
2020-12-17 16:35:01 +00:00
|
|
|
{{#if (eq loader.error.status "404")}}
|
2021-11-24 18:14:07 +00:00
|
|
|
<Notice
|
|
|
|
{{notification
|
|
|
|
sticky=true
|
|
|
|
}}
|
|
|
|
class="notification-update"
|
|
|
|
@type="warning"
|
|
|
|
as |notice|>
|
|
|
|
<notice.Header>
|
2020-12-17 16:35:01 +00:00
|
|
|
<strong>Warning!</strong>
|
2021-11-24 18:14:07 +00:00
|
|
|
</notice.Header>
|
|
|
|
<notice.Body>
|
|
|
|
<p>
|
|
|
|
This service has been deregistered and no longer exists in the catalog.
|
|
|
|
</p>
|
|
|
|
</notice.Body>
|
|
|
|
</Notice>
|
2021-02-19 16:42:16 +00:00
|
|
|
{{else if (eq loader.error.status "403")}}
|
2021-11-24 18:14:07 +00:00
|
|
|
<Notice
|
|
|
|
{{notification
|
|
|
|
sticky=true
|
|
|
|
}}
|
|
|
|
class="notification-update"
|
|
|
|
@type="error"
|
|
|
|
as |notice|>
|
|
|
|
<notice.Header>
|
2021-02-19 16:42:16 +00:00
|
|
|
<strong>Error!</strong>
|
2021-11-24 18:14:07 +00:00
|
|
|
</notice.Header>
|
|
|
|
<notice.Body>
|
|
|
|
<p>
|
|
|
|
You no longer have access to this service
|
|
|
|
</p>
|
|
|
|
</notice.Body>
|
|
|
|
</Notice>
|
2020-12-17 16:35:01 +00:00
|
|
|
{{else}}
|
2021-11-24 18:14:07 +00:00
|
|
|
<Notice
|
|
|
|
{{notification
|
|
|
|
sticky=true
|
|
|
|
}}
|
|
|
|
class="notification-update"
|
|
|
|
@type="error"
|
|
|
|
as |notice|>
|
|
|
|
<notice.Header>
|
2020-12-17 16:35:01 +00:00
|
|
|
<strong>Warning!</strong>
|
2021-11-24 18:14:07 +00:00
|
|
|
</notice.Header>
|
|
|
|
<notice.Body>
|
|
|
|
<p>
|
|
|
|
An error was returned whilst loading this data, refresh to try again.
|
|
|
|
</p>
|
|
|
|
</notice.Body>
|
|
|
|
</Notice>
|
2020-12-17 16:35:01 +00:00
|
|
|
{{/if}}
|
2020-05-07 13:57:15 +00:00
|
|
|
</BlockSlot>
|
2020-12-17 16:35:01 +00:00
|
|
|
|
|
|
|
<BlockSlot @name="loaded">
|
2021-09-15 18:50:11 +00:00
|
|
|
{{#let
|
|
|
|
|
|
|
|
loader.data
|
|
|
|
|
|
|
|
as |item|}}
|
|
|
|
{{#if item.IsOrigin}}
|
|
|
|
<DataSource
|
|
|
|
@src={{uri '/${partition}/${nspace}/${dc}/proxy-instance/${id}/${node}/${name}'
|
|
|
|
(hash
|
|
|
|
partition=route.params.partition
|
|
|
|
nspace=route.params.nspace
|
|
|
|
dc=route.params.dc
|
|
|
|
id=route.params.id
|
|
|
|
node=route.params.node
|
|
|
|
name=route.params.name
|
|
|
|
)
|
|
|
|
}}
|
2022-01-07 19:16:21 +00:00
|
|
|
@onchange={{action (mut meta) value="data"}}
|
2021-09-15 18:50:11 +00:00
|
|
|
as |meta|>
|
|
|
|
{{! We only really need meta to get the correct ServiceID }}
|
|
|
|
{{! but we may as well use the NodeName and ServiceName }}
|
|
|
|
{{! from meta also, but they should be the same as the instance }}
|
|
|
|
{{! so if we can ever get ServiceID from elsewhere we could save }}
|
|
|
|
{{! a HTTP request/long poll here }}
|
|
|
|
{{#if meta.data.ServiceID}}
|
2022-01-07 19:16:21 +00:00
|
|
|
{{! if we have a proxy then get the additional instance information }}
|
|
|
|
{{! for the proxy itself so if the service is called `backend` }}
|
|
|
|
{{! its likely to have a proxy service called `backend-sidecar-proxy` }}
|
|
|
|
{{! and this second request get the info for that instance and saves }}
|
|
|
|
{{! it into the `proxy` variable }}
|
2021-09-15 18:50:11 +00:00
|
|
|
<DataSource
|
2022-01-07 19:16:21 +00:00
|
|
|
@src={{uri '/${partition}/${nspace}/${dc}/service-instance/${id}/${node}/${name}'
|
2021-09-15 18:50:11 +00:00
|
|
|
(hash
|
|
|
|
partition=route.params.partition
|
|
|
|
nspace=route.params.nspace
|
|
|
|
dc=route.params.dc
|
|
|
|
id=meta.data.ServiceID
|
|
|
|
node=meta.data.NodeName
|
|
|
|
name=meta.data.ServiceName
|
|
|
|
)
|
|
|
|
}}
|
2022-01-07 19:16:21 +00:00
|
|
|
@onchange={{action (mut proxy) value="data"}}
|
|
|
|
/>
|
2021-09-15 18:50:11 +00:00
|
|
|
{{/if}}
|
|
|
|
</DataSource>
|
|
|
|
{{/if}}
|
2020-12-17 16:35:01 +00:00
|
|
|
<AppView>
|
|
|
|
<BlockSlot @name="breadcrumbs">
|
|
|
|
<ol>
|
2021-01-12 14:53:21 +00:00
|
|
|
<li><a href={{href-to 'dc.services'}}>All Services</a></li>
|
2020-12-17 16:35:01 +00:00
|
|
|
<li><a data-test-back href={{href-to 'dc.services.show'}}>Service ({{item.Service.Service}})</a></li>
|
|
|
|
</ol>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="header">
|
|
|
|
<h1>
|
2021-09-15 18:50:11 +00:00
|
|
|
<route.Title @title={{item.Service.ID}} />
|
2020-12-17 16:35:01 +00:00
|
|
|
</h1>
|
2021-11-10 21:54:12 +00:00
|
|
|
<Consul::ExternalSource @item={{item}} @withInfo={{true}} />
|
2020-12-17 16:35:01 +00:00
|
|
|
<Consul::Kind @item={{item}} @withInfo={{true}} />
|
2022-01-07 19:16:21 +00:00
|
|
|
{{! TODO: Looks like we can get this straight from item.Proxy.Mode }}
|
|
|
|
{{! the less we need `proxy` and `meta` the better }}
|
|
|
|
{{#if (eq meta.ServiceProxy.Mode 'transparent')}}
|
2021-04-08 21:03:25 +00:00
|
|
|
<Consul::TransparentProxy />
|
|
|
|
{{/if}}
|
2020-12-17 16:35:01 +00:00
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="nav">
|
|
|
|
<dl>
|
|
|
|
<dt>Service Name</dt>
|
|
|
|
<dd><a href="{{href-to 'dc.services.show' item.Service.Service}}">{{item.Service.Service}}</a></dd>
|
|
|
|
</dl>
|
|
|
|
<dl>
|
|
|
|
<dt>Node Name</dt>
|
|
|
|
<dd><a href="{{href-to 'dc.nodes.show' item.Node.Node}}">{{item.Node.Node}}</a></dd>
|
|
|
|
</dl>
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="actions">
|
|
|
|
{{#let (or item.Service.Address item.Node.Address) as |address|}}
|
|
|
|
<CopyButton @value={{address}} @name="Address">{{address}}</CopyButton>
|
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
|
|
|
<BlockSlot @name="content">
|
2022-01-07 19:16:21 +00:00
|
|
|
<TabNav @items={{
|
|
|
|
compact
|
|
|
|
(array
|
|
|
|
(hash label="Health Checks" href=(href-to "dc.services.instance.healthchecks") selected=(is-href "dc.services.instance.healthchecks"))
|
|
|
|
(if (eq item.Service.Kind 'mesh-gateway') (hash label="Addresses" href=(href-to "dc.services.instance.addresses") selected=(is-href "dc.services.instance.addresses")))
|
|
|
|
(if proxy (hash label="Upstreams" href=(href-to "dc.services.instance.upstreams") selected=(is-href "dc.services.instance.upstreams")))
|
|
|
|
(if proxy (hash label="Exposed Paths" href=(href-to "dc.services.instance.exposedpaths") selected=(is-href "dc.services.instance.exposedpaths")))
|
|
|
|
(hash label="Tags & Meta" href=(href-to "dc.services.instance.metadata") selected=(is-href "dc.services.instance.metadata"))
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
/>
|
2020-12-17 16:35:01 +00:00
|
|
|
<Outlet
|
|
|
|
@name={{routeName}}
|
2021-09-15 18:50:11 +00:00
|
|
|
@model={{assign (hash
|
|
|
|
proxy=proxy
|
2022-01-07 19:16:21 +00:00
|
|
|
meta=meta
|
2021-09-15 18:50:11 +00:00
|
|
|
item=item
|
|
|
|
) route.model}}
|
2020-12-17 16:35:01 +00:00
|
|
|
as |o|>
|
|
|
|
{{outlet}}
|
|
|
|
</Outlet>
|
|
|
|
</BlockSlot>
|
|
|
|
</AppView>
|
2021-09-15 18:50:11 +00:00
|
|
|
{{/let}}
|
2020-02-19 19:26:38 +00:00
|
|
|
</BlockSlot>
|
2021-04-06 12:40:40 +00:00
|
|
|
</DataLoader>
|
|
|
|
</Route>
|