github.com/outbrain/consul@v1.4.5/ui-v2/app/routes/dc/intentions/edit.js (about)

     1  import Route from '@ember/routing/route';
     2  import { inject as service } from '@ember/service';
     3  import { hash } from 'rsvp';
     4  import { get } from '@ember/object';
     5  
     6  import WithAclActions from 'consul-ui/mixins/intention/with-actions';
     7  
     8  export default Route.extend(WithAclActions, {
     9    repo: service('repository/intention'),
    10    servicesRepo: service('repository/service'),
    11    model: function(params) {
    12      return hash({
    13        isLoading: false,
    14        item: get(this, 'repo').findBySlug(params.id, this.modelFor('dc').dc.Name),
    15        items: get(this, 'servicesRepo').findAllByDatacenter(this.modelFor('dc').dc.Name),
    16        intents: ['allow', 'deny'],
    17      }).then(function(model) {
    18        return {
    19          ...model,
    20          ...{
    21            items: [{ Name: '*' }].concat(
    22              model.items.toArray().filter(item => get(item, 'Kind') !== 'connect-proxy')
    23            ),
    24          },
    25        };
    26      });
    27    },
    28    setupController: function(controller, model) {
    29      this._super(...arguments);
    30      controller.setProperties(model);
    31    },
    32  });