github.com/blixtra/nomad@v0.7.2-0.20171221000451-da9a1d7bb050/ui/app/controllers/jobs/job/task-group.js (about)

     1  import Ember from 'ember';
     2  import Sortable from 'nomad-ui/mixins/sortable';
     3  import Searchable from 'nomad-ui/mixins/searchable';
     4  import WithNamespaceResetting from 'nomad-ui/mixins/with-namespace-resetting';
     5  
     6  const { Controller, computed, inject } = Ember;
     7  
     8  export default Controller.extend(Sortable, Searchable, WithNamespaceResetting, {
     9    jobController: inject.controller('jobs.job'),
    10  
    11    queryParams: {
    12      currentPage: 'page',
    13      searchTerm: 'search',
    14      sortProperty: 'sort',
    15      sortDescending: 'desc',
    16    },
    17  
    18    currentPage: 1,
    19    pageSize: 10,
    20  
    21    sortProperty: 'modifyIndex',
    22    sortDescending: true,
    23  
    24    searchProps: computed(() => ['shortId', 'name']),
    25  
    26    allocations: computed('model.allocations.[]', function() {
    27      return this.get('model.allocations') || [];
    28    }),
    29  
    30    listToSort: computed.alias('allocations'),
    31    listToSearch: computed.alias('listSorted'),
    32    sortedAllocations: computed.alias('listSearched'),
    33  
    34    breadcrumbs: computed('jobController.breadcrumbs.[]', 'model.{name}', function() {
    35      return this.get('jobController.breadcrumbs').concat([
    36        { label: this.get('model.name'), args: ['jobs.job.task-group', this.get('model.name')] },
    37      ]);
    38    }),
    39  
    40    actions: {
    41      gotoAllocation(allocation) {
    42        this.transitionToRoute('allocations.allocation', allocation);
    43      },
    44    },
    45  });