github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/ui/app/controllers/jobs/job/index.js (about)

     1  import { inject as service } from '@ember/service';
     2  import { alias } from '@ember/object/computed';
     3  import Controller from '@ember/controller';
     4  import WithNamespaceResetting from 'nomad-ui/mixins/with-namespace-resetting';
     5  import { action } from '@ember/object';
     6  import classic from 'ember-classic-decorator';
     7  
     8  @classic
     9  export default class IndexController extends Controller.extend(WithNamespaceResetting) {
    10    @service system;
    11  
    12    queryParams = [
    13      {
    14        currentPage: 'page',
    15      },
    16      {
    17        sortProperty: 'sort',
    18      },
    19      {
    20        sortDescending: 'desc',
    21      },
    22    ];
    23  
    24    currentPage = 1;
    25  
    26    @alias('model') job;
    27  
    28    sortProperty = 'name';
    29    sortDescending = false;
    30  
    31    @action
    32    gotoTaskGroup(taskGroup) {
    33      this.transitionToRoute('jobs.job.task-group', taskGroup.get('job'), taskGroup);
    34    }
    35  
    36    @action
    37    gotoJob(job) {
    38      this.transitionToRoute('jobs.job', job, {
    39        queryParams: { jobNamespace: job.get('namespace.name') },
    40      });
    41    }
    42  }