ui: [BUGFIX] Ensure we show the correct count of instances for each node (#9749)
* Add MeshServiceInstances property to node model * Use MeshServiceInstances property * Make sure we show the 'No * checks' if Checks.length is zero
This commit is contained in:
parent
7c29524b95
commit
08cf0f18a6
|
@ -0,0 +1,3 @@
|
||||||
|
```release-note:bug
|
||||||
|
ui: Exclude proxies when showing the total number of instances on a node.
|
||||||
|
```
|
|
@ -1,4 +1,3 @@
|
||||||
{{#if (gt @items.length 0)}}
|
|
||||||
{{#if (eq this.healthCheck.check 'empty') }}
|
{{#if (eq this.healthCheck.check 'empty') }}
|
||||||
<dl class={{this.healthCheck.check}}>
|
<dl class={{this.healthCheck.check}}>
|
||||||
<dt>
|
<dt>
|
||||||
|
@ -28,5 +27,4 @@
|
||||||
<dd>{{this.healthCheck.count}}/{{@items.length}} {{@type}} checks {{this.healthCheck.status}}</dd>
|
<dd>{{this.healthCheck.count}}/{{@items.length}} {{@type}} checks {{this.healthCheck.status}}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
{{/if}}
|
|
|
@ -30,7 +30,7 @@ as |item index|>
|
||||||
<span class="leader" data-test-leader={{@leader.Address}}>Leader</span>
|
<span class="leader" data-test-leader={{@leader.Address}}>Leader</span>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
<span>
|
<span>
|
||||||
{{format-number item.Services.length}} {{pluralize item.Services.length 'Service' without-count=true}}
|
{{format-number item.MeshServiceInstances.length}} {{pluralize item.MeshServiceInstances.length 'Service' without-count=true}}
|
||||||
</span>
|
</span>
|
||||||
<dl>
|
<dl>
|
||||||
<dt>
|
<dt>
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import Model, { attr, hasMany } from '@ember-data/model';
|
import Model, { attr, hasMany } from '@ember-data/model';
|
||||||
import { computed } from '@ember/object';
|
import { computed } from '@ember/object';
|
||||||
|
import { filter } from '@ember/object/computed';
|
||||||
import { fragmentArray } from 'ember-data-model-fragments/attributes';
|
import { fragmentArray } from 'ember-data-model-fragments/attributes';
|
||||||
|
|
||||||
export const PRIMARY_KEY = 'uid';
|
export const PRIMARY_KEY = 'uid';
|
||||||
|
@ -18,8 +19,13 @@ export default class Node extends Model {
|
||||||
@attr() meta; // {}
|
@attr() meta; // {}
|
||||||
@attr() Meta; // {}
|
@attr() Meta; // {}
|
||||||
@attr() TaggedAddresses; // {lan, wan}
|
@attr() TaggedAddresses; // {lan, wan}
|
||||||
|
// Services are reshaped to a different shape to what you sometimes get from
|
||||||
|
// the response, see models/node.js
|
||||||
@hasMany('service-instance') Services; // TODO: Rename to ServiceInstances
|
@hasMany('service-instance') Services; // TODO: Rename to ServiceInstances
|
||||||
@fragmentArray('health-check') Checks;
|
@fragmentArray('health-check') Checks;
|
||||||
|
// MeshServiceInstances are all instances that aren't connect-proxies this
|
||||||
|
// currently includes gateways as these need to show up in listings
|
||||||
|
@filter('Services', item => item.Service.Kind !== 'connect-proxy') MeshServiceInstances;
|
||||||
|
|
||||||
@computed('Checks.[]', 'ChecksCritical', 'ChecksPassing', 'ChecksWarning')
|
@computed('Checks.[]', 'ChecksCritical', 'ChecksPassing', 'ChecksWarning')
|
||||||
get Status() {
|
get Status() {
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
(reject-by 'Service.Kind' 'connect-proxy' item.Services)
|
item.MeshServiceInstances
|
||||||
|
|
||||||
as |sort filters items|}}
|
as |sort filters items|}}
|
||||||
<div class="tab-section">
|
<div class="tab-section">
|
||||||
|
|
Loading…
Reference in New Issue