mirror of
https://github.com/status-im/consul.git
synced 2025-02-10 20:56:46 +00:00
* Upgrade consul-api-dobule to version 3.1.3 * Create ConsulInstaceChecks component with test * Redesign: Service Instaces tab in for a Node * Update Node tests to work with the ConsulServiceInstancesList * Style fix to the copy button in the composite-row details * Delete helper and move logic to ConsulInstanceChecks component * Delete unused component consul-node-service-list
29 lines
683 B
JavaScript
29 lines
683 B
JavaScript
import Controller from '@ember/controller';
|
|
import { alias } from '@ember/object/computed';
|
|
import { get, computed } from '@ember/object';
|
|
|
|
export default Controller.extend({
|
|
items: alias('item.Services'),
|
|
queryParams: {
|
|
search: {
|
|
as: 'filter',
|
|
replace: true,
|
|
},
|
|
},
|
|
checks: computed('item.Checks.[]', function() {
|
|
const checks = {};
|
|
get(this, 'item.Checks')
|
|
.filter(item => {
|
|
return item.ServiceID !== '';
|
|
})
|
|
.forEach(item => {
|
|
if (typeof checks[item.ServiceID] === 'undefined') {
|
|
checks[item.ServiceID] = [];
|
|
}
|
|
checks[item.ServiceID].push(item);
|
|
});
|
|
|
|
return checks;
|
|
}),
|
|
});
|