github.com/outbrain/consul@v1.4.5/ui-v2/app/controllers/dc/nodes/index.js (about)

     1  import Controller from '@ember/controller';
     2  import { computed } from '@ember/object';
     3  import WithHealthFiltering from 'consul-ui/mixins/with-health-filtering';
     4  import { get } from '@ember/object';
     5  export default Controller.extend(WithHealthFiltering, {
     6    init: function() {
     7      this._super(...arguments);
     8      this.columns = [25, 25, 25, 25];
     9    },
    10    unhealthy: computed('filtered', function() {
    11      return get(this, 'filtered').filter(function(item) {
    12        return get(item, 'isUnhealthy');
    13      });
    14    }),
    15    healthy: computed('filtered', function() {
    16      return get(this, 'filtered').filter(function(item) {
    17        return get(item, 'isHealthy');
    18      });
    19    }),
    20    filter: function(item, { s = '', status = '' }) {
    21      return (
    22        get(item, 'Node')
    23          .toLowerCase()
    24          .indexOf(s.toLowerCase()) !== -1 && item.hasStatus(status)
    25      );
    26    },
    27  });