github.com/hernad/nomad@v1.6.112/ui/app/components/job-page/parts/task-groups.js (about)

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