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-10-12 12:52:03 +00:00
|
|
|
<Route @name={{routeName}} as |route|>
|
2021-09-15 18:50:11 +00:00
|
|
|
<DataLoader
|
2022-10-12 12:52:03 +00:00
|
|
|
@src={{uri
|
|
|
|
'/${partition}/${nspace}/${dc}/service-instance/${id}/${node}/${name}/${peer}'
|
|
|
|
(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
|
|
|
|
peer=route.params.peer
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
as |loader|
|
|
|
|
>
|
2020-12-17 16:35:01 +00:00
|
|
|
|
2022-10-12 12:52:03 +00:00
|
|
|
<BlockSlot @name='error'>
|
|
|
|
<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
|
|
|
|
2022-10-12 12:52:03 +00:00
|
|
|
<BlockSlot @name='disconnected' as |after|>
|
|
|
|
{{#if (eq loader.error.status '404')}}
|
2023-03-06 22:10:09 +00:00
|
|
|
<Hds::Toast
|
|
|
|
@color='warning'
|
2022-10-12 12:52: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-10-12 12:52:03 +00:00
|
|
|
{{else if (eq loader.error.status '403')}}
|
2023-03-06 22:10:09 +00:00
|
|
|
<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>
|
2020-12-17 16:35:01 +00:00
|
|
|
{{else}}
|
2023-03-06 22:10:09 +00:00
|
|
|
<Hds::Toast
|
|
|
|
@color='critical'
|
|
|
|
{{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>
|
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
|
|
|
|
2022-10-12 12:52:03 +00:00
|
|
|
<BlockSlot @name='loaded'>
|
|
|
|
{{#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
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
@onchange={{action (mut meta) value='data'}}
|
|
|
|
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}}
|
|
|
|
{{! 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 }}
|
|
|
|
<DataSource
|
|
|
|
@src={{uri
|
|
|
|
'/${partition}/${nspace}/${dc}/service-instance/${id}/${node}/${name}/${peer}'
|
|
|
|
(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
|
|
|
|
peer=route.params.peer
|
|
|
|
)
|
|
|
|
}}
|
|
|
|
@onchange={{action (mut proxy) value='data'}}
|
|
|
|
/>
|
|
|
|
{{/if}}
|
|
|
|
</DataSource>
|
|
|
|
{{/if}}
|
|
|
|
<AppView>
|
|
|
|
<BlockSlot @name='breadcrumbs'>
|
|
|
|
<ol>
|
|
|
|
<li><a href={{href-to 'dc.services' params=(hash peer=undefined)}}>All Services</a></li>
|
|
|
|
<li><a
|
|
|
|
{{tooltip (concat 'Service (' item.Service.Service ')')}}
|
|
|
|
data-test-back
|
|
|
|
href={{href-to 'dc.services.show'}}
|
|
|
|
>
|
|
|
|
Service ({{item.Service.Service}})
|
|
|
|
</a></li>
|
|
|
|
</ol>
|
2020-12-17 16:35:01 +00:00
|
|
|
</BlockSlot>
|
2022-10-12 12:52:03 +00:00
|
|
|
<BlockSlot @name='header'>
|
2020-12-17 16:35:01 +00:00
|
|
|
<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>
|
2022-10-12 12:52:03 +00:00
|
|
|
<BlockSlot @name='nav'>
|
2020-12-17 16:35:01 +00:00
|
|
|
<dl>
|
|
|
|
<dt>Service Name</dt>
|
2022-10-12 12:52:03 +00:00
|
|
|
<dd><a
|
|
|
|
href='{{href-to "dc.services.show" item.Service.Service}}'
|
|
|
|
>{{item.Service.Service}}</a></dd>
|
2020-12-17 16:35:01 +00:00
|
|
|
</dl>
|
2022-10-07 10:01:34 +00:00
|
|
|
{{#unless item.Node.Meta.synthetic-node}}
|
|
|
|
<dl>
|
|
|
|
<dt>Node Name</dt>
|
2022-10-12 12:52:03 +00:00
|
|
|
<dd><a
|
|
|
|
data-test-service-instance-node-name
|
|
|
|
href='{{href-to "dc.nodes.show" item.Node.Node}}'
|
|
|
|
>{{item.Node.Node}}</a></dd>
|
2022-10-07 10:01:34 +00:00
|
|
|
</dl>
|
|
|
|
{{/unless}}
|
2022-06-23 13:16:26 +00:00
|
|
|
{{#if item.Service.PeerName}}
|
|
|
|
<dl>
|
|
|
|
<dt>Peer Name</dt>
|
2022-10-12 12:58:19 +00:00
|
|
|
<dd><a
|
|
|
|
data-test-service-instance-peer-name
|
|
|
|
href={{href-to
|
|
|
|
'dc.peers.show'
|
|
|
|
item.Service.PeerName
|
|
|
|
params=(hash peer=undefined)
|
|
|
|
}}
|
|
|
|
>{{item.Service.PeerName}}</a></dd>
|
2022-06-23 13:16:26 +00:00
|
|
|
</dl>
|
|
|
|
{{/if}}
|
2020-12-17 16:35:01 +00:00
|
|
|
</BlockSlot>
|
2022-10-12 12:52:03 +00:00
|
|
|
<BlockSlot @name='actions'>
|
2020-12-17 16:35:01 +00:00
|
|
|
{{#let (or item.Service.Address item.Node.Address) as |address|}}
|
2023-10-17 13:27:42 +00:00
|
|
|
<ConsulCopyButton @value={{address}} @name='Address'>{{address}}</ConsulCopyButton>
|
2020-12-17 16:35:01 +00:00
|
|
|
{{/let}}
|
|
|
|
</BlockSlot>
|
2022-10-12 12:52:03 +00:00
|
|
|
<BlockSlot @name='content'>
|
|
|
|
<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')
|
|
|
|
)
|
2022-01-07 19:16:21 +00:00
|
|
|
)
|
2022-10-12 12:52:03 +00:00
|
|
|
(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')
|
|
|
|
)
|
|
|
|
)
|
2022-01-07 19:16:21 +00:00
|
|
|
}}
|
|
|
|
/>
|
2020-12-17 16:35:01 +00:00
|
|
|
<Outlet
|
|
|
|
@name={{routeName}}
|
2022-10-12 12:52:03 +00:00
|
|
|
@model={{assign (hash proxy=proxy meta=meta item=item) route.model}}
|
|
|
|
as |o|
|
|
|
|
>
|
2020-12-17 16:35:01 +00:00
|
|
|
{{outlet}}
|
|
|
|
</Outlet>
|
|
|
|
</BlockSlot>
|
2022-10-12 12:52:03 +00:00
|
|
|
</AppView>
|
|
|
|
{{/let}}
|
2020-02-19 19:26:38 +00:00
|
|
|
</BlockSlot>
|
2021-04-06 12:40:40 +00:00
|
|
|
</DataLoader>
|
2022-10-12 12:52:03 +00:00
|
|
|
</Route>
|