ui: Fixup peering imported/exported service counts (#13662)
* ui: Fix up peer states and counts in the listing
This commit is contained in:
parent
0910c41d95
commit
9377ac7635
|
@ -1,5 +0,0 @@
|
||||||
{{#if this.count}}
|
|
||||||
<div {{tooltip this.tooltipText}}>
|
|
||||||
{{this.text}}
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
|
@ -1,29 +0,0 @@
|
||||||
import Component from '@glimmer/component';
|
|
||||||
import { inject as service } from '@ember/service';
|
|
||||||
|
|
||||||
export default class PeeringsServiceCount extends Component {
|
|
||||||
@service intl;
|
|
||||||
|
|
||||||
get count() {
|
|
||||||
const { peering, kind } = this.args;
|
|
||||||
|
|
||||||
return peering[`${kind.capitalize()}ServiceCount`];
|
|
||||||
}
|
|
||||||
|
|
||||||
get text() {
|
|
||||||
const { kind } = this.args;
|
|
||||||
const { intl, count } = this;
|
|
||||||
|
|
||||||
return intl.t(`routes.dc.peers.index.detail.${kind}.count`, { count });
|
|
||||||
}
|
|
||||||
|
|
||||||
get tooltipText() {
|
|
||||||
const {
|
|
||||||
kind,
|
|
||||||
peering: { name },
|
|
||||||
} = this.args;
|
|
||||||
const { intl } = this;
|
|
||||||
|
|
||||||
return intl.t(`routes.dc.peers.index.detail.${kind}.tooltip`, { name });
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -77,8 +77,31 @@ as |sort filters items|}}
|
||||||
<BlockSlot @name="details">
|
<BlockSlot @name="details">
|
||||||
<div class="peers__list__peer-detail">
|
<div class="peers__list__peer-detail">
|
||||||
<Peerings::Badge @peering={{item}} />
|
<Peerings::Badge @peering={{item}} />
|
||||||
<Peerings::ServiceCount @peering={{item}} @kind="imported"/>
|
|
||||||
<Peerings::ServiceCount @peering={{item}} @kind="exported"/>
|
<div
|
||||||
|
{{tooltip
|
||||||
|
(t 'routes.dc.peers.index.detail.imported.tooltip'
|
||||||
|
name=item.Name
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{{t 'routes.dc.peers.index.detail.imported.count'
|
||||||
|
count=(format-number item.ImportedServiceCount)
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div
|
||||||
|
{{tooltip
|
||||||
|
(t 'routes.dc.peers.index.detail.exported.tooltip'
|
||||||
|
name=item.Name
|
||||||
|
)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{{t 'routes.dc.peers.index.detail.exported.count'
|
||||||
|
count=(format-number item.ExportedServiceCount)
|
||||||
|
}}
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</BlockSlot>
|
</BlockSlot>
|
||||||
<BlockSlot @name="actions" as |Actions|>
|
<BlockSlot @name="actions" as |Actions|>
|
||||||
|
|
Loading…
Reference in New Issue