mirror of
https://github.com/status-im/consul.git
synced 2025-01-27 22:16:23 +00:00
5f39bfd161
1. The grid based unhealthy cards are now clamped to only four wide maximum. This means that on larger screen the cards are much wider meaning you can view more information. Grid gutters are also clamped at a certain ideal width screen, remaining responsive for anything below this. 2. The healthy node columns are finally responsive following the same column rules as unhealthy nodes
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
import Controller from '@ember/controller';
|
|
import { get } from '@ember/object';
|
|
import { computed } from '@ember/object';
|
|
import sumOfUnhealthy from 'consul-ui/utils/sumOfUnhealthy';
|
|
import hasStatus from 'consul-ui/utils/hasStatus';
|
|
import WithHealthFiltering from 'consul-ui/mixins/with-health-filtering';
|
|
export default Controller.extend(WithHealthFiltering, {
|
|
init: function() {
|
|
this._super(...arguments);
|
|
},
|
|
unhealthy: computed('filtered', function() {
|
|
return get(this, 'filtered').filter(function(item) {
|
|
return sumOfUnhealthy(item.Checks) > 0;
|
|
});
|
|
}),
|
|
healthy: computed('filtered', function() {
|
|
return get(this, 'filtered').filter(function(item) {
|
|
return sumOfUnhealthy(item.Checks) === 0;
|
|
});
|
|
}),
|
|
filter: function(item, { s = '', status = '' }) {
|
|
const term = s.toLowerCase();
|
|
|
|
return (
|
|
get(item, 'Node.Node')
|
|
.toLowerCase()
|
|
.indexOf(term) !== -1 ||
|
|
(get(item, 'Service.ID')
|
|
.toLowerCase()
|
|
.indexOf(term) !== -1 &&
|
|
hasStatus(get(item, 'Checks'), status))
|
|
);
|
|
},
|
|
});
|