github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/ui/app/components/job-page/parts/task-groups.js (about)

     1  import Component from '@ember/component';
     2  import { action, computed } from '@ember/object';
     3  import { inject as service } from '@ember/service';
     4  import { alias } from '@ember/object/computed';
     5  import Sortable from 'nomad-ui/mixins/sortable';
     6  import { classNames } from '@ember-decorators/component';
     7  import classic from 'ember-classic-decorator';
     8  
     9  @classic
    10  @classNames('boxed-section')
    11  export default class TaskGroups extends Component.extend(Sortable) {
    12    @service router;
    13  
    14    job = null;
    15  
    16    // Provide a value that is bound to a query param
    17    sortProperty = null;
    18    sortDescending = null;
    19  
    20    @action
    21    gotoTaskGroup(taskGroup) {
    22      this.router.transitionTo('jobs.job.task-group', this.job, taskGroup.name);
    23    }
    24  
    25    @computed('job.taskGroups.[]')
    26    get taskGroups() {
    27      return this.get('job.taskGroups') || [];
    28    }
    29  
    30    @alias('taskGroups') listToSort;
    31    @alias('listSorted') sortedTaskGroups;
    32  }