github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/ui/app/routes/clients/client.js (about)

     1  import { inject as service } from '@ember/service';
     2  import Route from '@ember/routing/route';
     3  import notifyError from 'nomad-ui/utils/notify-error';
     4  
     5  export default class ClientRoute extends Route {
     6    @service store;
     7  
     8    model() {
     9      return super.model(...arguments).catch(notifyError(this));
    10    }
    11  
    12    breadcrumbs(model) {
    13      if (!model) return [];
    14      return [
    15        {
    16          label: model.get('shortId'),
    17          args: ['clients.client', model.get('id')],
    18        },
    19      ];
    20    }
    21  
    22    afterModel(model) {
    23      if (model && model.get('isPartial')) {
    24        return model.reload().then(node => node.get('allocations'));
    25      }
    26      return model && model.get('allocations');
    27    }
    28  }