mirror of
https://github.com/status-im/consul.git
synced 2025-01-10 05:45:46 +00:00
5fb9df1640
* Adding explicit MPL license for sub-package This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Adding explicit MPL license for sub-package This directory and its subdirectories (packages) contain files licensed with the MPLv2 `LICENSE` file in this directory and are intentionally licensed separately from the BSL `LICENSE` file at the root of this repository. * Updating the license from MPL to Business Source License Going forward, this project will be licensed under the Business Source License v1.1. Please see our blog post for more details at <Blog URL>, FAQ at www.hashicorp.com/licensing-faq, and details of the license at www.hashicorp.com/bsl. * add missing license headers * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 * Update copyright file headers to BUSL-1.1 --------- Co-authored-by: hashicorp-copywrite[bot] <110428419+hashicorp-copywrite[bot]@users.noreply.github.com>
145 lines
4.6 KiB
Handlebars
145 lines
4.6 KiB
Handlebars
{{!
|
|
Copyright (c) HashiCorp, Inc.
|
|
SPDX-License-Identifier: BUSL-1.1
|
|
}}
|
|
|
|
<div
|
|
{{on-resize this.calculate}}
|
|
class="topology-container consul-topology-metrics"
|
|
>
|
|
{{#if (gt this.downstreams.length 0)}}
|
|
<div
|
|
id="downstream-container"
|
|
{{did-insert this.setHeight 'downstream-lines'}}
|
|
{{did-update this.setHeight 'downstream-lines' this.downstreams}}
|
|
>
|
|
{{#if (not this.emptyColumn)}}
|
|
<div>
|
|
<p>{{@dc.Name}}</p>
|
|
<span>
|
|
<Tooltip>
|
|
Only showing downstreams within the current datacenter for {{@service.Service.Service}}.
|
|
</Tooltip>
|
|
</span>
|
|
</div>
|
|
{{/if}}
|
|
{{#each this.downstreams as |item|}}
|
|
<TopologyMetrics::Card
|
|
@nspace={{@nspace}}
|
|
@dc={{@dc.Name}}
|
|
@service={{@service.Service}}
|
|
@item={{item}}
|
|
@hasMetricsProvider={{@hasMetricsProvider}}
|
|
@noMetricsReason={{this.noMetricsReason}}
|
|
>
|
|
{{#if (and @hasMetricsProvider this.mainNotIngressService (not-eq item.Kind 'ingress-gateway'))}}
|
|
{{!-- One of the only places in the app where it's acceptable to default to 'default' namespace --}}
|
|
<TopologyMetrics::Stats
|
|
data-test-topology-metrics-downstream-stats
|
|
@nspace={{or item.Namespace 'default'}}
|
|
@partition={{or item.Partition 'default'}}
|
|
@dc={{item.Datacenter}}
|
|
@endpoint='downstream-summary-for-service'
|
|
@service={{@service.Service.Service}}
|
|
@item={{item.Name}}
|
|
@noMetricsReason={{this.noMetricsReason}}
|
|
/>
|
|
{{/if}}
|
|
</TopologyMetrics::Card>
|
|
{{/each}}
|
|
</div>
|
|
{{/if}}
|
|
<div id="metrics-container">
|
|
<div class="metrics-header">
|
|
{{@service.Service.Service}}
|
|
</div>
|
|
{{#if (not-eq @service.Service.Meta.external-source 'consul-api-gateway')}}
|
|
{{#if @hasMetricsProvider}}
|
|
<TopologyMetrics::Series
|
|
@nspace={{or @service.Service.Namespace 'default'}}
|
|
@partition={{or service.Service.Partition 'default'}}
|
|
@dc={{@dc.Name}}
|
|
@service={{@service.Service.Service}}
|
|
@protocol={{@topology.Protocol}}
|
|
@noMetricsReason={{this.noMetricsReason}}
|
|
/>
|
|
{{#if this.mainNotIngressService}}
|
|
<TopologyMetrics::Stats
|
|
@nspace={{or @service.Service.Namespace 'default'}}
|
|
@partition={{or service.Service.Partition 'default'}}
|
|
@dc={{@dc.Name}}
|
|
@endpoint='summary-for-service'
|
|
@service={{@service.Service.Service}}
|
|
@protocol={{@topology.Protocol}}
|
|
@noMetricsReason={{this.noMetricsReason}}
|
|
/>
|
|
{{/if}}
|
|
{{/if}}
|
|
<div class="link">
|
|
{{#if @metricsHref}}
|
|
<a class="metrics-link" href={{@metricsHref}} target="_blank" rel="noopener noreferrer" data-test-metrics-anchor>Open dashboard</a>
|
|
{{else}}
|
|
<a class="config-link" href="{{env 'CONSUL_DOCS_URL'}}/connect/observability/ui-visualization" target="_blank" rel="noopener noreferrer">Configure dashboard</a>
|
|
{{/if}}
|
|
</div>
|
|
{{/if}}
|
|
</div>
|
|
<div id="downstream-lines">
|
|
<TopologyMetrics::DownLines
|
|
@type='downstream'
|
|
@service={{@service}}
|
|
@view={{this.downView}}
|
|
@center={{this.centerDimensions}}
|
|
@lines={{this.downLines}}
|
|
@items={{this.downstreams}}
|
|
@oncreate={{action @oncreate}}
|
|
/>
|
|
</div>
|
|
{{#if (gt this.upstreams.length 0)}}
|
|
<div id="upstream-column">
|
|
{{#each-in (group-by "PeerOrDatacenter" this.upstreams) as |dc upstreams|}}
|
|
<div
|
|
id="upstream-container"
|
|
{{did-insert this.setHeight 'upstream-lines'}}
|
|
{{did-update this.setHeight 'upstream-lines' this.upstreams}}
|
|
>
|
|
{{#if dc}}
|
|
<p>{{dc}}</p>
|
|
{{/if}}
|
|
{{#each upstreams as |item|}}
|
|
<TopologyMetrics::Card
|
|
@dc={{@dc.Name}}
|
|
@item={{item}}
|
|
@service={{@service.Service}}
|
|
>
|
|
{{#if (and @hasMetricsProvider this.mainNotIngressService (not-eq item.Kind 'ingress-gateway'))}}
|
|
{{!-- One of the only places in the app where it's acceptable to default to 'default' namespace --}}
|
|
<TopologyMetrics::Stats
|
|
@nspace={{or item.Namespace 'default'}}
|
|
@partition={{or item.Partition 'default'}}
|
|
@dc={{item.Datacenter}}
|
|
@endpoint='upstream-summary-for-service'
|
|
@service={{@service.Service.Service}}
|
|
@item={{item.Name}}
|
|
@noMetricsReason={{this.noMetricsReason}}
|
|
/>
|
|
{{/if}}
|
|
</TopologyMetrics::Card>
|
|
{{/each}}
|
|
</div>
|
|
{{/each-in}}
|
|
</div>
|
|
{{/if}}
|
|
<div id="upstream-lines">
|
|
<TopologyMetrics::UpLines
|
|
@type='upstream'
|
|
@service={{@service}}
|
|
@view={{this.upView}}
|
|
@center={{this.centerDimensions}}
|
|
@lines={{this.upLines}}
|
|
@items={{this.upstreams}}
|
|
@oncreate={{action @oncreate}}
|
|
/>
|
|
</div>
|
|
</div>
|